/* ==========================================================================
   DESIGN TOKENS - InsightBench Brand System
   Based on 5 frequency bar colors from the LeverHR logo
   ========================================================================== */

:root {
    /* ==========================================================================
       BRAND COLOR SCALES
       5 core colors from the logo frequency bars, each with 10 shades
       ========================================================================== */

    /* Bar 1: Indigo (Primary) - darkened for better contrast with pink */
    --brand-indigo-50: #eef2ff;
    --brand-indigo-100: #e0e7ff;
    --brand-indigo-200: #c7d2fe;
    --brand-indigo-300: #a5b4fc;
    --brand-indigo-400: #818cf8;
    --brand-indigo-500: #6366f1;
    --brand-indigo-600: #4f46e5;
    --brand-indigo-700: #4338ca;
    --brand-indigo-800: #3730a3;
    --brand-indigo-900: #312e81;

    /* Bar 2: Green (Success) */
    --brand-green-50: #f0fdf4;
    --brand-green-100: #dcfce7;
    --brand-green-200: #bbf7d0;
    --brand-green-300: #86efac;
    --brand-green-400: #4ade80;
    --brand-green-500: #22c55e;
    --brand-green-600: #16a34a;
    --brand-green-700: #15803d;
    --brand-green-800: #166534;
    --brand-green-900: #14532d;

    /* Bar 3: Amber (Warning) */
    --brand-amber-50: #fffbeb;
    --brand-amber-100: #fef3c7;
    --brand-amber-200: #fde68a;
    --brand-amber-300: #fcd34d;
    --brand-amber-400: #fbbf24;
    --brand-amber-500: #f59e0b;
    --brand-amber-600: #d97706;
    --brand-amber-700: #b45309;
    --brand-amber-800: #92400e;
    --brand-amber-900: #78350f;

    /* Bar 4: Pink (Accent) */
    --brand-pink-50: #fdf2f8;
    --brand-pink-100: #fce7f3;
    --brand-pink-200: #fbcfe8;
    --brand-pink-300: #f9a8d4;
    --brand-pink-400: #f472b6;
    --brand-pink-500: #ec4899;
    --brand-pink-600: #db2777;
    --brand-pink-700: #be185d;
    --brand-pink-800: #9d174d;
    --brand-pink-900: #831843;

    /* Bar 5: Red (Danger) */
    --brand-red-50: #fef2f2;
    --brand-red-100: #fee2e2;
    --brand-red-200: #fecaca;
    --brand-red-300: #fca5a5;
    --brand-red-400: #f87171;
    --brand-red-500: #ef4444;
    --brand-red-600: #dc2626;
    --brand-red-700: #b91c1c;
    --brand-red-800: #991b1b;
    --brand-red-900: #7f1d1d;

    /* Teal (Secondary accent) */
    --brand-teal-50: #f0fdfa;
    --brand-teal-100: #ccfbf1;
    --brand-teal-200: #99f6e4;
    --brand-teal-300: #5eead4;
    --brand-teal-400: #2dd4bf;
    --brand-teal-500: #14b8a6;
    --brand-teal-600: #0d9488;
    --brand-teal-700: #0f766e;
    --brand-teal-800: #115e59;
    --brand-teal-900: #134e4a;

    /* ==========================================================================
       NEUTRAL SCALE (Grays)
       ========================================================================== */
    /* Target-zone tint — the "inside target" band drawn on a track or chart.
       One pair so the span target zone, pay-band strip, pay-equity zone and the
       gender balance bands all read as the same thing. Aliases --brand-green-500. */
    --zone-target-fill: rgba(34, 197, 94, 0.12);
    --zone-target-edge: rgba(34, 197, 94, 0.35);
    --zone-watch-fill: rgba(245, 158, 11, 0.14);   /* amber tint: the watch band on a scale, and where two bands overlap */

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --black: #000000;

    /* ==========================================================================
       SEMANTIC COLOR TOKENS
       Map brand colors to semantic meanings
       ========================================================================== */

    /* Primary - Indigo (main actions, links, focus states) */
    --primary: var(--brand-indigo-600);
    --primary-color: var(--brand-indigo-600); /* Legacy alias */
    --primary-hover: var(--brand-indigo-700);
    --primary-active: var(--brand-indigo-800);
    --primary-light: var(--brand-indigo-100);
    --primary-lighter: var(--brand-indigo-50);

    /* Success - Green (confirmations, positive states) */
    --success: var(--brand-green-600);
    --success-hover: var(--brand-green-700);
    --success-light: var(--brand-green-100);
    --success-lighter: var(--brand-green-50);

    /* Warning - Amber (cautions, pending states) */
    --warning: var(--brand-amber-500);
    --warning-hover: var(--brand-amber-600);
    --warning-light: var(--brand-amber-100);
    --warning-lighter: var(--brand-amber-50);

    /* Danger - Red (errors, destructive actions) */
    --danger: var(--brand-red-600);
    --danger-hover: var(--brand-red-700);
    --danger-light: var(--brand-red-100);
    --danger-lighter: var(--brand-red-50);

    /* Accent - Pink (highlights, special features) */
    --accent: var(--brand-pink-500);
    --accent-hover: var(--brand-pink-600);
    --accent-light: var(--brand-pink-100);
    --accent-lighter: var(--brand-pink-50);

    /* Gender colors - neutral palette (no gendered colour associations) */
    --gender-female: #3b82f6;
    --gender-female-dark: #2563eb;
    --gender-female-light: #dbeafe;
    --gender-male: var(--brand-teal-500);
    --gender-male-dark: var(--brand-teal-600);
    --gender-male-light: var(--brand-teal-100);
    --gender-other: var(--gray-400);
    --gender-other-dark: var(--gray-500);
    --gender-other-light: var(--gray-200);

    /* Chart palette — used by all Chart.js charts. Indigo is for navigation only. */
    --chart-1: #14b8a6;  /* Teal — primary data series */
    --chart-2: #3b82f6;  /* Blue — secondary */
    --chart-3: #ec4899;  /* Pink — tertiary */
    --chart-4: #f59e0b;  /* Amber — warm accent */
    --chart-5: #06b6d4;  /* Cyan — cool complement */
    --chart-6: #8b5cf6;  /* Violet — purple (not indigo) */
    --chart-7: #f97316;  /* Orange — distinct from amber */
    --chart-8: #059669;  /* Emerald — distinct from teal */
    --chart-9: #e11d48;  /* Rose — deep pink */
    --chart-10: #64748b; /* Slate — neutral / "Others" */

    /* ==========================================================================
       TEXT COLORS
       ========================================================================== */
    --text-primary: var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-tertiary: var(--gray-500);
    --text-muted: var(--gray-400);
    --text-inverse: var(--white);
    --text-link: var(--primary);
    --text-link-hover: var(--primary-hover);

    /* ==========================================================================
       BACKGROUND COLORS
       ========================================================================== */
    --bg-primary: var(--white);
    --bg-secondary: var(--gray-50);
    --bg-tertiary: var(--gray-100);
    --bg-inverse: var(--gray-900);
    --bg-overlay: rgba(0, 0, 0, 0.5);

    /* ==========================================================================
       BORDER COLORS
       ========================================================================== */
    --border-light: var(--gray-200);
    --border-default: var(--gray-300);
    --border-dark: var(--gray-400);
    --border-focus: var(--primary);

    /* ==========================================================================
       COMPONENT TOKENS - Navigation
       ========================================================================== */
    --nav-bg: var(--brand-indigo-900);
    --nav-bg-hover: var(--brand-indigo-800);
    --nav-text: var(--white);
    --nav-text-muted: rgba(255, 255, 255, 0.7);
    --nav-active-bg: rgba(255, 255, 255, 0.1);
    --nav-border: rgba(255, 255, 255, 0.1);

    /* ==========================================================================
       COMPONENT TOKENS - Buttons
       ========================================================================== */

    /* Primary Button */
    --btn-primary-bg: var(--primary);
    --btn-primary-bg-hover: var(--primary-hover);
    --btn-primary-text: var(--white);
    --btn-primary-border: var(--primary);

    /* Secondary Button */
    --btn-secondary-bg: var(--white);
    --btn-secondary-bg-hover: var(--gray-50);
    --btn-secondary-text: var(--gray-700);
    --btn-secondary-border: var(--gray-300);

    /* Danger Button */
    --btn-danger-bg: var(--danger);
    --btn-danger-bg-hover: var(--danger-hover);
    --btn-danger-text: var(--white);
    --btn-danger-border: var(--danger);

    /* Success Button */
    --btn-success-bg: var(--success);
    --btn-success-bg-hover: var(--success-hover);
    --btn-success-text: var(--white);
    --btn-success-border: var(--success);

    /* Outline Button */
    --btn-outline-bg: transparent;
    --btn-outline-bg-hover: var(--primary-lighter);
    --btn-outline-text: var(--primary);
    --btn-outline-border: var(--primary);

    /* ==========================================================================
       COMPONENT TOKENS - Form Inputs
       ========================================================================== */
    --input-bg: var(--white);
    --input-bg-disabled: var(--gray-100);
    --input-border: var(--gray-300);
    --input-border-hover: var(--gray-400);
    --input-border-focus: var(--primary);
    --input-text: var(--gray-900);
    --input-placeholder: var(--gray-400);
    --input-error-border: var(--danger);
    --input-error-bg: var(--danger-lighter);

    /* ==========================================================================
       COMPONENT TOKENS - Cards
       ========================================================================== */
    --card-bg: var(--white);
    --card-border: var(--gray-200);
    --card-shadow: var(--shadow);
    --card-header-bg: var(--gray-50);
    --card-header-border: var(--gray-200);

    /* ==========================================================================
       COMPONENT TOKENS - Tables
       ========================================================================== */
    --table-header-bg: var(--gray-50);
    --table-header-text: var(--gray-700);
    --table-border: var(--gray-200);
    --table-row-hover: var(--gray-50);
    --table-row-stripe: var(--gray-50);

    /* ==========================================================================
       COMPONENT TOKENS - Badges
       ========================================================================== */

    /* Status Badges */
    --badge-active-bg: var(--success-light);
    --badge-active-text: var(--brand-green-800);
    --badge-pending-bg: var(--warning-light);
    --badge-pending-text: var(--brand-amber-800);
    --badge-suspended-bg: var(--danger-light);
    --badge-suspended-text: var(--brand-red-800);

    /* Role Badges */
    --badge-admin-bg: var(--brand-indigo-100);
    --badge-admin-text: var(--brand-indigo-800);
    --badge-editor-bg: var(--brand-green-100);
    --badge-editor-text: var(--brand-green-800);
    --badge-viewer-bg: var(--gray-100);
    --badge-viewer-text: var(--gray-700);
    --badge-superuser-bg: var(--brand-pink-100);
    --badge-superuser-text: var(--brand-pink-800);
    --badge-cluster-bg: var(--brand-purple-100);
    --badge-cluster-text: var(--brand-purple-800);

    /* ==========================================================================
       COMPONENT TOKENS - Modals
       ========================================================================== */
    --modal-bg: var(--white);
    --modal-overlay: rgba(0, 0, 0, 0.5);
    --modal-border: var(--gray-200);
    --modal-header-bg: var(--gray-50);
    --modal-header-border: var(--gray-200);

    /* ==========================================================================
       COMPONENT TOKENS - Toasts
       ========================================================================== */
    --toast-success-bg: var(--success-light);
    --toast-success-border: var(--success);
    --toast-success-text: var(--brand-green-800);
    --toast-error-bg: var(--danger-light);
    --toast-error-border: var(--danger);
    --toast-error-text: var(--brand-red-800);
    --toast-warning-bg: var(--warning-light);
    --toast-warning-border: var(--warning);
    --toast-warning-text: var(--brand-amber-800);
    --toast-info-bg: var(--primary-light);
    --toast-info-border: var(--primary);
    --toast-info-text: var(--brand-indigo-800);

    /* ==========================================================================
       COMPONENT TOKENS - Tabs
       ========================================================================== */
    --tab-bg: transparent;
    --tab-bg-active: var(--white);
    --tab-text: var(--gray-600);
    --tab-text-active: var(--primary);
    --tab-border: var(--gray-200);
    --tab-border-active: var(--primary);

    /* ==========================================================================
       ANALYTICS CARD GRADIENTS
       Each maps to one of the 5 brand colors
       ========================================================================== */

    /* Indigo family - Primary analytics */
    --analytics-indigo-gradient: linear-gradient(135deg, var(--brand-indigo-500) 0%, var(--brand-indigo-700) 100%);
    --analytics-indigo-light: var(--brand-indigo-50);
    --analytics-indigo-border: var(--brand-indigo-200);
    --analytics-indigo-text: var(--brand-indigo-900);

    /* Green family - Positive metrics */
    --analytics-green-gradient: linear-gradient(135deg, var(--brand-green-500) 0%, var(--brand-green-700) 100%);
    --analytics-green-light: var(--brand-green-50);
    --analytics-green-border: var(--brand-green-200);
    --analytics-green-text: var(--brand-green-900);

    /* Amber family - Warning/neutral metrics */
    --analytics-amber-gradient: linear-gradient(135deg, var(--brand-amber-400) 0%, var(--brand-amber-600) 100%);
    --analytics-amber-light: var(--brand-amber-50);
    --analytics-amber-border: var(--brand-amber-200);
    --analytics-amber-text: var(--brand-amber-900);

    /* Pink family - Accent metrics */
    --analytics-pink-gradient: linear-gradient(135deg, var(--brand-pink-400) 0%, var(--brand-pink-600) 100%);
    --analytics-pink-light: var(--brand-pink-50);
    --analytics-pink-border: var(--brand-pink-200);
    --analytics-pink-text: var(--brand-pink-900);

    /* Red family - Critical/attention metrics */
    --analytics-red-gradient: linear-gradient(135deg, var(--brand-red-500) 0%, var(--brand-red-700) 100%);
    --analytics-red-light: var(--brand-red-50);
    --analytics-red-border: var(--brand-red-200);
    --analytics-red-text: var(--brand-red-900);

    /* ==========================================================================
       RAG STATUS COLORS (Red/Amber/Green)
       ========================================================================== */
    --rag-green: var(--brand-green-500);
    --rag-green-bg: var(--brand-green-50);
    --rag-amber: var(--brand-amber-500);
    --rag-amber-bg: var(--brand-amber-50);
    --rag-red: var(--brand-red-500);
    --rag-red-bg: var(--brand-red-50);

    /* ==========================================================================
       SHADOWS
       ========================================================================== */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Focus ring shadow */
    --shadow-focus: 0 0 0 3px rgba(79, 70, 229, 0.3);
    --shadow-focus-danger: 0 0 0 3px rgba(220, 38, 38, 0.3);
    --shadow-focus-success: 0 0 0 3px rgba(22, 163, 74, 0.3);

    /* ==========================================================================
       BORDER RADIUS
       ========================================================================== */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* ==========================================================================
       SPACING SCALE
       ========================================================================== */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */

    /* ==========================================================================
       TYPOGRAPHY
       ========================================================================== */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

    --text-2xs: 0.5rem;    /* 8px  — micro indicators, dots */
    --text-xs: 0.65rem;    /* 10px — chart labels, tooltips, small badges */
    --text-sm: 0.75rem;    /* 12px — metric labels, callouts, table headers, sublabels */
    --text-body: 0.875rem; /* 14px — body text, form inputs, nav pills, subsection titles */
    --text-base: 1rem;     /* 16px — button labels, modal titles, form labels */
    --text-lg: 1.25rem;    /* 20px — card headers, view sub-titles */
    --text-xl: 1.5rem;     /* 24px — L1 metric values, view titles */
    --text-2xl: 2rem;      /* 32px — hero numbers, splash stats */

    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;

    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* ==========================================================================
       TRANSITIONS
       ========================================================================== */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    /* ==========================================================================
       Z-INDEX SCALE
       ========================================================================== */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;

    /* ==========================================================================
       FONT STACKS
       ========================================================================== */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: 'SF Mono', Monaco, Consolas, 'Courier New', monospace;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
}

/* Screens */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Login Screen */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
}

.login-card {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    padding-top: 12px;
}

.logo-svg {
    width: 340px;
    height: auto;
    overflow: visible;
}

/* Login frequency bars color feedback */
#login-freq-bars .freq-bar {
    transition: fill 0.3s ease;
}

#login-freq-bars.login-success .freq-bar {
    fill: var(--brand-green-500);
}

#login-freq-bars.login-error .freq-bar {
    fill: var(--brand-red-500);
}

/* Invite Screen Styles */
.invite-card {
    max-width: 450px;
}

.invite-state {
    padding: 1rem 0;
}

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

.invite-error-icon,
.invite-success-icon {
    margin-bottom: 1rem;
}

.invite-welcome {
    margin-bottom: 1.5rem;
}

.invite-welcome svg {
    margin-bottom: 0.75rem;
}

.invite-welcome h2 {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-900);
    margin: 0 0 0.5rem;
}

.invite-welcome p {
    color: var(--gray-600);
    margin: 0;
}

#invite-error h2 {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-900);
    margin: 0.5rem 0;
}

#invite-error p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

#invite-success h2 {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-900);
    margin: 0.5rem 0;
}

#invite-success p {
    color: var(--gray-600);
    margin-bottom: 1rem;
}

.login-card h1 {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--gray-900);
    margin: 0;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--gray-500);
    margin-bottom: 2rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: var(--text-base);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
    background-color: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* Field-level error state — applied by showFieldError() */
.form-group input.input-error,
.form-group select.input-error,
.form-group textarea.input-error,
.form-group-sm input.input-error,
.form-group-sm select.input-error,
.form-group-sm textarea.input-error {
    border-color: var(--danger);
    background-color: #fff5f5;
}
.form-group input.input-error:focus,
.form-group select.input-error:focus,
.form-group textarea.input-error:focus,
.form-group-sm input.input-error:focus,
.form-group-sm select.input-error:focus,
.form-group-sm textarea.input-error:focus {
    box-shadow: 0 0 0 3px #fecaca;
}
.form-error {
    display: block;
    font-size: var(--text-sm);
    color: var(--danger);
    margin-top: 0.375rem;
    font-weight: var(--font-medium);
}

.form-group.hidden {
    display: none;
}

/* Size modifier: small. Used for compact inline selects/inputs (table rows, side-by-side
   controls). Includes border + focus ring so it works standalone — does not require .form-group.
   Per docs/ui-elements.md → Selects + dropdowns (Approved 2026-06-11). */
.form-group-sm select,
.form-group-sm input,
.form-group-sm textarea {
    padding: 0.4rem 0.6rem;
    font-size: var(--text-sm);
    line-height: 1.4;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    color: var(--gray-800);
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
/* One height for a select and an input side by side (a select ignores line-height) */
.form-group-sm select,
.form-group-sm input:not([type="checkbox"]):not([type="radio"]) {
    height: 2rem;
    box-sizing: border-box;
}
.form-group-sm select:focus,
.form-group-sm input:focus,
.form-group-sm textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-group-sm select:disabled,
.form-group-sm input:disabled,
.form-group-sm textarea:disabled {
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

/* Read-only form value display */
.form-value-display {
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: var(--text-body);
    color: var(--gray-700);
}

/* Form section title with indicator */
.form-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-hint {
    display: block;
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: 0.375rem;
}

/* 2FA Setup Overlay & Modal */
.twofa-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.twofa-modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 450px;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
}

.twofa-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.twofa-header svg {
    margin-bottom: 1rem;
}

.twofa-header h2 {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-900);
    margin: 0 0 0.5rem 0;
}

.twofa-header p {
    color: var(--gray-600);
    font-size: var(--text-body);
    margin: 0;
}

.twofa-step {
    text-align: center;
}

.twofa-step-number {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.twofa-step > p {
    color: var(--gray-600);
    font-size: var(--text-body);
    margin-bottom: 1rem;
}

.twofa-qr-container {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.twofa-qr-container img {
    width: 200px;
    height: 200px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.5rem;
    background: white;
}

.twofa-secret {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.twofa-secret p {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin: 0 0 0.5rem 0;
}

.twofa-secret code {
    font-family: var(--font-mono);
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    letter-spacing: 0.5px;
    word-break: break-all;
}

.twofa-code-input {
    font-family: var(--font-mono);
    font-size: var(--text-xl);
    text-align: center;
    letter-spacing: 0.5rem;
    padding: 0.75rem;
    max-width: 200px;
    margin: 0 auto;
    display: block;
}

.twofa-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.twofa-success {
    text-align: center;
    margin-bottom: 1.5rem;
}

.twofa-success svg {
    margin-bottom: 0.5rem;
}

.twofa-success h3 {
    color: var(--brand-green-600);
    font-size: var(--text-lg);
    margin: 0;
}

.twofa-backup-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem 0;
}

.twofa-backup-codes code {
    font-family: var(--font-mono);
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    background: white;
    padding: 0.5rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--gray-200);
}

.twofa-warning {
    font-size: var(--text-body);
    color: var(--brand-amber-700);
    background: var(--warning-light);
    border: 1px solid var(--brand-amber-300);
    border-radius: var(--radius);
    padding: 0.75rem;
    margin: 1rem 0;
}

/* Hotel Assignment Grid (for Multi Hotel User) */
.hotel-assign-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    max-height: 200px;
    overflow-y: auto;
}

/* ══════════════════════════════════════════════════════════════════════════════
   CHECKBOXES — Family 7 canonical
   - .checkbox          : inline labelled checkbox (replaces .checkbox-label etc.)
   - .checkbox-card     : selectable bordered card (replaces 7 bespoke variants)
   - .checkbox-grid     : grid container for .checkbox children
   - .checkbox-card-grid: grid container for .checkbox-card children
   ══════════════════════════════════════════════════════════════════════════════ */

/* Inline labelled checkbox */
.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: var(--text-body);
    color: var(--gray-600);
    user-select: none;
}

.checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.checkbox:has(input:checked) {
    color: var(--gray-800);
}

/* Selectable bordered card with checkbox */
.checkbox-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: var(--text-body);
    color: var(--gray-700);
}

.checkbox-card:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.checkbox-card:has(input:checked) {
    background: var(--primary-light);
    border-color: var(--primary);
}

.checkbox-card:has(input:checked) span {
    color: var(--primary);
    font-weight: var(--font-medium);
}

.checkbox-card input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

/* Grid containers */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}

.checkbox-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

/* ══════════════════════════════════════════════════════════════════════════════
   RADIO BUTTONS — Family 8 canonical (mirrors Checkboxes)
   - .radio          : inline labelled native radio
   - .radio-card     : selectable bordered card (via :has(input:checked))
   - .radio-grid     : grid container for .radio children
   - .radio-card-grid: grid container for .radio-card children
   ══════════════════════════════════════════════════════════════════════════════ */

.radio {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: var(--text-body);
    color: var(--gray-600);
    user-select: none;
}

.radio input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.radio:has(input:checked) {
    color: var(--gray-800);
}

.radio-card {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: var(--text-body);
    color: var(--gray-700);
}

.radio-card:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.radio-card:has(input:checked) {
    background: var(--primary-light);
    border-color: var(--primary);
}

.radio-card input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
}

.radio-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.no-hotels-msg {
    color: var(--gray-500);
    font-size: var(--text-body);
    text-align: center;
    padding: 1rem;
    width: 100%;
}

/* Assigned hotels cell in table */
.assigned-hotels-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.error-message {
    color: var(--danger);
    font-size: var(--text-body);
    margin-top: 1rem;
    min-height: 1.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;   /* an <a class="btn"> (a link that navigates) looks like the buttons beside it */
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    opacity: 0.7;
}

/* A disabled red button looked live until 2026-10-06 (approved with the Data
   erasure type-to-confirm, docs/ui-elements.md). Same treatment as primary. */
.btn-danger:disabled,
.btn-danger:disabled:hover {
    background: var(--gray-300);
    border-color: var(--gray-300);
    color: var(--white);
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-outline {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

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

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: var(--text-body);
}

/* Action buttons group for tables */
.action-buttons {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    justify-content: flex-end;
}

.action-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.6rem;
    font-size: var(--text-sm);
    white-space: nowrap;
}

.action-buttons .btn svg {
    flex-shrink: 0;
}

.action-buttons .btn-danger-outline {
    padding: 0.35rem 0.5rem;
}

#login-form .btn {
    width: 100%;
    margin-top: 0.5rem;
}

/* Navbar */
/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 60px;
    min-width: 60px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: width 0.25s ease, min-width 0.25s ease;
}

.sidebar.expanded,
.sidebar.pinned {
    width: 260px;
    min-width: 260px;
}

.sidebar-header {
    height: 60px; /* Fixed height prevents icon hopping - increased for larger logo */
    padding: 0 0.75rem;
    background: var(--gray-900);
    border-bottom: none;
    margin-right: -1px; /* Bleed over sidebar border-right to merge with dark top bar */
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    overflow: hidden;
}

/* Collapsed sidebar header centers logo */
.sidebar:not(.expanded):not(.pinned) .sidebar-header {
    padding: 0 0.5rem;
    justify-content: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: var(--font-semibold);
    font-size: var(--text-lg);
    color: var(--white);
}

/* Pin button */
.sidebar-pin-btn {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, background 0.15s, transform 0.25s;
    flex-shrink: 0;
}

.sidebar.expanded .sidebar-pin-btn,
.sidebar.pinned .sidebar-pin-btn {
    opacity: 1;
}

.sidebar-pin-btn:hover {
    background: var(--gray-700);
    color: white;
}

.sidebar.pinned .sidebar-pin-btn {
    color: var(--primary);
    transform: rotate(45deg);
}

/* Hide pin button when collapsed */
.sidebar:not(.expanded):not(.pinned) .sidebar-pin-btn {
    display: none;
}

/* Frequency bar logo — sidebar nav */
/* Full logo (hidden when collapsed) */
.nav-logo-svg.nav-logo-full {
    width: 234px; /* 180px + 30% */
    display: block;
}

.sidebar:not(.expanded):not(.pinned) .nav-logo-svg.nav-logo-full {
    display: none;
}

/* Collapsed logo (icon only - shown when collapsed) */
.nav-logo-svg.nav-logo-collapsed {
    width: 40px;
    display: none;
}

.sidebar:not(.expanded):not(.pinned) .nav-logo-svg.nav-logo-collapsed {
    display: block;
}

.nav-logo-svg {
    width: 234px; /* 180px + 30% */
    height: 47px; /* 36px + 30% for consistent header size */
    overflow: visible;
}

.nav-brand {
    padding-top: 0;
}

/* Logo frequency-bar pulse: L→R then R→L alternating in a single 10s cycle */
.logo-svg rect,
.nav-logo-svg rect {
    transform-box: fill-box;
    transform-origin: center center;
}

/* Bar 1: L→R first (5%), R→L last (63%) */
@keyframes pulse1 {
    0%, 4%, 8%, 100% { transform: scaleY(1); }
    6% { transform: scaleY(1.25); }
    56%, 60% { transform: scaleY(1); }
    58% { transform: scaleY(1.25); }
}
/* Bar 2: L→R second (7%), R→L fourth (56%) */
@keyframes pulse2 {
    0%, 6%, 10%, 100% { transform: scaleY(1); }
    8% { transform: scaleY(1.25); }
    54%, 58% { transform: scaleY(1); }
    56% { transform: scaleY(1.25); }
}
/* Bar 3: L→R third (9%), R→L third (54%) */
@keyframes pulse3 {
    0%, 8%, 12%, 100% { transform: scaleY(1); }
    10% { transform: scaleY(1.25); }
    52%, 56% { transform: scaleY(1); }
    54% { transform: scaleY(1.25); }
}
/* Bar 4: L→R fourth (11%), R→L second (52%) */
@keyframes pulse4 {
    0%, 10%, 14%, 100% { transform: scaleY(1); }
    12% { transform: scaleY(1.25); }
    50%, 54% { transform: scaleY(1); }
    52% { transform: scaleY(1.25); }
}
/* Bar 5: L→R last (13%), R→L first (50%) */
@keyframes pulse5 {
    0%, 12%, 16%, 100% { transform: scaleY(1); }
    14% { transform: scaleY(1.25); }
    48%, 52% { transform: scaleY(1); }
    50% { transform: scaleY(1.25); }
}

.logo-svg rect:nth-of-type(1),
.nav-logo-svg rect:nth-of-type(1) { animation: pulse1 10s ease-in-out infinite; }
.logo-svg rect:nth-of-type(2),
.nav-logo-svg rect:nth-of-type(2) { animation: pulse2 10s ease-in-out infinite; }
.logo-svg rect:nth-of-type(3),
.nav-logo-svg rect:nth-of-type(3) { animation: pulse3 10s ease-in-out infinite; }
.logo-svg rect:nth-of-type(4),
.nav-logo-svg rect:nth-of-type(4) { animation: pulse4 10s ease-in-out infinite; }
.logo-svg rect:nth-of-type(5),
.nav-logo-svg rect:nth-of-type(5) { animation: pulse5 10s ease-in-out infinite; }

/* ══════════════════════════════════════════════════════════════════════════════
   INSIGHTS LOADING INDICATOR
   ══════════════════════════════════════════════════════════════════════════════ */

/* Empty state — no month selected */
.analysis-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
}

.analysis-empty-state.hidden {
    display: none;
}

.analysis-empty-logo {
    width: 320px;
    height: auto;
    opacity: 0.35;
    overflow: visible;
}

.analysis-empty-text {
    margin-top: 1.5rem;
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--gray-400);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Blocked variant: the account has no property linked, so this is a statement
   of fact rather than a prompt — it wraps as a sentence and loses the
   flex/chevron alignment the prompt version needs. */
.analysis-empty-text--blocked {
    display: block;
    max-width: 30rem;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    line-height: 1.5;
    color: var(--gray-500);
}

/* Bobbing chevron on empty state — points upper-right, bobs diagonally */
.empty-state-chevron {
    width: 20px;
    height: 20px;
    transform: rotate(-45deg);
    stroke: var(--gray-400);
    animation: bobDiag 1.5s ease-in-out infinite;
}

@keyframes bobDiag {
    0%, 100% { transform: rotate(-45deg) translateX(0); }
    50% { transform: rotate(-45deg) translateX(6px); }
}

/* ══════════════════════════════════════════════════════════════════════════════
   LOADERS — Family 28 canonical
   - .wave-loader  : data-fetch loading > 2s with verb + countdown (use getWaveLoaderHtml())
   - .spinner      : circular spinner for inline / button / quick loading
   - .loader-wrapper : centered flex container for spinner+text states
   ══════════════════════════════════════════════════════════════════════════════ */

/* -- Wave loader (canonical 5-bar SVG, verb + countdown) ---------------------- */
.wave-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem 2rem;
    margin: 1rem 0;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.wave-loader.hidden {
    display: none;
}

.wave-loader.wave-loader-compact {
    padding: 1.5rem 1rem;
}

.wave-loader.wave-loader-inline {
    padding: 1rem;
    margin: 0.5rem 0;
    background: var(--gray-50);
    border: none;
}

/* The tallest bar is 48 of the 60-unit box and grows to 1.5x (72) at the top
   of the wave, so it reaches 6 units past the box at each end. The SVG clipped
   it until 2026-10-10: it now overflows into 6px kept free above and below. */
.wave-loader-bars {
    margin-bottom: 0.75rem;
    padding-block: 6px;
}

.loader-bars-svg {
    width: 120px;
    height: 60px;
    overflow: visible;
}

@keyframes loaderWave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.5); }
}

.loader-bars-svg .loader-bar {
    transform-box: fill-box;
    transform-origin: center center;
    animation: loaderWave 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loader-bars-svg .loader-bar:nth-of-type(1) { animation-delay: 0s; }
.loader-bars-svg .loader-bar:nth-of-type(2) { animation-delay: 0.08s; }
.loader-bars-svg .loader-bar:nth-of-type(3) { animation-delay: 0.16s; }
.loader-bars-svg .loader-bar:nth-of-type(4) { animation-delay: 0.24s; }
.loader-bars-svg .loader-bar:nth-of-type(5) { animation-delay: 0.32s; }

.wave-loader-verb {
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    margin: 0.75rem 0 0 0;
    letter-spacing: 0.02em;
    transition: opacity 0.9s ease-in-out;
}

.wave-loader-countdown {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--gray-300, #cbd5e1);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    margin-top: 0.125rem;
    transition: color 0.3s ease;
}

.wave-loader-overtime .wave-loader-countdown {
    color: var(--brand-amber-700);
    background: var(--brand-amber-100);
    padding: 0.125rem 0.625rem;
    border-radius: 999px;
}

.wave-loader.wave-loader-compact .wave-loader-verb {
    margin-top: 0.5rem;
}

.wave-loader.wave-loader-inline .wave-loader-verb {
    margin-top: 0.25rem;
    font-size: var(--text-sm);
}

/* -- Spinner (canonical) ------------------------------------------------------ */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary, var(--primary-color));
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

/* For use on coloured / dark backgrounds (buttons, DR theme, hero gradients) */
.spinner-light {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}

/* -- Loader wrapper (centred container for spinner + text) -------------------- */
.loader-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--gray-500);
    text-align: center;
}

.loader-wrapper-sm {
    padding: 1rem;
    gap: 0.5rem;
}

.loader-wrapper-lg {
    padding: 3rem;
    gap: 1rem;
}

.sidebar-settings-section {
    padding: 0.25rem 0;
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
    margin-bottom: 0;
    overflow: hidden;
    order: 4;
}

.sidebar-nav { order: 1; }
.sidebar-user { order: 2; }
.sidebar-footer { order: 6; }

.sidebar-settings-section .nav-section-title {
    display: none;
}

.sidebar-user {
    padding: 0.4rem 1rem;
    border-top: 1px solid var(--gray-200);
    background: var(--white);
    overflow: hidden;
    transition: visibility 0.25s ease, opacity 0.25s ease;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.user-name {
    color: var(--gray-900);
    font-weight: var(--font-medium);
    font-size: var(--text-body);
}

.sidebar-user .badge {
    font-size: var(--text-xs);
    padding: 0.2rem 0.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 0.25rem 0;
    overflow-y: auto;
    min-height: 0;
}

.nav-section {
    margin-bottom: 0.25rem;
}

.nav-section-title {
    display: block;
    padding: 0.1rem 1rem;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-500);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 1rem;
    color: var(--gray-500);
    text-decoration: none;
    font-weight: var(--font-medium);
    font-size: var(--text-body);
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-link svg {
    flex-shrink: 0;
}

.nav-link:hover {
    color: var(--gray-900);
    background: var(--gray-100);
}

.nav-link.active {
    color: var(--primary);
    background: #eff6ff;
    border-left-color: var(--primary);
}

.nav-link.active svg {
    color: var(--primary);
}

/* ==========================================================================
   SIDEBAR COLLAPSED STATE
   ========================================================================== */

/* Hide user section and settings section when collapsed */
.sidebar:not(.expanded):not(.pinned) .sidebar-user {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    height: 0;
    padding: 0;
    border: none;
    overflow: hidden;
}

.sidebar:not(.expanded):not(.pinned) .sidebar-settings-section {
    border-top: none;
}

/* Hide admin sections when collapsed - only show when expanded/pinned */
.sidebar:not(.expanded):not(.pinned) .nav-section.admin-only {
    display: none;
}

/* Section titles: hide but keep space when collapsed */
.sidebar:not(.expanded):not(.pinned) .nav-section-title,
.sidebar:not(.expanded):not(.pinned) .nav-subsection-title {
    visibility: hidden;
}

/* Nav link text - wrap in span for hiding */
.sidebar .nav-link-text {
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.15s ease, width 0.25s ease;
}

.sidebar:not(.expanded):not(.pinned) .nav-link-text {
    opacity: 0;
    width: 0;
}

/* Keep icons in same position when collapsed (no centering) */
.sidebar:not(.expanded):not(.pinned) .nav-link {
    /* Keep same padding as expanded - icons stay in place */
    padding: 0.3rem 1rem;
}

.sidebar:not(.expanded):not(.pinned) .nav-link.active {
    /* Keep border-left for active indicator */
}

/* Hide ticket badges when collapsed */
.sidebar:not(.expanded):not(.pinned) .ticket-badge {
    display: none !important;
}

/* Sidebar footer when collapsed - keep same padding for consistent icon position */
.sidebar:not(.expanded):not(.pinned) .sidebar-footer {
    padding: 0.5rem 1rem;
}

.sidebar:not(.expanded):not(.pinned) .sidebar-footer .btn {
    /* Keep left alignment, don't center */
    justify-content: flex-start;
}

.sidebar:not(.expanded):not(.pinned) .sidebar-footer .btn .nav-link-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Suppress nav-link / sidebar-footer btn tooltips when sidebar is expanded
   (the label is already visible). Collapsed sidebar uses the canonical global
   [data-tooltip] rule with data-tooltip-side="right" set in markup. */
.sidebar.expanded .nav-link[data-tooltip]:hover::after,
.sidebar.pinned .nav-link[data-tooltip]:hover::after,
.sidebar.expanded .sidebar-footer .btn[data-tooltip]:hover::after,
.sidebar.pinned .sidebar-footer .btn[data-tooltip]:hover::after {
    display: none;
}

.sidebar-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.sidebar-footer .btn {
    width: 60%;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: var(--text-body);
    color: var(--gray-500);
    border-color: var(--gray-300);
    flex-shrink: 0;
}

.sidebar-footer .sidebar-pin-btn {
    margin-left: auto;
}

.sidebar-footer .btn:hover {
    color: var(--gray-900);
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ============================================================
   Canonical Tab system
   Per docs/ui-elements.md → Tabs (Approved 2026-06-11).
   Single global rule replacing 5 bespoke duplicates + 2 scoped versions.
   ============================================================ */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--gray-600);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s ease;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--gray-50);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn svg {
    width: 16px;
    height: 16px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================================
   Canonical iOS-style switch (binary on/off toggle)
   Per docs/ui-elements.md → Toggles / switches (Approved 2026-06-11).
   Default "on" colour is green (var(--success)).
   ============================================================ */
.switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.switch input {
    display: none;
}

.switch-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--gray-300);
    border-radius: 10px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--white);
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: var(--shadow-sm);
}

.switch input:checked + .switch-slider {
    background: var(--success);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(16px);
}

.switch input:disabled + .switch-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.switch-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-500);
}

.switch input:checked ~ .switch-label {
    color: var(--success);
}

/* ============================================================
   Canonical Tooltip system
   Per docs/ui-elements.md → Tooltips (Approved 2026-06-12).
   Two patterns:
     (1) [data-tooltip] attribute — simple text, CSS-only, single line, on hover
     (2) .tooltip child element + positionTooltip() JS helper — rich content,
         fixed-position, viewport-aware auto-flip
   Size modifiers: .tooltip-sm (220px), .tooltip-lg (500px), .tooltip-nowrap.
   Optional: .tooltip-arrow adds a down-arrow via ::after.
   ============================================================ */

/* Pattern 1: [data-tooltip] attribute (CSS-only, hover-triggered) */
[data-tooltip] {
    position: relative;
}
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    transform: translateX(-50%);
    background: var(--gray-800);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: var(--text-xs);
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10000;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.15s;
}
/* Right-positioned variant for sidebar-style icon-only triggers */
[data-tooltip][data-tooltip-side="right"]:hover::after {
    left: calc(100% + 8px);
    bottom: auto;
    top: 50%;
    transform: translateY(-50%);
}

/* Pattern 2: .tooltip child element (rich content, JS-positioned) */
.tooltip {
    display: none;
    position: fixed;
    padding: 0.6rem 0.75rem;
    background: var(--gray-800);
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--font-normal);
    line-height: 1.5;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10000;
    text-align: left;
    white-space: normal;
    pointer-events: none;
}
.tooltip.visible {
    display: block;
}

/* Size modifiers */
.tooltip-sm {
    width: 220px;
}
.tooltip-lg {
    width: 500px;
    max-width: calc(100vw - 40px);
    padding: 0.75rem 1rem;
    font-size: var(--text-sm);
}
.tooltip-nowrap {
    width: auto;
    white-space: nowrap;
}

/* Down-arrow modifier */
.tooltip-arrow::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--gray-800);
}
.tooltip-arrow.tooltip-arrow-up::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--gray-800);
}

/* Sidebar Hotel Selector (for Multi Hotel Users) */
.nav-hotel-selector {
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: var(--gray-100);
    border-radius: var(--radius);
}

.nav-hotel-selector.hidden {
    display: none;
}

.nav-hotel-selector label {
    display: block;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.375rem;
}

.nav-hotel-selector select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    background: var(--white);
    color: var(--gray-900);
    cursor: pointer;
}

.nav-hotel-selector select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.nav-hotel-selector .no-hotel-assigned {
    font-size: var(--text-body);
    color: var(--gray-500);
    font-style: italic;
}

#current-user {
    font-weight: var(--font-medium);
    color: var(--gray-700);
}

/* ══════════════════════════════════════════════════════════════════════════════
   BADGES — Family 25 canonical
   One primitive .badge + color/shape/size modifiers.
   - Color: .badge-success, -warning, -danger, -info, -primary, -purple, -neutral (default)
   - Shape: rounded-pill default, .badge-square (4px), .badge-circle (count)
   - Size: .badge-sm, default, .badge-lg
   - Style: soft default (light bg + colored text), .badge-solid (full bg + white text)
   - Modifier: .badge-uppercase (for severity, beta)
   ══════════════════════════════════════════════════════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    border-radius: 9999px;
    background: var(--gray-100);
    color: var(--gray-700);
    line-height: 1.2;
    white-space: nowrap;
    text-transform: capitalize;
    vertical-align: middle;
}

/* Color modifiers — soft variant (light bg + colored text, default style) */
.badge-success { background: var(--brand-green-100); color: var(--brand-green-800); }
.badge-warning { background: var(--warning-light); color: var(--brand-amber-800); }
.badge-danger  { background: var(--danger-light);  color: var(--brand-red-800); }
.badge-info    { background: #eff6ff;              color: #1e40af; }
.badge-primary { background: var(--primary-light); color: var(--brand-indigo-800); }
.badge-purple  { background: #f3e8ff;              color: #6b21a8; }
.badge-neutral { background: var(--gray-100);      color: var(--gray-700); }
/* VALET / LeverHR values (levels, bands, roles) beside a property's own (neutral, square). Approved 2026-10-21. */
.badge-teal    { background: var(--brand-teal-50);  color: var(--brand-teal-800); box-shadow: inset 0 0 0 1px var(--brand-teal-100); }

/* Solid variant — full bg + white text (for severity / critical alerts) */
.badge.badge-solid                { color: white; }
.badge-solid.badge-success { background: var(--success); }
.badge-solid.badge-warning { background: var(--warning); }
.badge-solid.badge-danger  { background: var(--danger); }
.badge-solid.badge-info    { background: #3b82f6; }
.badge-solid.badge-primary { background: var(--primary); }
.badge-solid.badge-neutral { background: var(--gray-500); }

/* Shape modifiers */
.badge-square { border-radius: 4px; }

.badge-circle {
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 9999px;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    font-variant-numeric: tabular-nums;
}

/* Size modifiers */
.badge-sm {
    padding: 0.125rem 0.5rem;
    font-size: var(--text-xs);
}

.badge-lg {
    padding: 0.375rem 0.875rem;
    font-size: var(--text-body);
}

/* Modifier: uppercase letterspacing (for severity, beta, status labels) */
.badge-uppercase {
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 60px;
    padding: 0 2rem 2rem 2rem;
    max-width: calc(100% - 60px);
    min-height: 100vh;
    background: var(--gray-50);
    transition: margin-left 0.25s ease, max-width 0.25s ease;
}

body.sidebar-expanded .main-content,
body.sidebar-pinned .main-content {
    margin-left: 260px;
    max-width: calc(100% - 260px);
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* ============================
   Sticky Top Bar
   ============================ */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    height: 60px;
    padding: 0 1.5rem;
    background: var(--gray-900);
    border-bottom: 1px solid var(--gray-800);
    margin: 0 -2rem 20px -2rem;
    transition: box-shadow 0.3s ease;
    will-change: box-shadow;
    /* Needed for guide line absolute positioning */
    overflow: visible;
}

.top-bar.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Month guide — pulsing underline under month trigger before selection */
.top-bar-month-guide {
    position: absolute;
    bottom: -1px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 0;
    opacity: 0;
    pointer-events: none;
    transition: left 0.3s ease, width 0.3s ease, opacity 0.3s ease;
    z-index: 2;
}

.top-bar-month-guide.visible {
    opacity: 1;
    animation: monthGuidePulse 1.5s ease-in-out infinite;
}

@keyframes monthGuidePulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Pill flash — all pills pulse together after month selection */
.top-bar-pill.flash {
    border-bottom-color: rgba(255, 255, 255, 0.5);
    animation: pillFlashPulse 800ms ease-in-out;
}

@keyframes pillFlashPulse {
    0% { border-bottom-color: transparent; }
    50% { border-bottom-color: rgba(255, 255, 255, 0.5); }
    100% { border-bottom-color: transparent; }
}

/* Offset scrollIntoView targets so they don't underlap the sticky top bar */
.comparison-results,
#insights-loader,
.compare-container,
.reports-container,
.card-subsection,
.benchmark-card {
    scroll-margin-top: 80px; /* 60px bar + 20px gap */
}

/* Left zone: icon + title */
.top-bar-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 160px;
    flex-shrink: 0;
}

.top-bar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.top-bar-icon svg {
    width: 20px;
    height: 20px;
}

.top-bar-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--white);
    margin: 0;
    white-space: nowrap;
}

/* Center zone: pills */
.top-bar-center {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0.375rem;
    flex: 1;
    min-width: 0;
    align-self: stretch;
    margin-bottom: -1px;
}

.top-bar-pill {
    padding: 0 0.75rem;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: none;
    font-size: var(--text-body);
    font-weight: var(--font-normal);
    color: var(--gray-400);
    cursor: pointer;
    transition: color 150ms ease, border-color 150ms ease;
    white-space: nowrap;
    outline: none;
    display: flex;
    align-items: center;
}

.top-bar-pill:hover {
    color: var(--white);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.top-bar-pill:focus-visible {
    box-shadow: 0 0 0 2px var(--primary-color);
}

.top-bar-pill.active {
    color: var(--white);
    font-weight: var(--font-semibold);
    border-bottom-color: var(--white);
}

/* Right zone: controls */
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex-shrink: 0;
}

.top-bar-divider {
    width: 1px;
    height: 24px;
    background: var(--gray-700);
    flex-shrink: 0;
}

/* Top bar trigger button (for dropdowns) */
.top-bar-trigger {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--gray-600);
    border-radius: 8px;
    background: var(--gray-800);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-200);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    outline: none;
}

.top-bar-trigger:hover {
    border-color: var(--gray-500);
    background: var(--gray-700);
}

.top-bar-trigger:focus-visible {
    box-shadow: 0 0 0 2px var(--primary-color);
}

.top-bar-trigger .trigger-chevron {
    transition: transform 0.2s ease;
}

.top-bar-trigger.open .trigger-chevron {
    transform: rotate(180deg);
}

.top-bar-trigger svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Hamburger (hidden by default, shown when pills overflow) */
.top-bar-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
    border: none;
    background: none;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: 6px;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

/* Home › Updates: new since this person's last visit (spec §3). Opening
   Updates clears it. */
.top-bar-pill-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 6px;
    border-radius: 50%;
    background: var(--brand-teal-500);
    vertical-align: middle;
}

/* When pills overflow, JS adds this class to the top-bar */
.top-bar.pills-overflow .top-bar-center {
    display: none;
}

.top-bar.pills-overflow .top-bar-hamburger {
    display: flex;
}

.top-bar-hamburger:hover {
    background: var(--gray-800);
    color: var(--white);
}

/* ============================
   Top Bar Dropdowns
   ============================ */
.dropdown-menu {
    position: fixed;
    z-index: 120;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
}

.dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* ============================
   Unified Filter Panel
   Consolidates Month + Mode + Period + Hotel sections.
   ============================ */
.top-bar-filter-panel {
    padding: 1.25rem;
    width: 420px;
    max-height: 75vh;
    overflow-y: auto;
}

.filter-panel-section {
    margin-bottom: 1rem;
}
.filter-panel-section:last-child { margin-bottom: 0; }

.filter-panel-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}
.filter-panel-section-meta {
    font-weight: 400;
    color: var(--gray-400);
    text-transform: none;
    letter-spacing: 0;
    margin-left: 0.5rem;
}

.filter-panel-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 1rem 0;
}

/* ══════════════════════════════════════════════════════════════════════════════
   PILLS / FILTER CHIPS — Family 26 canonical
   - .filter-pill + .filter-pill-group : segmented control (gray container, white-active)
   - .pill + .pill-group               : standalone rounded chip (gray base, indigo-active)
   ══════════════════════════════════════════════════════════════════════════════ */

/* Standalone rounded pill (replaces .dept-pill, .dept-filter-pill, .span-grade-pill) */
.pill-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pill {
    padding: 0.4rem 0.85rem;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-600);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    line-height: 1.2;
}

.pill:hover:not(.active):not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.pill.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--brand-indigo-500) 100%);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.pill:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pill-sm {
    padding: 0.25rem 0.75rem;
}

.pill-count {
    display: inline-block;
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 0 6px;
    margin-left: 4px;
    font-size: var(--text-xs);
}

.pill.active .pill-count {
    background: rgba(255,255,255,0.25);
}

/* Horizontal pill toggle group (Mode / Period) — segmented control variant */
.filter-pill-group {
    display: flex;
    background: var(--gray-100);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}
.filter-pill {
    flex: 1;
    padding: 0.5rem 0.625rem;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    background: transparent;
    border: none;
    transition: background 0.15s ease, color 0.15s ease;
    line-height: 1.2;
}
.filter-pill:hover:not(.disabled):not(.active) {
    background: rgba(255, 255, 255, 0.5);
}
.filter-pill.active {
    background: var(--white);
    color: var(--gray-900);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-weight: 600;
}
.filter-pill.disabled {
    color: var(--gray-400);
    cursor: not-allowed;
}
.filter-pill-soon {
    display: block;
    font-size: 10px;
    color: var(--gray-400);
    margin-top: 1px;
    font-weight: 400;
}

/* Hotel search + list */
.filter-panel-hotel-search {
    margin-bottom: 0.5rem;
}

.filter-hotel-list {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    background: var(--gray-50);
}
.filter-hotel-row {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-800);
    border-bottom: 1px solid var(--gray-100);
    user-select: none;
    transition: background 0.1s ease;
}
.filter-hotel-row:last-child { border-bottom: none; }
.filter-hotel-row:hover { background: var(--white); }
.filter-hotel-row.selected {
    background: #eef2ff;
    color: var(--primary-color, #4f46e5);
    font-weight: 600;
}
.filter-hotel-check {
    width: 14px;
    height: 14px;
    margin-right: 0.5rem;
    color: var(--primary-color, #4f46e5);
    opacity: 0;
    flex-shrink: 0;
}
.filter-hotel-row.selected .filter-hotel-check { opacity: 1; }
.filter-hotel-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Non-default-filters amber dot on the unified trigger */
.top-bar-filter-trigger { max-width: 360px; }
.top-bar-filter-trigger .top-bar-trigger-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.non-default-dot {
    width: 7px;
    height: 7px;
    background: var(--brand-amber-500, #f59e0b);
    border-radius: 50%;
    display: inline-block;
    margin-left: 0.25rem;
    box-shadow: 0 0 0 2px var(--gray-800);
    flex-shrink: 0;
}

/* Mobile: panel takes more screen */
@media (max-width: 640px) {
    .top-bar-filter-panel {
        width: calc(100vw - 1rem);
        max-width: 420px;
    }
}

/* Month Picker */
#top-bar-month-picker {
    padding: 0.75rem;
    width: 280px;
}

.month-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.25rem 0.625rem 0.25rem;
}

.month-picker-year {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

.month-picker-year-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.15s ease;
}

.month-picker-year-btn:hover:not(:disabled) {
    background: var(--gray-100);
    color: var(--gray-800);
}

.month-picker-year-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.month-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.month-picker-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: none;
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.15s ease;
}

.month-picker-cell:hover:not(:disabled):not(.selected) {
    background: var(--gray-100);
    color: var(--gray-900);
}

.month-picker-cell.selected {
    background: var(--primary-color);
    color: var(--white);
}

.month-picker-cell:disabled {
    color: var(--gray-300);
    cursor: not-allowed;
    background: none;
}

/* Select Dropdown (mode, period) */
.dropdown-menu-inner {
    padding: 0.375rem;
    min-width: 180px;
    overflow: hidden;
}

/* Hotel selector dropdown — scrollable for superusers with many hotels */
.dropdown-menu-scrollable {
    max-height: 360px;
    overflow-y: auto;
    min-width: 240px;
}

.dropdown-menu-scrollable .dropdown-option {
    padding: 0.5rem 0.75rem;
}

.top-bar-hotel-search {
    display: block;
    width: calc(100% - 0.75rem);
    margin: 0.25rem 0.375rem 0.375rem;
    padding: 0.4rem 0.625rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: var(--text-body);
    outline: none;
}

.top-bar-hotel-search:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

/* Hotel trigger in left zone */
.top-bar-hotel-trigger {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: var(--white);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    outline: none;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-bar-hotel-trigger:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.top-bar-hotel-trigger:focus-visible {
    box-shadow: 0 0 0 2px var(--primary-color);
}

.top-bar-hotel-trigger .trigger-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.top-bar-hotel-trigger.open .trigger-chevron {
    transform: rotate(180deg);
}

.top-bar-hotel-trigger svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.top-bar-hotel-trigger .top-bar-trigger-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 8px;
    background: none;
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.dropdown-option:hover {
    background: var(--gray-100);
}

.dropdown-option.active {
    background: var(--primary-color);
    color: var(--white);
}

.dropdown-option .option-check {
    width: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dropdown-option:not(.active) .option-check {
    visibility: hidden;
}

/* Option modifiers — compose with .dropdown-option.
   Per docs/ui-elements.md → Selects + dropdowns (Approved 2026-06-11). */
.dropdown-option .option-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--gray-500);
}
.dropdown-option.option-danger {
    color: var(--danger);
}
.dropdown-option.option-danger:hover {
    background: #fef2f2;
}
.dropdown-option.option-rich {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
}
.dropdown-option.option-rich .option-rich-meta {
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-weight: var(--font-normal, 400);
}
.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 0.25rem 0;
}

/* Slide animation for selection change */
@keyframes topBarSlideUp {
    0% { transform: translateY(0); opacity: 1; }
    40% { transform: translateY(-8px); opacity: 0; }
    60% { transform: translateY(8px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.top-bar-trigger.animating .top-bar-trigger-label {
    animation: topBarSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pulsing month selector when empty state visible */
.top-bar-trigger.month-pulse {
    animation: monthPulse 2s ease-in-out infinite;
    transition: none;
    background: transparent;
}

@keyframes monthPulse {
    0%, 100% {
        background-color: rgba(99, 102, 241, 0.05);
        border-color: rgba(99, 102, 241, 0.3);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
    50% {
        background-color: rgba(99, 102, 241, 0.18);
        border-color: rgba(99, 102, 241, 0.8);
        box-shadow: 0 0 12px 4px rgba(99, 102, 241, 0.3);
    }
}

.top-bar-trigger-label {
    display: inline-block;
}

/* ============================
   Top Bar Mobile Panel
   ============================ */
.top-bar-mobile-panel {
    position: sticky;
    top: 56px;
    z-index: 99;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 0.5rem;
    margin: 0 -2rem;
    display: none;
    flex-direction: column;
    gap: 2px;
}

.top-bar-mobile-panel.open {
    display: flex;
}

.top-bar-mobile-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border: none;
    border-radius: 8px;
    background: none;
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    text-align: left;
}

.top-bar-mobile-item:hover {
    background: var(--gray-100);
}

.top-bar-mobile-item.active {
    background: var(--gray-100);
    color: var(--primary-color);
    font-weight: var(--font-semibold);
}

.top-bar-mobile-item .mobile-check {
    width: 18px;
    color: var(--primary-color);
}

.top-bar-mobile-item:not(.active) .mobile-check {
    visibility: hidden;
}

/* ============================
   View transition animation
   ============================ */
@keyframes viewFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view.active.view-entering {
    animation: viewFadeIn 0.3s ease-out;
}

/* ============================
   Top Bar Responsive
   ============================ */
@media (max-width: 768px) {
    .top-bar {
        padding: 0 1rem;
        height: 48px;
        margin: -1rem -1rem 1rem -1rem;
    }

    .main-content {
        padding-top: calc(48px + 1rem);
    }

    /* The title and the month / hotel pill give way on a narrow screen, so the
       menu button stays on it: "External benchmarking" beside "July 2026 ·
       Grand Hyatt Marina" made the page 459px wide at 390 (2026-10-18). */
    .top-bar-left {
        min-width: 0;
        flex-shrink: 1;
    }

    .top-bar-title {
        font-size: var(--text-body);
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-bar-right {
        min-width: 0;
        flex-shrink: 1;
    }

    .top-bar-filter-trigger {
        min-width: 0;
        max-width: 100%;
    }

    .top-bar-mobile-panel {
        top: 48px;
        margin: 0 -1rem;
    }

    /* Auto-hide on scroll */
    .top-bar.scroll-hidden {
        transform: translateY(-100%);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .top-bar-mobile-panel.scroll-hidden {
        transform: translateY(-100%);
        transition: transform 0.3s ease;
    }
}

@media (max-width: 640px) {
    .top-bar {
        padding: 0 0.75rem;
    }

    .top-bar-trigger {
        padding: 0.375rem 0.5rem;
        font-size: var(--text-sm);
    }
}

.view-header {
    margin-bottom: 2rem;
}

.view-header h2 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.view-header p {
    color: var(--gray-500);
}

/* Admin/SuperUser only elements */
.admin-only,
.superuser-only,
.account-admin-only {
    display: none;
}

/* SECURITY: Explicitly hide superuser-only elements when impersonating
   This is a failsafe in case JavaScript logic has bugs */
body.is-impersonating .admin-only,
body.is-impersonating .superuser-only,
body.is-impersonating .nav-section.admin-only,
body.is-impersonating .nav-link.admin-only {
    display: none !important;
}

/* SuperUser-only views - only show when BOTH superuser AND active */
body.is-superuser .view.admin-only,
body.is-superuser .view.superuser-only {
    display: none;
}

body.is-superuser .view.admin-only.active,
body.is-superuser .view.superuser-only.active {
    display: block;
}

/* SuperUser-only nav links and other flex elements */
body.is-superuser a.admin-only,
body.is-superuser a.superuser-only,
body.is-superuser .nav-link.admin-only,
body.is-superuser .nav-link.superuser-only {
    display: flex;
}

/* SuperUser-only nav sections */
body.is-superuser .nav-section.admin-only {
    display: block;
}

/* SuperUser-only inline elements */
body.is-superuser span.admin-only,
body.is-superuser span.superuser-only {
    display: inline;
}

/* SuperUser-only buttons and containers */
body.is-superuser button.admin-only,
body.is-superuser button.superuser-only,
body.is-superuser .hotels-actions {
    display: flex;
}

/* SuperUser-only form groups and divs */
body.is-superuser div.superuser-only,
body.is-superuser .form-group.superuser-only {
    display: block;
}

/* Account Admin visibility - show for account admins OR superusers */
body.is-account-admin .view.account-admin-only,
body.is-superuser .view.account-admin-only {
    display: none;
}

body.is-account-admin .view.account-admin-only.active,
body.is-superuser .view.account-admin-only.active {
    display: block;
}

body.is-account-admin .nav-section.account-admin-only,
body.is-superuser .nav-section.account-admin-only {
    display: block;
}

body.is-account-admin a.account-admin-only,
body.is-superuser a.account-admin-only,
body.is-account-admin .nav-link.account-admin-only,
body.is-superuser .nav-link.account-admin-only {
    display: flex;
}

body.is-account-admin .tab-btn.account-admin-only,
body.is-superuser .tab-btn.account-admin-only {
    display: inline-flex;
}

body.is-account-admin .upload-tab-content.account-admin-only,
body.is-superuser .upload-tab-content.account-admin-only {
    /* Will be controlled by .active class */
}

/* Generic account-admin-only elements (form sections, divs, etc.) */
body.is-account-admin .form-section.account-admin-only,
body.is-superuser .form-section.account-admin-only,
body.is-account-admin div.account-admin-only,
body.is-superuser div.account-admin-only {
    display: block;
}

/* Editor-only visibility (hidden from viewers) */
.editor-only {
    display: none;
}

body.is-superuser .editor-only,
body.is-account-admin .editor-only,
body.is-account-editor .editor-only {
    display: block;
}

body.is-superuser a.editor-only,
body.is-account-admin a.editor-only,
body.is-account-editor a.editor-only,
body.is-superuser .nav-link.editor-only,
body.is-account-admin .nav-link.editor-only,
body.is-account-editor .nav-link.editor-only {
    display: flex;
}

body.is-superuser .view.editor-only,
body.is-account-admin .view.editor-only,
body.is-account-editor .view.editor-only {
    display: none;
}

body.is-superuser .view.editor-only.active,
body.is-account-admin .view.editor-only.active,
body.is-account-editor .view.editor-only.active {
    display: block;
}

/* What the user's type may do (2026-10-06, docs/access-rights-plan.md).
   showDashboard puts one body class per capability (`can-data-upload` for
   data.upload); an element marked data-requires="data.upload" is hidden
   without it. Several names in data-requires all have to be held. The server
   refuses the action either way; this keeps a screen from offering it. */
body:not(.can-insights-view) [data-requires~="insights.view"],
body:not(.can-people-named) [data-requires~="people.named"],
body:not(.can-benchmark-view) [data-requires~="benchmark.view"],
body:not(.can-portfolio-view) [data-requires~="portfolio.view"],
body:not(.can-assistant-use) [data-requires~="assistant.use"],
body:not(.can-data-upload) [data-requires~="data.upload"],
body:not(.can-data-remove-month) [data-requires~="data.remove_month"],
body:not(.can-mappings-edit) [data-requires~="mappings.edit"],
body:not(.can-settings-profile) [data-requires~="settings.profile"],
body:not(.can-settings-bands) [data-requires~="settings.bands"],
body:not(.can-settings-targets) [data-requires~="settings.targets"],
body:not(.can-settings-peers) [data-requires~="settings.peers"],
body:not(.can-reports-save) [data-requires~="reports.save"],
body:not(.can-reports-remove) [data-requires~="reports.remove"],
body:not(.can-team-manage) [data-requires~="team.manage"] {
    display: none !important;
}
/* The other half: copy shown only to those WITHOUT the capability, in place of
   the action they cannot take (data-lacks="data.upload"). */
body.can-data-upload [data-lacks~="data.upload"] { display: none !important; }
body.can-mappings-edit [data-lacks~="mappings.edit"] { display: none !important; }

/* ============================================
   Cluster User Visibility
   ============================================ */
.cluster-user-only {
    display: none;
}

/* Show cluster-user-only elements for cluster users */
body.is-cluster-user .cluster-user-only {
    display: block;
}

body.is-cluster-user button.cluster-user-only,
body.is-cluster-user .results-tab.cluster-user-only {
    display: inline-flex;
}

/* Superusers can see the cluster tab to access via impersonation */
body.is-superuser .cluster-user-only {
    display: block;
}

body.is-superuser button.cluster-user-only,
body.is-superuser .results-tab.cluster-user-only {
    display: inline-flex;
}

/* Portfolio challenges block sits above the Cluster sub-tabs */
#cluster-portfolio-challenges:not(:empty) {
    margin-bottom: 1.5rem;
}

/* Hide regular tabs for cluster users (they only see Cluster tab) */
body.is-cluster-user .non-cluster-tab {
    display: none !important;
}

/* Hide non-cluster tab content for cluster users */
body.is-cluster-user #insights-overview-tab,
body.is-cluster-user #insights-people-tab,
body.is-cluster-user #insights-rewards-tab,
body.is-cluster-user #insights-workforce-tab,
body.is-cluster-user #insights-hotel-metrics-tab {
    display: none !important;
}

/* Hide regular hotel selector, loader and the "select a month" empty state for
   cluster users. The empty state is a fixed overlay keyed on the Insights
   month, which a cluster user never picks (the Cluster tab has its own), so it
   sat over the Portfolio challenges card (found 2026-10-02). */
body.is-cluster-user #insights-hotel-selector,
body.is-cluster-user #insights-loader,
body.is-cluster-user #insights-empty-state,
body.is-cluster-user .insights-division-warning {
    display: none !important;
}

/* ============================================
   Cluster Tab Styles
   ============================================ */

/* Impersonation bar for superusers */
.cluster-impersonate-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--brand-indigo-50);
    border: 1px solid var(--brand-indigo-200);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.cluster-impersonate-bar label {
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-700);
}

.cluster-impersonate-bar select {
    min-width: 250px;
}

/* Controls bar */
.cluster-controls-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.cluster-month-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cluster-month-selector label {
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-600);
}

.cluster-month-selector select {
    min-width: 150px;
}

/* Deprecated 2026-06-11: .cluster-sub-tabs / .cluster-sub-tab replaced by canonical
   .tabs / .tab-btn. See docs/ui-elements.md → Tabs. */

/* Metrics Grid */
.cluster-metrics-grid {
    display: grid;
    gap: 1px;
    background: var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.cluster-cell {
    background: white;
    padding: 0.75rem;
    text-align: center;
}

.cluster-cell-header {
    background: var(--gray-50);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    padding: 0.5rem 0.75rem;
}

.cluster-cell-row-label {
    background: var(--gray-50);
    text-align: left;
    font-weight: var(--font-medium);
    font-size: var(--text-body);
    color: var(--gray-700);
}

.cluster-cell-metric {
    cursor: pointer;
    transition: background-color 0.15s ease;
    position: relative;
}

.cluster-cell-metric:hover {
    background: var(--gray-50);
}

.cluster-cell-value {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
}

.cluster-cell-value.status-green {
    color: #22c55e;
}

.cluster-cell-value.status-amber {
    color: #f59e0b;
}

.cluster-cell-value.status-red {
    color: #ef4444;
}

.cluster-cell-value.status-gray {
    color: var(--gray-400);
}

/* Chevron indicators */
.cluster-chevron {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
}

.cluster-chevron-up {
    color: #22c55e;
}

.cluster-chevron-down {
    color: #ef4444;
}

/* Hotel name cells */
.cluster-hotel-name {
    font-size: var(--text-xs);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================
   Cluster L3 Card Grid
   ============================================ */
.cluster-l3-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cluster-metric-row {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

/* Header row styling */
.cluster-header-row {
    margin-bottom: 0.25rem;
}

.cluster-header-spacer {
    background: transparent;
    border: none;
}

/* Hotel header cards */
.cluster-hotel-header-card {
    flex: 1;
    min-width: 100px;
    max-width: 140px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: var(--radius);
    background: var(--brand-indigo-50);
    border: 1px solid var(--brand-indigo-200);
}

.cluster-hotel-header-text {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-700);
    text-align: center;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Metric label card (indigo style matching People tab header) */
.cluster-metric-label-card {
    flex-shrink: 0;
    width: 200px;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    background: var(--brand-indigo-50);
    border: 1px solid var(--brand-indigo-200);
}

.cluster-metric-label-text {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-700);
    text-align: center;
    line-height: 1.2;
}

/* What decides the row's colour — smaller and lighter than the name. */
.cluster-metric-label-sub {
    font-size: var(--text-xs);
    font-weight: var(--font-normal);
    color: var(--gray-500);
    text-align: center;
    line-height: 1.25;
}

/* Hotel cards container */
.cluster-hotel-cards {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

/* Metric card (simplified - value focused) */
.cluster-metric-card {
    flex: 1;
    min-width: 100px;
    max-width: 140px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--radius);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
    position: relative;
}

.cluster-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: white;
}

.cluster-metric-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cluster-metric-dot.dot-high { background: #ef4444; }
.cluster-metric-dot.dot-mixed { background: #f59e0b; }
.cluster-metric-dot.dot-healthy { background: #22c55e; }
.cluster-metric-dot.dot-gray { background: #9ca3af; }

.cluster-metric-value {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}

/* Chevron indicators on cards */
.cluster-card-chevron {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
}

.cluster-card-chevron.chevron-good {
    color: var(--brand-green-500);
}

.cluster-card-chevron.chevron-bad {
    color: var(--brand-red-500);
}

/* The Overall rank cell (2026-10-05): the place over the score, no status dot —
   the row has no target, so there is no colour to show. */
.cluster-metric-card--rank {
    flex-direction: column;
    gap: 0;
    line-height: 1.2;
}

.cluster-rank-score {
    font-size: var(--text-xs);
    color: var(--gray-500);
    white-space: nowrap;
}

/* Order switch above the grid (2026-10-05): the approved .filter-pill-group,
   right-aligned with a muted label. */
.cluster-grid-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

/* The method card is a full-width block in a drill-in's aside; here it sits
   inline at the left of the toolbar (placement only, same element). */
.cluster-grid-toolbar .l2-method-card {
    width: auto;
    margin: 0;
}

.cluster-grid-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.cluster-grid-toolbar-label {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

/* The grid's key (2026-10-05): the shared .tt-legend with the grid's own dot
   and chevron, so the key is the same object as the cell. */
.cluster-legend { margin-top: 0.75rem; gap: 0.4rem 1rem; }
.cluster-legend .cluster-card-chevron { position: static; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .cluster-metric-row {
        flex-direction: column;
    }

    .cluster-metric-label-card {
        width: 100%;
    }

    .cluster-hotel-cards {
        width: 100%;
        flex-wrap: wrap;
    }

    .cluster-metric-card,
    .cluster-hotel-header-card {
        max-width: none;
    }

    .cluster-header-row {
        display: none;
    }
}

/* ============================================
   Cluster grid: a cell opens its analysis in the Insights drawer
   (2026-10-09, docs/cluster-cell-drawer-plan.md; replaced the comparison modal).
   Layout only: the drawer reuses the drill-in headline and L1 strip.
   ============================================ */
.cluster-metric-card:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* The drawer is 460px: the strip two by two, as in a narrow pane. */
#insights-drawer .ccd-body .l1-strip,
#insights-drawer .ccd-body .l1-strip[data-count],
#insights-drawer .dmap-drawer .l1-strip,
#insights-drawer .dmap-drawer .l1-strip[data-count] {
    grid-template-columns: repeat(2, 1fr);
}

.ccd-section-title {
    margin: 1rem 0 0.5rem;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.ccd-target {
    margin: 0 0 0.75rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.ccd-method {
    margin: 0 0 0.4rem;
    font-size: var(--text-sm);
    color: var(--gray-700);
}

.ccd-muted {
    color: var(--gray-500);
    font-size: var(--text-sm);
}

.ccd-gap {
    margin: 0.25rem 0 0.75rem;
}

.ccd-dot {
    display: inline-block;
}

.ccd-row-link {
    cursor: pointer;
}

.ccd-row-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

/* Account Management Styles */
.account-info-bar {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.account-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.account-info-label {
    font-size: var(--text-sm);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-info-value {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

.account-users-container {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
}

/* Pending Invitations Section within Team & Users */
.pending-invitations-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.pending-invitations-section .section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-bottom: 1rem;
}

.pending-invitations-section .section-title svg {
    stroke: var(--gray-500);
}

.invitation-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    background: var(--primary);
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    border-radius: 999px;
}

.invitation-count:empty {
    display: none;
}

.empty-message {
    text-align: center;
    color: var(--gray-500);
    padding: 2rem;
}

/* Hotel Selector Bar */
.hotel-selector-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.hotel-selector-bar label {
    font-weight: var(--font-medium);
    color: var(--gray-700);
}

.hotel-selector-bar select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: var(--text-body);
    min-width: 200px;
}

.hotel-hint {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-left: auto;
}

/* Empty State */
/* ══════════════════════════════════════════════════════════════════════════════
   EMPTY STATES — Family 29 canonical
   - .empty-state            : base centered container
   - .empty-state-sm         : compact (subsection inline)
   - .empty-state-lg         : full-page (drilldown / no-subscription)
   - .empty-state-positive   : green check / all-clear variant
   - Sub-elements: -icon (64×64 circle), -title (heading), -text (description)
   ══════════════════════════════════════════════════════════════════════════════ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--gray-500);
    gap: 0.75rem;
}

.empty-state.hidden {
    display: none;
}

.empty-state > svg {
    color: var(--gray-300);
}
/* A bare icon with no size of its own filled the container (Upload history,
   an empty month, 2026-10-11): give it the empty-state icon size */
.empty-state > svg:not([width]) { width: 48px; height: 48px; flex: none; }

.empty-state p {
    margin: 0;
    font-size: var(--text-base);
}

.empty-state-sm {
    padding: 1.5rem 1rem;
    gap: 0.5rem;
}

.empty-state-lg {
    padding: 4rem 2rem;
    gap: 1rem;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    margin-bottom: 0.25rem;
}

.empty-state-title {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.empty-state-text {
    margin: 0;
    font-size: var(--text-body);
    color: var(--gray-500);
    max-width: 400px;
}

/* Positive variant — communicates "all clear / no issues" */
.empty-state-positive .empty-state-icon {
    background: #dcfce7;
    color: var(--success);
}
.empty-state-positive > svg {
    color: var(--success);
}
.empty-state-positive .empty-state-title {
    color: var(--gray-800);
}

/* Months Grid */
.months-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.months-grid.hidden {
    display: none;
}

.month-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.month-card:hover {
    box-shadow: var(--shadow-md);
}

.month-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.month-card-header h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

.month-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray-300);
}

.month-status.has-data {
    background: var(--success);
}

.month-card-body {
    min-height: 60px;
}

.month-card-body .no-data {
    color: var(--gray-400);
    font-size: var(--text-body);
}

.data-info {
    font-size: var(--text-body);
    color: var(--gray-600);
}

.data-info p {
    margin-bottom: 0.25rem;
}

.data-info strong {
    color: var(--gray-800);
}

.month-card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 0.5rem;
}

/* Month card base styling - section-specific colors are defined in data-upload-section styles */

.month-card-stats {
    display: flex;
    justify-content: space-evenly;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.month-card-stats .stat-item {
    text-align: center;
    flex: 1;
}

.month-card-stats .stat-item + .stat-item {
    border-left: 1px solid var(--gray-200);
    padding-left: 1.5rem;
}

.month-card-stats .stat-value {
    display: block;
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--primary);
    line-height: 1;
}

.month-card-stats .stat-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: 0.25rem;
    /* Sentence case (audit Low 1): the generic .stat-label further down capitalises */
    text-transform: none;
    letter-spacing: normal;
}

.month-card-upload-info {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 0.75rem;
    text-align: center;
    margin-bottom: 1rem;
}

.upload-date-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

/* An erased person anonymised inside the stored file (erased-reupload-plan §5) */
.upload-redacted-line {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.35rem;
}

.upload-date-value {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.upload-filename {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.5rem;
    word-break: break-all;
    line-height: 1.3;
    padding: 0.25rem 0.5rem;
    background: var(--gray-100);
    border-radius: 4px;
}

.month-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.month-card-actions .btn {
    flex: 1;
    min-width: 0;
}

.month-card-actions .btn:first-child {
    flex-basis: 100%;
}

.month-card-actions .btn-danger {
    /* Outline until hovered. .btn-danger's solid fill used to win here, so the
       red label sat on a red background and could not be read. */
    background: var(--white);
    color: var(--danger);
    border-color: var(--danger);
}

.month-card-actions .btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* Deprecated 2026-06-11: .profile-type-tabs / .profile-tab replaced by canonical
   .segment-group + .segment-btn (segmented control). See docs/ui-elements.md → Buttons. */

/* Hotels Management */
.hotels-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.hotels-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hotel-count {
    font-size: var(--text-body);
    color: var(--gray-500);
}

.hotels-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hotels-list.hidden {
    display: none;
}

.hotel-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.hotel-item-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hotel-item-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.hotel-item-name {
    font-weight: var(--font-medium);
    color: var(--gray-800);
}

.hotel-item-stats {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.hotel-item-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Deprecated 2026-06-11: .hotel-toggle / .hotel-toggle-slider / .hotel-toggle-label
   replaced by canonical .switch / .switch-slider / .switch-label.
   See docs/ui-elements.md → Toggles / switches. */

/* Inactive Hotel State */
.hotel-item.inactive {
    opacity: 0.6;
    background: var(--gray-100);
}

.hotel-item.inactive .hotel-item-icon {
    background: var(--gray-200);
    color: var(--gray-400);
}

/* Compare View */
/* Insights View */
.insights-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.insights-setup {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

/* Insights selectors removed — now in top bar */

#insights-hotel-selector-group.hidden {
    display: none;
}

.insights-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.placeholder-text {
    color: var(--gray-500);
    font-style: italic;
    padding: 2rem;
    text-align: center;
    background: var(--gray-50);
    border-radius: var(--radius);
}

/* Top padding is 0 on every Insights section, not just People. It was 1rem here
   and cancelled only for People (further down, and again for Rewards), which put
   Workforce and HR Metrics 16px lower than People on both their overview and
   their drill-in. Bottom padding stays — it is the gap above the next surface,
   not an alignment offset. */
#insights-people-content,
#insights-financial-content,
#insights-workforce-content {
    padding: 0 0 1rem;
}

/* Hotel HR Metrics Tab - Hotel-only visibility */
.insights-hotel-metrics-tab {
    display: none;
}

body.is-hotel-profile .insights-hotel-metrics-tab {
    display: flex;
}

/* Tab Settings Button (gear icon) */
.tab-settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 8px;
    padding: 2px;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.tab-settings-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.tab-settings-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.tab-settings-btn:hover svg {
    opacity: 1;
}

/* HR Metrics Content — top padding 0, matching People. See the note on the
   shared rule above. */
#insights-hotel-metrics-content {
    padding: 0 0 1rem;
}

/* HR Metrics Summary Cards Grid - 3x4 layout */
.hr-metrics-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* HR Metric Tile */
.hr-metric-tile {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.hr-metric-tile:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: var(--gray-300);
}

.hr-metric-tile-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.hr-metric-tile-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    line-height: 1.3;
    flex: 1;
}

.threshold-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.threshold-dot.green {
    background: #059669;
}

.threshold-dot.amber {
    background: #d97706;
}

.threshold-dot.red {
    background: #dc2626;
}

.threshold-dot.neutral {
    background: var(--gray-400);
}

.hr-metric-tile-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-900);
    line-height: 1.2;
}

.hr-metric-tile-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

.hr-metric-tile-trend.improving {
    color: #059669;
}

.hr-metric-tile-trend.declining {
    color: #dc2626;
}

.hr-metric-tile-trend.neutral {
    color: var(--gray-500);
}

.hr-metric-tile-subtitle {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: -4px;
}

/* HR Metrics Settings Bar */
.hr-metrics-settings-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.hr-metrics-settings-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    color: var(--gray-600);
}

.hr-metrics-settings-info svg {
    flex-shrink: 0;
    stroke: var(--gray-500);
}

.hr-metrics-settings-bar .btn {
    flex-shrink: 0;
}

/* HR Metrics Analysis Cards */
.hr-metrics-analysis-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ============================================ */
/* Card Accent Tokens — per-section colours     */
/* ============================================ */

/* People tab — Teal */
.turnover-analysis-card,
.retirement-analysis-card,
.early-attrition-card,
.gender-card,
.diversity-card,
.performance-card,
.career-growth-card,
.retention-risk-analysis-card {
    --card-accent: var(--brand-teal-400);
}

/* Rewards tab — Green */
.rewards-comparison-card,
.grade-salary-chart-card,
.pay-equity-card,
.grade-compression-card,
.priority-employees-card,
.salary-distribution-explorer-card,
.tgc-explorer-card,
.grade-explorer-card,
.salary-range-card,
.eos-liability-card {
    --card-accent: var(--brand-green-400);
}

/* Workforce Analytics tab — Amber */
.span-control-card,
.org-layers-card,
.grade-pyramid-card,
.workforce-segmentation-card,
.spof-card,
.org-chart-card,
.position-duration-card,
.headcount-breakdown-card {
    --card-accent: var(--brand-amber-400);
}

/* HR Metrics / Financial tab — Pink */
.revenue-employee-card,
.staffing-cost-card {
    --card-accent: var(--brand-pink-400);
}

/* Card expanded state — double borders + darker header text */
.card-expanded {
    border-left: 6px solid var(--card-accent) !important;
    border-right: 6px solid var(--card-accent) !important;
}
.card-expanded .rewards-collapsible-header h4,
.card-expanded .employee-search-header h4 {
    color: #334155;
}

/* All insights cards — collapsed width 90%, expand to 100% on open, centred */
/* People tab */
.turnover-analysis-card,
.retirement-analysis-card,
.early-attrition-card,
.gender-card,
.diversity-card,
.performance-card,
.career-growth-card,
.retention-risk-analysis-card,
/* Rewards tab */
.rewards-comparison-card,
.grade-salary-chart-card,
.pay-equity-card,
.grade-compression-card,
.priority-employees-card,
.salary-distribution-explorer-card,
.tgc-explorer-card,
.grade-explorer-card,
.salary-range-card,
.eos-liability-card,
/* Workforce Analytics tab */
.span-control-card,
.org-layers-card,
.grade-pyramid-card,
.workforce-segmentation-card,
.spof-card,
.org-chart-card,
.position-duration-card,
.headcount-breakdown-card,
/* HR Metrics / Financial tab */
.revenue-employee-card,
.staffing-cost-card {
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    transition: width 0.3s ease, background-color 0.25s ease;
}
/* People tab expanded */
.turnover-analysis-card.card-expanded,
.retirement-analysis-card.card-expanded,
.early-attrition-card.card-expanded,
.gender-card.card-expanded,
.diversity-card.card-expanded,
.performance-card.card-expanded,
.career-growth-card.card-expanded,
.retention-risk-analysis-card.card-expanded,
/* Rewards tab expanded */
.rewards-comparison-card.card-expanded,
.grade-salary-chart-card.card-expanded,
.pay-equity-card.card-expanded,
.grade-compression-card.card-expanded,
.priority-employees-card.card-expanded,
.salary-distribution-explorer-card.card-expanded,
.tgc-explorer-card.card-expanded,
.grade-explorer-card.card-expanded,
.salary-range-card.card-expanded,
.eos-liability-card.card-expanded,
/* Workforce Analytics tab expanded */
.span-control-card.card-expanded,
.org-layers-card.card-expanded,
.grade-pyramid-card.card-expanded,
.workforce-segmentation-card.card-expanded,
.spof-card.card-expanded,
.org-chart-card.card-expanded,
.position-duration-card.card-expanded,
.headcount-breakdown-card.card-expanded,
/* HR Metrics / Financial tab expanded */
.revenue-employee-card.card-expanded,
.staffing-cost-card.card-expanded {
    width: 100%;
}

/* Card header inline summary text */
.card-header-summary {
    color: var(--gray-500);
    font-size: 13px;
    font-weight: var(--font-normal);
    margin-left: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Section dividers between People tab card groups */
.people-section-divider {
    border: none;
    border-top: 1px solid var(--gray-300);
    margin: 2.5rem auto;
    width: 90%;
}

/* HR Metric Analysis Card (follows rewards-card-collapsible pattern) */

.hr-card-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.hr-insights-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    color: white;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all 0.2s ease;
}

.hr-insights-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
}

.hr-insights-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* Metric tile tooltips */
.hr-metric-tile[title] {
    cursor: help;
}

/* HR Metrics Card Header Styles (Rewards pattern) */
.eos-liability-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    margin-top: 1.25rem;
    overflow: hidden;
}

/* Labour Cost Efficiency */

/* Staffing Ratios */

/* Revenue & Payroll */

/* Divisional Staffing */

/* EoS Liability */
.eos-liability-card .rewards-collapsible-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s ease;
}

.eos-liability-card .rewards-collapsible-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.eos-liability-card .rewards-collapsible-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.eos-liability-card .rewards-collapsible-header .rewards-collapse-icon svg {
    stroke: var(--gray-600);
}

/* HR Metrics Card Body Padding (shared) */
.eos-liability-card .rewards-card-collapsible {
    padding: 1.25rem;
}

.eos-liability-card .rewards-card-collapsible.collapsed {
    padding: 0;
}

/* Header tooltip styling for HR Metrics cards */
.eos-liability-card .header-tooltip {
    position: relative;
    display: inline-flex;
    cursor: help;
}

.eos-liability-card .header-tooltip svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.eos-liability-card .header-tooltip:hover svg {
    opacity: 1;
}

.eos-liability-card .tooltip-text {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    margin-top: 8px;
    width: 280px;
    padding: 0.75rem;
    background: #1f2937;
    color: white;
    font-size: var(--text-sm);
    font-weight: var(--font-normal);
    line-height: 1.5;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
    pointer-events: none;
}

.eos-liability-card .header-tooltip:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
}

/* HR Metrics Grid inside Analysis Cards */

/* EoS Gratuity Card specific styles */
.eos-summary-section {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.eos-donut-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.eos-donut-chart {
    width: 160px;
    height: 160px;
}

.eos-donut-center {
    text-align: center;
}

.eos-donut-total {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-900);
}

.eos-donut-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.eos-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.eos-breakdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.eos-breakdown-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

.eos-breakdown-details {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eos-breakdown-label {
    font-size: var(--text-body);
    color: var(--gray-700);
}

.eos-breakdown-value {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

.eos-breakdown-count {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-left: 0.5rem;
}

/* Divisional Staffing Bar Chart */

.divisional-bar-label {
    font-size: var(--text-sm);
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.divisional-bar-track {
    height: 20px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.divisional-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.divisional-bar-fill.foh { background: #3b82f6; }
.divisional-bar-fill.boh { background: #10b981; }
.divisional-bar-fill.admin { background: #8b5cf6; }
.divisional-bar-fill.other { background: #f59e0b; }

/* HR Thresholds Modal */
.modal-description {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.hr-thresholds-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.hr-threshold-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.hr-threshold-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hr-threshold-group > label {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.threshold-direction {
    font-weight: var(--font-normal);
    color: var(--gray-500);
    font-size: var(--text-sm);
}

.threshold-inputs {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.threshold-input {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-body);
    color: var(--gray-600);
}

.threshold-input input {
    width: 60px;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: var(--text-body);
    text-align: center;
}

.threshold-input input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.hr-threshold-label {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.hr-threshold-hint {
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-style: italic;
}

.hr-threshold-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.hr-threshold-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.hr-threshold-input-group label {
    font-size: var(--text-xs);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 4px;
}

.hr-threshold-input-group label .threshold-dot {
    width: 8px;
    height: 8px;
}

.hr-threshold-input-group input {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: var(--text-body);
}

.hr-threshold-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* GCC-only visibility for EoS card */
.eos-liability-card {
    display: none;
}

body.is-gcc-country .eos-liability-card {
    display: block;
}

/* HR Metrics responsive */
@media (max-width: 1200px) {
    .hr-metrics-summary-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .hr-metrics-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .eos-donut-container {
        flex-direction: row;
        justify-content: center;
    }
}

@media (max-width: 768px) {

    .hr-card-header-right {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.25rem;
    }

    .hr-insights-btn {
        font-size: var(--text-xs);
        padding: 0.25rem 0.5rem;
    }

    /* HR Metrics cards responsive (new pattern) */
    .eos-liability-card .rewards-collapsible-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .eos-liability-card .rewards-collapsible-header h4 {
        font-size: var(--text-body);
    }

    .eos-liability-card .attrition-header-right {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.25rem;
    }

    .eos-liability-card .tooltip-text {
        width: 220px;
        left: 0;
        transform: none;
    }
}

@media (max-width: 600px) {
    .hr-metrics-summary-cards {
        grid-template-columns: 1fr;
    }

    .hr-metrics-settings-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .hr-metrics-settings-bar .btn {
        justify-content: center;
    }
}

/* Benchmark View */
/* Benchmark hotel selector, controls row, mode toggle removed — now in top bar */

/* Benchmark mode-desc, period toggle removed — now in top bar */

/* Sample Size Banner */
.benchmark-sample-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--primary-light) 100%);
    border: 1px solid #93c5fd;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.sample-banner-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--brand-indigo-500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sample-banner-icon svg {
    color: white;
}

.sample-banner-content {
    flex: 1;
}

.sample-banner-title {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-800);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.25rem;
}

.sample-banner-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sample-stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.sample-stat-label {
    font-size: var(--text-body);
    color: var(--gray-500);
}

.sample-stat-value {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.sample-stat-detail {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.sample-stat-divider {
    color: var(--gray-300);
    font-size: var(--text-body);
}

/* Metrics Explanation Section */
.metrics-explanation-section {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
}

.metrics-explanation-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--gray-50);
    cursor: pointer;
    transition: background 0.15s ease;
}

.metrics-explanation-header:hover {
    background: var(--gray-100);
}

.metrics-explanation-icon {
    color: var(--gray-500);
    flex-shrink: 0;
}

.metrics-explanation-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    flex: 1;
}

.metrics-explanation-chevron {
    color: var(--gray-400);
    transition: transform 0.2s ease;
}

.metrics-explanation-section.expanded .metrics-explanation-chevron {
    transform: rotate(180deg);
}

.metrics-explanation-body {
    display: none;
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
}

.metrics-explanation-section.expanded .metrics-explanation-body {
    display: block;
}

.metrics-explanation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.metric-explain-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
}

.metric-explain-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.metric-explain-abbr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 24px;
    padding: 0 0.5rem;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
}

.metric-explain-abbr.metric-explain-pct {
    background: var(--brand-pink-600);
}

.metric-explain-abbr.metric-explain-sal {
    background: var(--brand-green-600);
}

.metric-explain-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.metric-explain-desc {
    font-size: var(--text-body);
    color: var(--gray-600);
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.metric-explain-interpret {
    font-size: var(--text-sm);
    color: var(--gray-500);
    line-height: 1.5;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-200);
}

.metric-explain-interpret strong {
    color: var(--gray-600);
}

.metrics-explanation-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: var(--warning-lighter);
    border: 1px solid var(--brand-amber-200);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: var(--text-body);
    color: var(--brand-amber-800);
    line-height: 1.5;
}

.metrics-explanation-tip svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--brand-amber-600);
}

.metrics-explanation-tip strong {
    color: var(--brand-amber-700);
}

/* Sample Size Badges */
.sample-size-inline {
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-weight: var(--font-medium);
}

.sample-size-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
}

.sample-size-badge.sample-low {
    background: var(--danger-lighter);
    color: var(--danger);
    border: 1px solid var(--brand-red-200);
}

.sample-size-badge.sample-low svg {
    color: var(--danger);
}

.sample-size-badge.sample-medium {
    background: var(--warning-lighter);
    color: var(--brand-amber-600);
    border: 1px solid var(--brand-amber-200);
}

.sample-size-badge.sample-high {
    background: var(--success-lighter);
    color: var(--success);
    border: 1px solid var(--brand-green-200);
}

/* Confidence indicator tooltip */
.sample-size-badge[title] {
    cursor: help;
}

/* Division/Department sample sizes - now use confidence indicator (see .confidence-compact) */

.bullet-dept-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

/* Department overview sample info */
.dept-sample-info {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.75rem;
}

.sample-tag {
    display: inline-flex;
    align-items: center;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: var(--gray-200);
    color: var(--gray-600);
}

.sample-tag.sample-high {
    background: var(--success-light);
    color: var(--success);
}

.sample-tag.sample-medium {
    background: var(--warning-light);
    color: var(--brand-amber-600);
}

.sample-tag.sample-low {
    background: var(--danger-light);
    color: var(--danger);
}

/* Role/Grade table sample warnings */
.role-sample-warning {
    display: inline-flex;
    align-items: center;
    margin-left: 0.25rem;
}

.role-sample-warning.sample-medium {
    color: var(--brand-amber-600);
}

.role-sample-warning.sample-low {
    color: var(--danger);
}

.role-sample-warning svg {
    vertical-align: middle;
}

/* Confidence Indicator Styles */
.confidence-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-xs);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    cursor: help;
}

.confidence-indicator.sample-insufficient {
    background: var(--danger-lighter);
    border-color: var(--brand-red-200);
    color: var(--danger);
}

.confidence-indicator.sample-low {
    background: var(--danger-lighter);
    border-color: var(--brand-red-200);
    color: var(--danger);
}

.confidence-indicator.sample-medium {
    background: var(--warning-lighter);
    border-color: var(--brand-amber-200);
    color: var(--brand-amber-600);
}

.confidence-indicator.sample-good {
    background: var(--success-lighter);
    border-color: var(--brand-green-200);
    color: var(--success);
}

.confidence-indicator.sample-high {
    background: var(--primary-lighter);
    border-color: var(--brand-indigo-200);
    color: var(--primary);
}

.confidence-text {
    font-weight: var(--font-medium);
    opacity: 0.8;
}

.confidence-bar {
    display: inline-block;
    width: 40px;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    vertical-align: middle;
}

.confidence-bar-fill {
    display: block;
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.confidence-bar-fill.sample-insufficient {
    background: var(--danger);
}

.confidence-bar-fill.sample-low {
    background: var(--brand-red-400);
}

.confidence-bar-fill.sample-medium {
    background: var(--brand-amber-400);
}

.confidence-bar-fill.sample-good {
    background: var(--brand-green-400);
}

.confidence-bar-fill.sample-high {
    background: var(--brand-indigo-500);
}

.confidence-pct {
    font-weight: var(--font-bold);
    min-width: 28px;
    text-align: right;
}

/* Compact confidence for table rows */
.confidence-compact {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    font-size: var(--text-xs);
    margin-left: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--gray-50);
    border-radius: 6px;
    border: 1px solid var(--gray-200);
}

.confidence-compact .confidence-sample,
.confidence-compact .confidence-level {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.confidence-compact .confidence-sample-label,
.confidence-compact .confidence-level-label {
    color: var(--gray-500);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

.confidence-compact .confidence-sample-value {
    color: var(--gray-700);
    font-weight: var(--font-semibold);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
}

.confidence-compact .confidence-level-value {
    font-weight: var(--font-semibold);
    font-size: var(--text-xs);
}

.confidence-compact.sample-insufficient .confidence-level-value { color: var(--gray-400); }
.confidence-compact.sample-low .confidence-level-value { color: var(--brand-red-500); }
.confidence-compact.sample-medium .confidence-level-value { color: var(--brand-amber-500); }
.confidence-compact.sample-good .confidence-level-value { color: var(--brand-green-500); }
.confidence-compact.sample-high .confidence-level-value { color: var(--brand-indigo-500); }

.confidence-compact .confidence-bar {
    width: 40px;
    height: 6px;
}

.confidence-compact .confidence-pct {
    font-size: var(--text-xs);
    min-width: 22px;
}

/* Banner confidence indicator */
.confidence-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.confidence-banner .confidence-bar {
    display: inline-block;
    border-radius: 4px;
}

.confidence-banner .confidence-pct {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
}

.confidence-banner.sample-insufficient .confidence-pct { color: var(--gray-400); }
.confidence-banner.sample-low .confidence-pct { color: var(--brand-red-400); }
.confidence-banner.sample-medium .confidence-pct { color: var(--brand-amber-400); }
.confidence-banner.sample-good .confidence-pct { color: var(--brand-green-400); }
.confidence-banner.sample-high .confidence-pct { color: var(--brand-indigo-500); }

/* Benchmark Confidence Legend */
/* A run that cannot compare shows its reason in one slot above the
   sub-tabs and hides them (setup map D11, _showBenchmarkGate). */
#benchmark-results.is-gated > .tab-content {
    display: none !important;
}
#benchmark-gate {
    margin-bottom: var(--space-4);
}

.benchmark-confidence-legend {
    margin-bottom: 1.5rem;
}

.confidence-legend-card {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.confidence-legend-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    margin-bottom: 0.875rem;
}

.confidence-legend-header svg {
    color: var(--gray-500);
}

.confidence-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

.confidence-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    cursor: help;
}

.confidence-legend-bar-container {
    width: 50px;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.confidence-legend-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.confidence-legend-bar.sample-insufficient {
    background: linear-gradient(90deg, var(--gray-400), var(--gray-300));
}

.confidence-legend-bar.sample-low {
    background: linear-gradient(90deg, var(--brand-red-400), var(--brand-red-300));
}

.confidence-legend-bar.sample-medium {
    background: linear-gradient(90deg, var(--brand-amber-400), var(--brand-amber-300));
}

.confidence-legend-bar.sample-good {
    background: linear-gradient(90deg, var(--brand-green-400), var(--brand-green-300));
}

.confidence-legend-bar.sample-high {
    background: linear-gradient(90deg, var(--brand-indigo-500), var(--brand-indigo-400));
}

.confidence-legend-label {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.confidence-legend-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.confidence-legend-range {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.confidence-legend-note {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
    font-size: var(--text-xs);
    color: var(--gray-400);
}
.benchmark-peer-count {
    color: var(--gray-600);
    font-weight: var(--font-medium);
}
.benchmark-error-card {
    padding: 2rem;
    text-align: center;
    color: var(--brand-red-600);
    background: var(--brand-red-50);
    border-radius: 8px;
}

/* Benchmark Card */
.benchmark-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    overflow: hidden;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    transition: width 0.3s ease, background-color 0.25s ease;
}

.benchmark-card.expanded {
    width: 100%;
}

/* People tab accent — Teal (matches insights People tab) */
.benchmark-card-indigo {
    border-top: 3px solid var(--brand-teal-400);
    border-bottom: 3px solid transparent;
}

.benchmark-card-indigo.expanded {
    border-top: 6px solid var(--brand-teal-400);
    border-bottom: 6px solid var(--brand-teal-400);
}

/* HR Metrics tab accent — Pink (matches insights HR Metrics tab) */
.benchmark-card-pink {
    border-top: 3px solid var(--brand-pink-400);
    border-bottom: 3px solid transparent;
}

.benchmark-card-pink.expanded {
    border-top: 6px solid var(--brand-pink-400);
    border-bottom: 6px solid var(--brand-pink-400);
}

/* Collapsible card header */
.benchmark-card-header-collapsible {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: transparent;
    cursor: pointer;
    transition: background 150ms ease;
}

.benchmark-card-header-collapsible:hover {
    background: linear-gradient(90deg, #f0fdfa 0%, transparent 100%);
}

.benchmark-card-pink .benchmark-card-header-collapsible:hover {
    background: linear-gradient(90deg, #fdf2f8 0%, transparent 100%);
}

.benchmark-card.expanded .benchmark-card-header-collapsible {
    border-bottom: 1px solid var(--gray-200);
}

.benchmark-card-header-collapsible h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.benchmark-card.expanded .benchmark-card-header-collapsible h4 {
    color: #334155;
}

.benchmark-card-header-collapsible h4 svg {
    color: #64748b;
    stroke: #64748b;
}

.benchmark-card.expanded .benchmark-card-header-collapsible h4 svg:not(.benchmark-card-chevron) {
    color: #334155;
    stroke: #334155;
}

.benchmark-card-header-collapsible h4 .header-tooltip {
    flex-shrink: 0;
}

.benchmark-card-header-collapsible h4 .card-header-summary {
    margin-left: auto;
}

.benchmark-card-chevron {
    color: var(--gray-500);
    transition: transform 0.2s ease;
}

.benchmark-card.expanded .benchmark-card-chevron {
    transform: rotate(180deg);
}

.benchmark-card-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1.5rem;
}

.benchmark-card-position-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.benchmark-card-position-badge.position-good {
    background: #dcfce7;
    color: #166534;
}

.benchmark-card-position-badge.position-warning {
    background: #fef3c7;
    color: #92400e;
}

.benchmark-card-position-badge.position-poor {
    background: #fee2e2;
    color: #991b1b;
}

/* Card body - collapsed by default */
.benchmark-card-body {
    display: none;
    padding: 1.25rem;
}

.benchmark-card.expanded .benchmark-card-body {
    display: block;
}

/* Top padding 0, matching Insights › People. The 1.5rem predates the drill-in
   and was spacing for the legacy collapsible card feed; with the overview grid
   and drill-in it put Benchmark 40px lower than People.
   padding-bottom stays at 50vh — that is scroll headroom so the last card can
   still be scrolled to the top of the viewport, not an alignment offset. */
#benchmark-people-content,
#benchmark-hr-metrics-content {
    padding-top: 0;
    padding-bottom: 50vh;
}
/* Enhanced percentile scale */
.percentile-scale-enhanced {
    margin: 1.5rem 0 0;
    background: var(--gray-50);
    border-radius: 12px;
    padding: 1.25rem 1.5rem 1.5rem;
}

.percentile-zone-labels {
    display: flex;
    margin-bottom: 0.5rem;
}

.zone-label {
    text-align: center;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.25rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zone-label-green {
    color: #166534;
}

.zone-label-light-green {
    color: #15803d;
}

.zone-label-amber {
    color: #92400e;
}

.zone-label-red {
    color: #991b1b;
}

.percentile-bar-container {
    position: relative;
    padding: 0.5rem 0 0.25rem;
}

.percentile-bar {
    display: flex;
    height: 28px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.percentile-zone {
    height: 100%;
}

.percentile-zone.zone-green {
    background: #22c55e;
}

.percentile-zone.zone-light-green {
    background: #86efac;
}

.percentile-zone.zone-amber {
    background: #fbbf24;
}

.percentile-zone.zone-red {
    background: #ef4444;
}

.percentile-your-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.percentile-your-marker-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--gray-800);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.percentile-your-marker-text {
    font-weight: var(--font-bold);
    font-size: 0.6rem;
    letter-spacing: 0.05em;
}

.percentile-your-marker-value {
    font-weight: var(--font-semibold);
    font-size: 0.65rem;
}

.percentile-markers {
    position: relative;
    height: 48px;
    margin-top: 0.25rem;
}

.percentile-marker-tick {
    position: absolute;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: var(--text-body);
}

.percentile-marker-tick.faded-tick {
    opacity: 0.5;
}

.percentile-marker-tick::before {
    content: '';
    width: 2px;
    height: 10px;
    background: var(--gray-400);
    margin-bottom: 4px;
    border-radius: 1px;
}

.percentile-marker-label {
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.percentile-marker-value {
    color: var(--gray-600);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    margin-top: 2px;
}
.benchmark-card-period {
    font-size: var(--text-body);
    color: var(--gray-500);
    white-space: nowrap;
}

.benchmark-card-sample-size {
    font-size: var(--text-sm);
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    font-weight: var(--font-medium);
}
/* Metrics Row */
.benchmark-metrics-row {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    flex-wrap: wrap;
}

.benchmark-metrics-row-sm {
    padding: 1rem;
}

.benchmark-metric {
    flex: 1;
    min-width: 100px;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: 8px;
    position: relative;
}

/* Deprecated 2026-06-12: .benchmark-metric.has-tooltip with data-tooltip attribute
   replaced by canonical [data-tooltip] global rule. See docs/ui-elements.md → Tooltips. */
.benchmark-metric.has-tooltip {
    cursor: help;
}

.benchmark-metric-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    line-height: 1.2;
}

.benchmark-metric-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 0.25rem;
}

.benchmark-metric-sublabel {
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-top: 0.1rem;
}

.benchmark-metric.metric-green .benchmark-metric-value {
    color: var(--brand-green-600);
}

.benchmark-metric.metric-amber .benchmark-metric-value {
    color: var(--brand-amber-600);
}

.benchmark-metric.metric-red .benchmark-metric-value {
    color: var(--brand-red-600);
}

/* Percentile Scale (Subsection) */
.percentile-scale {
    margin: 1rem auto 0;
    padding: 1.25rem 1.5rem 1.5rem;
    max-width: 80%;
    background: var(--gray-50);
    border-radius: 10px;
}

.percentile-scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    margin-bottom: 0.75rem;
}

.percentile-label-better {
    color: var(--brand-green-600);
}

.percentile-label-worse {
    color: var(--brand-red-500);
}

.percentile-scale-bar {
    position: relative;
    height: 16px;
    background: linear-gradient(90deg,
        var(--brand-green-400) 0%,
        var(--brand-green-300) 25%,
        var(--brand-amber-300) 50%,
        var(--brand-red-300) 75%,
        var(--brand-red-400) 100%
    );
    border-radius: 8px;
    overflow: visible;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.percentile-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.percentile-marker-dot {
    width: 24px;
    height: 24px;
    background: var(--gray-800);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.percentile-marker-label {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    white-space: nowrap;
    background: white;
    padding: 3px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.percentile-scale-ticks {
    position: relative;
    height: 44px;
    margin-top: 10px;
}

.percentile-tick {
    position: absolute;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: var(--text-sm);
}

.percentile-tick::before {
    content: '';
    width: 2px;
    height: 10px;
    background: var(--gray-400);
    margin-bottom: 6px;
    border-radius: 1px;
}

.percentile-tick-label {
    color: var(--gray-600);
    font-weight: var(--font-semibold);
}

.percentile-tick-value {
    color: var(--gray-500);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    margin-top: 2px;
}

/* Advanced Metrics collapsible */
/* Responsive adjustments */

/* Role/Grade table metadata row */
.dept-role-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.2rem;
}

.dept-role-roles {
    font-size: var(--text-xs);
    color: var(--gray-400);
}

/* Adjust existing dept-role-count to work as confidence container */
.dept-role-title-cell .confidence-compact {
    margin-top: 0.2rem;
}

.benchmark-hotels-info {
    padding: 0.75rem 1rem;
    background: var(--primary-light);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
    font-size: var(--text-body);
}

.benchmark-hotels-info.hidden {
    display: none;
}
#benchmark-hotels-list {
    color: var(--gray-700);
}

.hotel-card.primary-hotel {
    border: 2px solid var(--primary);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
}

.hotel-card.primary-hotel .hotel-card-rank {
    background: var(--primary);
    font-size: var(--text-body);
}

.compare-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 58vh;
}

.compare-setup {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.hotels-filter {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.hotels-filter h3 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-bottom: 1rem;
}

.no-hotels-compare {
    color: var(--gray-500);
    font-size: var(--text-body);
    padding: 1rem;
    text-align: center;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.selector-group {
    flex: 1;
    max-width: 300px;
}

.selector-group.full-width {
    max-width: 400px;
}

.hotels-selected-count {
    margin-top: 0.75rem;
    font-size: var(--text-body);
    color: var(--gray-500);
}

/* Month selector section removed — now in top bar */

.month-buttons-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0.5rem;
    min-height: 60px;
    width: 100%;
}

/* Switch to 2 rows of 6 at medium screens */
@media (max-width: 900px) {
    .month-buttons-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.month-select-hint {
    grid-column: 1 / -1;
    padding: 1rem;
    background: var(--gray-100);
    border-radius: var(--radius);
    color: var(--gray-500);
    text-align: center;
    font-size: var(--text-body);
}

.month-select-note {
    grid-column: 1 / -1;
    margin: 0.5rem 0 0;
    color: var(--gray-500);
    font-size: var(--text-body);
    text-align: center;
    font-style: italic;
}

.month-btn {
    padding: 0.75rem 0.5rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.month-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.month-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
}

.month-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--gray-100);
}

.month-btn .data-indicator {
    display: block;
    font-size: var(--text-xs);
    margin-top: 0.25rem;
    opacity: 0.7;
}

.selector-group label {
    display: block;
    font-weight: var(--font-medium);
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.selector-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: var(--text-base);
    background: var(--white);
    cursor: pointer;
}

.selector-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.vs-indicator {
    font-weight: var(--font-bold);
    color: var(--gray-400);
    font-size: var(--text-lg);
}

.fields-selector {
    margin-bottom: 2rem;
}

.fields-selector h3 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.fields-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fields-header h3,
.fields-header h4 {
    margin: 0;
}

.fields-actions {
    display: flex;
    gap: 0.5rem;
}

.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.compare-setup > .btn {
    display: block;
    margin: 0 auto;
    min-width: 200px;
}

/* Comparison Results */
.comparison-results {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.comparison-results.hidden {
    display: none;
}

.comparison-results h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.comparison-results h4 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-bottom: 1rem;
}

/* Results header removed — now in top bar */

/* Hotel Comparison Grid */
.hotel-comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.hotel-card {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hotel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--hotel-color, var(--primary));
}

.hotel-card-rank {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: var(--hotel-color, var(--primary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
}

.hotel-card-name {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    padding-right: 2rem;
}

.hotel-card-headcount {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--hotel-color, var(--primary));
    line-height: 1;
    margin-bottom: 0.25rem;
}

.hotel-card-label {
    font-size: var(--text-sm);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.hotel-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.hotel-card-stat {
    text-align: center;
}

.hotel-card-stat .value {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.hotel-card-stat .label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
}

/* Hotel color variants */
.hotel-card[data-hotel-index="0"] { --hotel-color: var(--brand-indigo-600); }
.hotel-card[data-hotel-index="1"] { --hotel-color: var(--brand-green-600); }
.hotel-card[data-hotel-index="2"] { --hotel-color: var(--brand-amber-500); }
.hotel-card[data-hotel-index="3"] { --hotel-color: var(--brand-pink-600); }
.hotel-card[data-hotel-index="4"] { --hotel-color: var(--brand-red-600); }

/* Benchmark Aggregate Card */
.hotel-card.benchmark-aggregate {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-pink-50) 100%);
    border-color: var(--brand-indigo-300);
}

.hotel-card.benchmark-aggregate::before {
    background: linear-gradient(90deg, var(--brand-indigo-600), var(--brand-pink-500));
}

.hotel-card-subtitle {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-bottom: 0.5rem;
    font-weight: var(--font-medium);
}

/* Financial Section */
.financial-section {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.financial-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.financial-section h4 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 1.25rem;
}

.financial-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.financial-card {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    position: relative;
    border-top: 3px solid var(--hotel-color, var(--primary));
}

.financial-card[data-hotel-index="0"] { --hotel-color: var(--brand-indigo-600); }
.financial-card[data-hotel-index="1"] { --hotel-color: var(--brand-green-600); }
.financial-card[data-hotel-index="2"] { --hotel-color: var(--brand-amber-500); }
.financial-card[data-hotel-index="3"] { --hotel-color: var(--brand-pink-600); }
.financial-card[data-hotel-index="4"] { --hotel-color: var(--brand-red-600); }

/* Benchmark Aggregate Financial Card */
.financial-card.benchmark-aggregate-financial {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-pink-50) 100%);
    border-color: var(--brand-indigo-300);
}

.financial-card.benchmark-aggregate-financial::before {
    background: linear-gradient(90deg, var(--brand-indigo-600), var(--brand-pink-500));
}

.financial-card .hotel-name {
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.financial-card .total-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--hotel-color, var(--primary));
    font-family: var(--font-mono);
}

.financial-card .total-label {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.financial-card .hotel-card-subtitle {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.chart-wrapper-large {
    position: relative;
    height: 350px;
    margin-bottom: 1.5rem;
    padding-top: 20px;
}

/* Toggle Switch */
.view-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    color: var(--gray-600);
    cursor: pointer;
}

.view-toggle input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--gray-300);
    border-radius: 12px;
    transition: background 0.2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.view-toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.view-toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* Results tabs (inline pills) removed — now in top bar */

/* Deprecated 2026-06-11: .results-tab-content replaced by canonical .tab-content. */
#insights-results .tab-content {
    min-height: 100vh;
}

/* Stats Section */
.stats-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.stats-field-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.stats-field-btn {
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.stats-field-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.stats-field-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.stats-field-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Charts Container */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.chart-card {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.chart-card h5 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 1rem;
    text-align: center;
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    font-size: var(--text-body);
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Numerical Stats */
.numerical-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.numerical-stat-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.numerical-stat-card h6 {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
    letter-spacing: 0.025em;
}

.numerical-stat-values {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.numerical-stat-item {
    text-align: center;
    flex: 1;
}

.numerical-stat-item .label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.numerical-stat-item .value {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    font-family: var(--font-mono);
}

.numerical-stat-item .value.primary {
    color: var(--primary);
}

.numerical-stat-item .value.secondary {
    color: var(--brand-pink-600);
}

.numerical-stat-change {
    text-align: center;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    min-width: 80px;
}

.numerical-stat-change .arrow {
    font-size: var(--text-base);
}

.numerical-stat-change .change-value {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
}

.numerical-stat-change.positive {
    background: var(--success-light);
}

.numerical-stat-change.positive .change-value {
    color: var(--success);
}

.numerical-stat-change.negative {
    background: var(--danger-light);
}

.numerical-stat-change.negative .change-value {
    color: var(--danger);
}

.numerical-stat-change.neutral .change-value {
    color: var(--gray-500);
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: var(--gray-50);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--gray-200);
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-card .value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-900);
}
.summary-card .value.gender-female { color: var(--gender-female); }
.summary-card .value.gender-male { color: var(--gender-male); }

.summary-card .label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.summary-card.highlight .value {
    color: var(--primary);
}

.summary-card.warning .value {
    color: var(--warning);
}

.summary-card.success .value {
    color: var(--success);
}

/* ══════════════════════════════════════════════════════════════════════════════
   TABLES — Family 31 canonical
   - .table-container         : wrapper handling horizontal overflow
   - .data-table              : standard data table (full-width, gray-50 th bg)
   - .data-table-compact      : modifier — uppercase headers, tighter padding
   - Cell utilities: .cell-value, .cell-change-{positive,negative,neutral},
     .cell-highlight, tr.row-total
   ══════════════════════════════════════════════════════════════════════════════ */

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    background: var(--gray-50);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.data-table tr.row-total {
    background: var(--gray-50);
    font-weight: var(--font-semibold);
}

.data-table tr.row-total td {
    border-top: 2px solid var(--gray-300);
}

/* Compact modifier — for wizards / CRM-style tables with uppercase headers */
.data-table.data-table-compact th {
    padding: 0.5rem 0.75rem;
    text-transform: uppercase;
    font-size: var(--text-sm);
    letter-spacing: 0.03em;
    color: var(--gray-500);
    border-bottom: 2px solid var(--gray-200);
}

.data-table.data-table-compact td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

/* Group header row inside a data table (approved 2026-10-06,
   docs/ui-elements.md): names the rows below it, e.g. "Analysis". */
.data-table tr.data-table-group th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    text-align: left;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.data-table tbody tr.data-table-group:hover {
    background: transparent;
}

/* A cell changed and not yet saved (approved 2026-10-06): amber-50 tint,
   amber-300 edge. Cleared on Save or Discard. */
.data-table td.is-changed,
.data-table tbody tr:hover td.is-changed {
    background: var(--brand-amber-50);
    box-shadow: inset 0 0 0 1px var(--brand-amber-300);
}

/* Cell utility classes */
.cell-value {
    text-align: right;
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* `.cell-value` has never actually right-aligned anything inside a `.data-table`.
   `.data-table th, .data-table td { text-align: left }` above is specificity
   (0,1,1) against this class's (0,1,0), so the canonical numeric-cell utility
   was silently defeated by the canonical table it exists to be used in — the
   monospace and tabular-nums landed, the alignment never did. Every `.cell-value`
   callsite in the app is affected. Scoped rule, so the class works where it is
   documented to work. */
.data-table th.cell-value,
.data-table td.cell-value {
    text-align: right;
}

.cell-change-positive {
    color: var(--success);
}

.cell-change-negative {
    color: var(--danger);
}

.cell-change-neutral {
    color: var(--gray-500);
}

/* A value that has breached its configured threshold. Distinct from
   `.cell-change-negative`, which is about the DIRECTION of a change: a rate can
   be falling and still be over target, and both facts matter. Weight as well as
   colour, so the signal survives a greyscale print and colour-blind reading.
   PROPOSED addition to the approved table cell utilities (2026-08-10) — see
   docs/ui-elements.md. */
.cell-alert {
    color: var(--danger);
    font-weight: var(--font-bold);
}

.cell-highlight {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: var(--font-semibold);
}

.cell-added {
    background: var(--success-light);
}

.cell-removed {
    background: var(--danger-light);
}

/* Users Management */
.users-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.users-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.team-user-name {
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    font-size: 0.8rem;
}

.team-user-email {
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-top: 0.1rem;
}

/* User actions dropdown menu */
.user-actions-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.user-actions-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.375rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.15s ease;
}

.user-actions-trigger:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

/* Deprecated 2026-06-11: .user-actions-menu / .user-actions-item / .user-actions-item-danger
   replaced by canonical .dropdown-menu + .dropdown-option + .option-danger.
   See docs/ui-elements.md → Selects + dropdowns. */

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

/* Retirement modal used for insights popups - higher z-index to appear above other modals */
#retirement-modal.active {
    z-index: 1100;
}

/* Standard modal sizing — 90% of viewport, both dimensions. Header + footer pin;
   only .modal-body scrolls. All content modals share this spec; the only exception
   is .modal-sm / .modal-small for tight confirmation dialogs (see below). */
.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 90vw;
    max-width: 90vw;
    height: 90vh;
    max-height: 90vh;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;          /* outer doesn't scroll; .modal-body does */
}

/* Small modal — confirmations and tight dialogs. Auto-sizes to content. */
.modal-content.modal-sm,
.modal-content.modal-small {
    width: auto;
    max-width: 450px;
    height: auto;
    max-height: 90vh;
    overflow-y: auto;          /* allow scroll if content overflows */
}

/* Size-modifier classes are kept for backwards-compat — they all map to the
   standard 90% spec so existing markup keeps working without per-modal tweaks. */
.modal-content.modal-md,
.modal-content.modal-large,
.modal-content.modal-lg,
.modal-content.modal-xl,
.modal-content.modal-fullscreen {
    width: 90vw;
    max-width: 90vw;
    height: 90vh;
    max-height: 90vh;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--text-xl);
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-600);
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    flex-shrink: 0;
    border-top: 1px solid var(--gray-200);
    border-top: 1px solid var(--gray-200);
}

/* Data Upload Required Modal */
.data-required-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.data-required-icon svg {
    color: var(--primary-color);
    opacity: 0.8;
}

.data-required-text {
    text-align: center;
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}

.data-required-subtext {
    text-align: center;
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-bottom: 0;
}

.data-required-admin-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: var(--text-body);
    color: var(--gray-600);
}

.data-required-admin-info svg {
    flex-shrink: 0;
}

#data-required-footer {
    justify-content: center;
}

#data-required-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.perf-categories-editor {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.perf-category-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.perf-category-row .rating-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
}

.perf-category-row input {
    flex: 1;
}

/* Legacy class — kept for backward compat. Prefer native :disabled on .form-group inputs (auto-styled).
   Deprecated 2026-06-11 per docs/ui-elements.md; remove call-sites then delete this rule. */
.form-control-disabled {
    background-color: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

/* File upload zone — approved 2026-10-10 (ui-elements family 12): a real
   button, so Tab and Enter reach the picker; a drop target too. */
button.upload-zone {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    font: inherit;
    color: var(--gray-700);
    background: var(--white);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

button.upload-zone:hover,
button.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

button.upload-zone:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button.upload-zone .upload-zone-icon {
    color: var(--gray-400);
    margin-bottom: 0;
}

/* The chosen file, under the zone */
.upload-file-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--gray-800);
}

.upload-file-row svg { color: var(--success); flex: none; }
.upload-file-row .btn-link { margin-left: auto; }

.upload-muted { color: var(--gray-500); font-size: var(--text-sm); }
.upload-template-line { margin: 0.75rem 0 0; }
.upload-replace-notice { margin: 0 0 1rem; }
.upload-checking-hint { text-align: center; margin: 0.5rem 0 0; }
.outlet-upload-intro { margin: 0 0 1rem; color: var(--gray-600); }

/* Mobile header bar — hidden on desktop */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: var(--gray-900);
    color: var(--white);
    z-index: 200;
    align-items: center;
    padding: 0 1rem;
    gap: 0.75rem;
}
.mobile-header-title {
    font-weight: var(--font-bold);
    font-size: var(--text-base);
}
.mobile-menu-btn {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}
.sidebar-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 1024px) {
    /* Collapsed state uses same 60px */
    .sidebar.expanded,
    .sidebar.pinned {
        width: 220px;
        min-width: 220px;
    }

    body.sidebar-expanded .main-content,
    body.sidebar-pinned .main-content {
        margin-left: 220px;
        max-width: calc(100% - 220px);
    }
}

@media (max-width: 768px) {
    /* Mobile header visible */
    .mobile-header {
        display: flex;
    }

    /* Hide pin button on mobile */
    .sidebar-pin-btn {
        display: none !important;
    }

    /* Sidebar becomes a drawer off-screen - full width, not collapsed */
    .sidebar,
    .sidebar.expanded,
    .sidebar.pinned {
        width: 280px;
        min-width: 280px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 150;
    }
    .sidebar.sidebar-open {
        transform: translateX(0);
    }

    /* Show all elements on mobile drawer */
    .sidebar .sidebar-user,
    .sidebar .nav-section-title,
    .sidebar .nav-link-text {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: auto !important;
    }

    .sidebar .nav-link {
        justify-content: flex-start !important;
        padding: 0.625rem 1rem !important;
        border-left-width: 3px !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    /* Show full logo on mobile */
    .sidebar .nav-logo-svg.nav-logo-full {
        display: block !important;
    }
    .sidebar .nav-logo-svg.nav-logo-collapsed {
        display: none !important;
    }

    /* Hide tooltips on mobile */
    .sidebar .nav-link[data-tooltip]::after {
        display: none !important;
    }

    .main-content,
    body.sidebar-expanded .main-content,
    body.sidebar-pinned .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 1rem;
        padding-top: calc(52px + 48px + 1rem); /* mobile header + top bar + gap */
    }

    .top-bar {
        top: 52px; /* below mobile header */
        margin: 0 -1rem 1rem -1rem;
    }

    .selector-group {
        max-width: 100%;
    }

    .vs-indicator {
        transform: rotate(90deg);
    }

    .nav-link {
        padding: 0.625rem 1rem;
        font-size: var(--text-body);
    }

    /* Modals full-width on mobile */
    .modal-content,
    .modal-content.modal-large {
        max-width: calc(100vw - 1.5rem);
        margin: 0.75rem;
    }
    .modal-header {
        padding: 1rem;
    }
    .modal-body {
        padding: 1rem;
    }
    .modal-footer {
        padding: 0.75rem 1rem;
    }

    /* Login card */
    .login-card {
        max-width: calc(100vw - 2rem);
        padding: 2rem 1.5rem;
    }

    /* CRM actions: stack buttons */
    .crm-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    .crm-actions .btn {
        font-size: var(--text-xs);
        padding: 0.25rem 0.5rem;
    }

    /* Hotel tags smaller on mobile */
    .crm-hotel-tag {
        font-size: var(--text-xs);
        padding: 0px 4px;
    }
    .crm-hotels-cell {
        max-width: 120px;
    }

    /* Stats row */
    .crm-stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .crm-stat-card {
        padding: 0.75rem;
    }

    /* Form rows single column */
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-row:has(.form-group-small) {
        grid-template-columns: 1fr;
    }

    /* Contract upload section */
    .contract-upload-section .form-row {
        grid-template-columns: 1fr;
    }

    /* Chart containers */
    .chart-container {
        min-height: 250px;
    }

    /* View header */
    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.75rem;
        padding-top: calc(52px + 0.75rem);
    }

    /* The top bar spans the content's padding, which is 0.75rem here, not the
       1rem above: at -1rem it stood 4px out each side and every page scrolled
       sideways (backlog: phone 4px overflow). */
    .top-bar {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }

    /* CRM stats: single column */
    .crm-stats-row {
        grid-template-columns: 1fr;
    }

    /* CRM tabs: scroll horizontally */
    .crm-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .crm-tabs::-webkit-scrollbar {
        display: none;
    }
    .crm-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Confirmation card */
    .confirmation-card {
        padding: 0.75rem;
    }

    /* Buttons */
    .btn {
        font-size: var(--text-body);
        padding: 0.5rem 0.75rem;
    }
    .btn-sm {
        font-size: var(--text-xs);
        padding: 0.25rem 0.5rem;
    }

    /* Modal header */
    .modal-header h3 {
        font-size: var(--text-base);
    }
}

/* Hotel Form Sections */
.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Modal Section Dividers - for major section breaks (Details/Mappings/Benchmarks) */
.modal-section-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0 1rem 0;
    padding-top: 1rem;
    border-top: 2px solid var(--gray-300);
}

.modal-section-divider:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.modal-section-divider span {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: white;
    padding-right: 0.75rem;
}

.modal-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row:has(.form-group-small) {
    grid-template-columns: auto 1fr;
}

.form-group-small {
    min-width: 80px;
    max-width: 100px;
}

@media (max-width: 500px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-row:has(.form-group-small) {
        grid-template-columns: 1fr;
    }
}

/* Facilities Grid */
.facilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

/* Performance Management Config */
.perf-categories-config {
    margin-top: 0.75rem;
}
.perf-cat-header {
    display: grid;
    /* Four columns by default. The target-% column only exists on the superuser
       editor, so it is added by .has-target rather than left as a dead 60px track
       on the two editors that don't have it. */
    grid-template-columns: 50px 1fr 70px 70px;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-400);
}
.perf-cat-row {
    display: grid;
    grid-template-columns: 50px 1fr 70px 70px;
    gap: 0.5rem;
    align-items: center;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--gray-100);
}
.perf-band-editor.has-target .perf-cat-header,
.perf-band-editor.has-target .perf-cat-row {
    grid-template-columns: 50px 1fr 70px 70px 60px;
}
/* Derived upper edge — read-only, so it reads as a value rather than a field. It is
   computed from the NEXT band's starting score (resolvePerfBand only uses `min`), and
   an editable control here could be set to contradict the boundary that applies. */
.perf-cat-max-derived {
    text-align: center;
    font-size: var(--text-body);
    color: var(--gray-400);
    font-variant-numeric: tabular-nums;
}
.perf-cat-min-input.input-error {
    border-color: var(--input-error-border);
    background: var(--input-error-bg);
}
.perf-cat-min-input.input-error:focus {
    box-shadow: 0 0 0 3px #fecaca;
}
.perf-cat-hint {
    margin: 0.6rem 0 0;
    font-size: var(--text-sm);
    color: var(--gray-500);
    line-height: 1.45;
}
.perf-cat-error {
    margin-top: 0.5rem;
}
/* Read-only band summary on the Settings / My Profile cards */
.perf-band-from {
    color: var(--gray-400);
    font-variant-numeric: tabular-nums;
}
.perf-band-default-flag {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.4rem;
    border-radius: 10px;
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
/* Wizard variant of the derived upper edge */
.category-max-derived {
    display: inline-block;
    min-width: 60px;
    text-align: center;
    font-size: var(--text-body);
    color: var(--gray-400);
    font-variant-numeric: tabular-nums;
}
.perf-cat-row:last-child {
    border-bottom: none;
}
.perf-cat-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: var(--font-bold);
    font-size: var(--text-body);
}
.perf-cat-label-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: var(--text-body);
    color: var(--gray-700);
    background: var(--white);
    transition: border-color 0.2s;
}
.perf-cat-label-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}
.perf-cat-min-input,
.perf-cat-max-input {
    width: 100%;
    padding: 0.35rem 0.4rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: var(--text-body);
    color: var(--gray-600);
    text-align: center;
    font-variant-numeric: tabular-nums;
    background: var(--white);
    transition: border-color 0.2s;
}
.perf-cat-min-input:focus,
.perf-cat-max-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

@media (max-width: 768px) {
    .perf-cat-header,
    .perf-cat-row {
        grid-template-columns: 40px 1fr 60px 60px;
    }
    .perf-band-editor.has-target .perf-cat-header,
    .perf-band-editor.has-target .perf-cat-row {
        grid-template-columns: 40px 1fr 56px 56px 52px;
    }
}

/* Benchmark Hotels Section */
.form-section-desc {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-bottom: 1rem;
}

/* Readonly form section (superuser-only fields) */
.form-section-readonly {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.form-section-readonly-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.readonly-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-readonly,
input.input-readonly,
select.input-readonly {
    background-color: var(--gray-100) !important;
    color: var(--gray-500) !important;
    cursor: not-allowed !important;
    border-color: var(--gray-200) !important;
}

.readonly-help-text {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-top: 1rem;
    margin-bottom: 0;
}

.readonly-help-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: var(--font-medium);
}

.readonly-help-text a:hover {
    text-decoration: underline;
}
.benchmark-count {
    margin-top: 0.5rem;
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.benchmark-count.at-limit {
    color: var(--warning);
    font-weight: var(--font-medium);
}

.no-benchmark-hotels {
    color: var(--gray-500);
    font-size: var(--text-body);
    text-align: center;
    padding: 1rem;
    width: 100%;
    font-style: italic;
}

/* Month Card Data Types */
.month-card-data {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.data-type-section {
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 3px solid var(--gray-300);
}

.data-type-section.financial {
    border-left-color: var(--primary);
}

.data-type-section.people {
    border-left-color: #db2777;
}

.data-type-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.data-type-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.data-type-label.financial {
    color: var(--brand-indigo-800);
}

.data-type-label.people {
    color: #9d174d;
}

.data-type-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-300);
}

.data-type-status.has-data {
    background: var(--success);
}

.data-type-info {
    font-size: var(--text-body);
    color: var(--gray-600);
}

.data-type-info p {
    margin: 0.125rem 0;
}

.data-type-info .no-data {
    color: var(--gray-400);
    font-style: italic;
}

.data-type-actions {
    display: flex;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.data-type-actions .btn {
    flex: 1;
    padding: 0.375rem 0.5rem;
    font-size: var(--text-sm);
}

/* Hotel Item Extended Info */
.hotel-item-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.hotel-detail-tag {
    padding: 0.25rem 0.5rem;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.hotel-detail-tag.stars {
    background: var(--warning-light);
    color: var(--brand-amber-800);
}

/* Hotel Benchmarks in List */
.hotel-item-benchmarks {
    margin-top: 0.5rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
    padding: 0.375rem 0.5rem;
    background: var(--primary-light);
    border-radius: 4px;
    border-left: 3px solid var(--primary);
}

.hotel-item-benchmarks .benchmark-label {
    font-weight: var(--font-semibold);
    color: var(--primary);
}

/* Analysis Selector Dropdown */
.analysis-selector {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: var(--text-body);
    min-width: 280px;
    background: var(--white);
    cursor: pointer;
}

.analysis-selector:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Detailed Stats Container */
.detailed-stats-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.detailed-stats-container.hidden {
    display: none;
}

.detailed-stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.detailed-stats-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

.detailed-stats-subtitle {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Stats Grid */
.detailed-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.hotel-stats-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.hotel-stats-card-header {
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hotel-stats-card-header h5 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin: 0;
}

.hotel-stats-card-header .employee-count {
    font-size: var(--text-sm);
    color: var(--gray-500);
    background: var(--gray-200);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.hotel-stats-card[data-hotel-index="0"] .hotel-stats-card-header { border-top: 3px solid var(--brand-indigo-600); }
.hotel-stats-card[data-hotel-index="1"] .hotel-stats-card-header { border-top: 3px solid var(--brand-green-600); }
.hotel-stats-card[data-hotel-index="2"] .hotel-stats-card-header { border-top: 3px solid var(--brand-amber-500); }
.hotel-stats-card[data-hotel-index="3"] .hotel-stats-card-header { border-top: 3px solid var(--brand-pink-600); }
.hotel-stats-card[data-hotel-index="4"] .hotel-stats-card-header { border-top: 3px solid var(--brand-red-600); }

/* Benchmark Aggregate Stats Card */
.hotel-stats-card.benchmark-aggregate-stats {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-pink-50) 100%);
    border-color: var(--brand-indigo-300);
}

.hotel-stats-card.benchmark-aggregate-stats .hotel-stats-card-header {
    border-top: 3px solid var(--brand-indigo-600);
    background: linear-gradient(135deg, var(--brand-indigo-100) 0%, var(--brand-pink-100) 100%);
}

.hotel-stats-card-body {
    padding: 1.25rem;
}

/* Stats Metrics */
.stats-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.stats-metric-label {
    font-size: var(--text-body);
    color: var(--gray-600);
}

.stats-metric-value {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    font-family: var(--font-mono);
}

.stats-metric-value.highlight {
    color: var(--primary);
}

.stats-metric-value.success {
    color: var(--success);
}

.stats-metric-value.danger {
    color: var(--danger);
}

/* Gender Breakdown */
.gender-breakdown {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--gray-200);
}

.gender-stat {
    flex: 1;
    text-align: center;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.gender-stat.male {
    background: rgba(59, 130, 246, 0.1);
}

.gender-stat.female {
    background: rgba(236, 72, 153, 0.1);
}

.gender-stat-label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.gender-stat-value {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    font-family: var(--font-mono);
}

.gender-stat.male .gender-stat-value {
    color: var(--primary);
}

.gender-stat.female .gender-stat-value {
    color: #db2777;
}

/* Percentile Bar */
.percentile-bar-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--gray-200);
}

.percentile-bar-label {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.percentile-bar {
    position: relative;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: visible;
}

.percentile-marker {
    position: absolute;
    top: -4px;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    transform: translateX(-50%);
    border: 2px solid var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.percentile-marker.p25 { background: var(--warning); }
.percentile-marker.p50 { background: var(--brand-green-500); }
.percentile-marker.p75 { background: var(--brand-pink-500); }

.percentile-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.percentile-values {
    display: flex;
    justify-content: space-around;
    margin-top: 0.5rem;
    gap: 0.5rem;
}

.percentile-value {
    text-align: center;
    padding: 0.375rem 0.5rem;
    background: var(--gray-50);
    border-radius: 4px;
    flex: 1;
}

.percentile-value-label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    color: var(--gray-500);
}

.percentile-value-num {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    font-family: var(--font-mono);
}

/* Insights Single Hotel Stats */
.detailed-stats-grid.single-hotel {
    display: block;
    max-width: 500px;
}

.hotel-stats-card.insights-single {
    border-top: 3px solid var(--primary);
}

.hotel-stats-card.insights-single .hotel-stats-card-header {
    border-top: none;
}

.hotel-stats-card.no-data .no-data-message {
    color: var(--gray-500);
    font-style: italic;
    text-align: center;
    padding: 1rem 0;
}

/* Salary Range Visual */
.salary-range-visual {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--gray-200);
}

.salary-range-visual .percentile-bar-label {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.range-bar {
    position: relative;
    height: 8px;
    background: linear-gradient(to right, var(--gray-200), var(--gray-300));
    border-radius: 4px;
    margin-bottom: 2rem;
    margin-top: 1.5rem;
}

.range-p25,
.range-p50,
.range-p75 {
    position: absolute;
    top: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transform: translateX(-50%);
    border: 2px solid var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
}

.range-p25 { background: var(--warning); }
.range-p50 { background: var(--brand-green-500); }
.range-p75 { background: var(--brand-pink-500); }

/* Data labels on the dots */
.range-p25::before,
.range-p50::before,
.range-p75::before {
    content: attr(data-label);
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    white-space: nowrap;
    padding: 2px 4px;
    border-radius: 3px;
}

.range-p25::before {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.range-p50::before {
    color: var(--brand-green-500);
    background: rgba(16, 185, 129, 0.1);
}

.range-p75::before {
    color: var(--brand-pink-500);
    background: rgba(139, 92, 246, 0.1);
}

/* Value labels below the dots */
.range-p25::after,
.range-p50::after,
.range-p75::after {
    content: attr(data-value);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    white-space: nowrap;
    font-family: var(--font-mono);
}

.range-labels {
    display: none;
}

.range-labels span {
    padding: 0.25rem 0.5rem;
    background: var(--gray-50);
    border-radius: 4px;
}

/* Gender breakdown for Insights */
.gender-breakdown .gender-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
}

.gender-breakdown .gender-label {
    font-size: var(--text-body);
    color: var(--gray-600);
}

.gender-breakdown .gender-value {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    font-family: var(--font-mono);
}

/* Comparison Summary Table */
.comparison-summary {
    margin-top: 1.5rem;
    overflow-x: auto;
}

.comparison-summary h5 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.comparison-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
}

.comparison-summary-table th,
.comparison-summary-table td {
    padding: 0.75rem 1rem;
    text-align: right;
    border-bottom: 1px solid var(--gray-200);
}

.comparison-summary-table th:first-child,
.comparison-summary-table td:first-child {
    text-align: left;
}

.comparison-summary-table th {
    background: var(--gray-50);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.comparison-summary-table td {
    font-family: var(--font-mono);
}

.comparison-summary-table tr:hover {
    background: var(--gray-50);
}

.comparison-summary-table .best-value {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: var(--font-semibold);
}

/* Outliers Container */
.outliers-container {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--warning);
}

.outliers-container.hidden {
    display: none;
}

.outliers-header {
    margin-bottom: 1.5rem;
}

.outliers-header h4 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.outliers-header p {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.outliers-summary {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.no-outliers {
    text-align: center;
    color: var(--gray-500);
    padding: 2rem;
    font-style: italic;
}

.outliers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
}

.outliers-table th,
.outliers-table td {
    padding: 0.75rem 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.outliers-table th {
    background: var(--gray-50);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    white-space: nowrap;
}

.outliers-table tr:hover {
    background: var(--gray-50);
}

.outliers-table .salary-cell {
    font-family: var(--font-mono);
    font-weight: var(--font-semibold);
}

.outliers-table .salary-cell.below {
    color: var(--danger);
}

.outliers-table .salary-cell.above {
    color: var(--success);
}

.outlier-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
}

.outlier-status.status-below {
    background: var(--danger-lighter);
    color: var(--danger);
}

.outlier-status.status-above {
    background: var(--success-lighter);
    color: var(--success);
}

/* Collapsible Subsections */
.subsections-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.subsection {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.subsection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border: none;
    cursor: pointer;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    text-align: left;
    transition: all 0.2s;
}

.subsection-header:hover {
    background: var(--gray-100);
}

.subsection-header span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subsection-chevron {
    transition: transform 0.2s;
    color: var(--gray-500);
}

.subsection.open .subsection-chevron {
    transform: rotate(180deg);
}

.subsection.open .subsection-header {
    background: var(--primary-light);
    color: var(--primary);
}

.subsection.open .subsection-chevron {
    color: var(--primary);
}

.subsection-content {
    display: none;
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.subsection.open .subsection-content {
    display: block;
}

.subsection-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.tenure-analysis-content {
    padding: 0;
}

/* Metrics Table Container */
.metrics-table-container {
    margin-bottom: 1.5rem;
    overflow-x: auto;
}
.criteria-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.distance-options {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.distance-options label {
    font-size: var(--text-body);
    color: var(--gray-600);
    white-space: nowrap;
}

.distance-options select {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: var(--text-body);
    background: white;
    color: var(--gray-700);
}

#run-benchmark-tool {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Benchmark Tool Results */
.benchmark-tool-results {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.benchmark-tool-results .results-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.benchmark-tool-results .results-header h4 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.benchmark-tool-results .results-header p {
    font-size: var(--text-body);
    color: var(--gray-600);
}

.benchmark-matches-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.benchmark-match-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.benchmark-tool-hotel-info.hidden {
    display: none;
}
.source-hotel-card {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--primary-light) 100%) !important;
    border-color: #93c5fd !important;
}
.source-hotel-benchmark-count {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: 0.25rem;
}
.tag-facility {
    background: var(--gray-100) !important;
    color: var(--gray-500) !important;
    font-style: italic;
}

.match-rank {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-400);
    min-width: 40px;
}

.match-info {
    flex: 1;
}

.match-hotel-name {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.match-hotel-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.match-hotel-tags .tag {
    font-size: var(--text-xs);
    padding: 0.15rem 0.4rem;
    background: var(--gray-200);
    color: var(--gray-600);
    border-radius: 4px;
}

.match-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.match-detail {
    font-size: var(--text-sm);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.match-detail.matched {
    background: var(--success-light);
    color: var(--brand-green-800);
}

.match-detail.unmatched {
    background: var(--danger-light);
    color: var(--brand-red-800);
}

.match-score {
    text-align: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    min-width: 70px;
}

.match-score .score-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    line-height: 1;
}

.match-score .score-label {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.match-score.perfect {
    background: linear-gradient(135deg, var(--brand-green-500) 0%, var(--brand-green-600) 100%);
    color: white;
}

.match-score.high {
    background: linear-gradient(135deg, var(--brand-green-400) 0%, var(--brand-green-500) 100%);
    color: white;
}

.match-score.good {
    background: linear-gradient(135deg, var(--brand-amber-400) 0%, var(--brand-amber-500) 100%);
    color: white;
}

.match-score.fair {
    background: linear-gradient(135deg, var(--brand-amber-500) 0%, var(--brand-amber-600) 100%);
    color: white;
}

.add-benchmark-btn {
    white-space: nowrap;
}

.remove-benchmark-btn {
    white-space: nowrap;
    color: var(--danger);
    border-color: var(--danger);
}

.remove-benchmark-btn:hover {
    background: var(--danger);
    color: white;
}

.no-matches {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-400);
}

.no-matches svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-matches p {
    margin: 0;
}

.no-matches .hint {
    font-size: var(--text-body);
    margin-top: 0.5rem;
}

/* =====================
   Benchmark Compare Modal
   ===================== */

.benchmark-compare-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.benchmark-compare-score-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-indigo-100) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--brand-indigo-200);
}

.benchmark-compare-score-circle {
    position: relative;
    width: 100px;
    height: 100px;
}

.benchmark-score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.benchmark-score-bg {
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 8;
}

.benchmark-score-fill {
    fill: none;
    stroke: var(--brand-indigo-500);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.8s ease-out;
}

.benchmark-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--brand-indigo-800);
}

.benchmark-compare-score-label {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-800);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.benchmark-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.benchmark-compare-column {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 2px solid var(--gray-200);
}

.benchmark-compare-source {
    background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--brand-green-100) 100%);
    border-color: var(--brand-green-300);
}

.benchmark-compare-target {
    background: linear-gradient(135deg, var(--brand-amber-100) 0%, var(--brand-amber-200) 100%);
    border-color: var(--brand-amber-300);
}

.benchmark-compare-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
}

.benchmark-compare-source .benchmark-compare-label {
    background: var(--success);
    color: white;
}

.benchmark-compare-target .benchmark-compare-label {
    background: #ca8a04;
    color: white;
}

.benchmark-compare-header {
    text-align: center;
}

.benchmark-compare-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.benchmark-compare-source .benchmark-compare-icon svg {
    color: var(--success);
}

.benchmark-compare-target .benchmark-compare-icon svg {
    color: #ca8a04;
}

.benchmark-compare-name {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.benchmark-compare-location {
    font-size: var(--text-body);
    color: var(--gray-500);
}

.benchmark-compare-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.benchmark-breakdown-row {
    display: grid;
    grid-template-columns: 1fr 180px 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.benchmark-breakdown-source,
.benchmark-breakdown-target {
    font-size: var(--text-body);
    color: var(--gray-700);
    font-weight: var(--font-medium);
}

.benchmark-breakdown-source {
    text-align: right;
    padding-right: 0.5rem;
    border-right: 2px solid #86efac;
}

.benchmark-breakdown-target {
    text-align: left;
    padding-left: 0.5rem;
    border-left: 2px solid var(--brand-amber-300);
}

.benchmark-breakdown-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.benchmark-breakdown-factor {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.benchmark-breakdown-factor .factor-icon {
    font-size: var(--text-base);
}

.benchmark-breakdown-bar {
    width: 100%;
    height: 10px;
    background: var(--gray-200);
    border-radius: 5px;
    overflow: hidden;
}

.benchmark-breakdown-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-indigo-500) 0%, var(--primary) 100%);
    border-radius: 5px;
    transition: width 0.5s ease-out;
}

.benchmark-breakdown-fill.exact {
    background: linear-gradient(90deg, var(--brand-green-600) 0%, var(--brand-green-700) 100%);
}

.benchmark-breakdown-fill.high {
    background: linear-gradient(90deg, var(--brand-green-500) 0%, var(--success) 100%);
}

.benchmark-breakdown-fill.medium {
    background: linear-gradient(90deg, var(--brand-amber-500) 0%, var(--brand-amber-600) 100%);
}

.benchmark-breakdown-fill.low {
    background: linear-gradient(90deg, var(--brand-amber-400) 0%, var(--brand-amber-500) 100%);
}

.benchmark-breakdown-fill.none {
    background: linear-gradient(90deg, var(--brand-red-500) 0%, var(--danger) 100%);
}

.benchmark-breakdown-score {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.benchmark-breakdown-row.no-data {
    background: var(--gray-50);
    opacity: 0.7;
}

.benchmark-breakdown-row.no-data .benchmark-breakdown-source,
.benchmark-breakdown-row.no-data .benchmark-breakdown-target {
    color: var(--gray-400);
    font-style: italic;
}

.benchmark-breakdown-row.no-data .benchmark-breakdown-score {
    background: var(--danger-light);
    color: var(--brand-red-800);
}

@media (max-width: 768px) {
    .benchmark-compare-grid {
        grid-template-columns: 1fr;
    }

    .benchmark-breakdown-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .benchmark-breakdown-source,
    .benchmark-breakdown-target {
        text-align: center;
        border: none;
        padding: 0;
    }

    .benchmark-breakdown-source {
        order: 1;
    }

    .benchmark-breakdown-center {
        order: 0;
    }

    .benchmark-breakdown-target {
        order: 2;
    }
}

/* =====================
   Support Ticket Styles
   ===================== */

.support-ticket-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    max-width: 1000px;
}

.support-ticket-form-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.support-ticket-form-card .form-group {
    margin-bottom: 1.25rem;
}

.support-ticket-form-card label {
    display: block;
    font-weight: var(--font-medium);
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.support-ticket-form-card label .required {
    color: var(--brand-red-500);
}

.support-ticket-form-card input[type="text"],
.support-ticket-form-card select,
.support-ticket-form-card textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: var(--text-body);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.support-ticket-form-card input[type="text"]:focus,
.support-ticket-form-card select:focus,
.support-ticket-form-card textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.support-ticket-form-card textarea {
    resize: vertical;
    min-height: 120px;
}

.support-ticket-form-card .form-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-100);
}

.support-ticket-form-card .form-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.support-info-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    height: fit-content;
}

.support-info-card h4 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 0.75rem;
}

.support-info-card > p {
    font-size: var(--text-body);
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.support-tips {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.support-tips h5 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.support-tips ul {
    margin: 0;
    padding-left: 1.25rem;
}

.support-tips li {
    font-size: var(--text-body);
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
    .support-ticket-container {
        grid-template-columns: 1fr;
    }
}

/* Data Upload Sections */
/* Template Downloads Section */
.template-downloads-section {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.template-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.template-section-header svg {
    color: var(--primary);
}

.template-section-header h3 {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.template-section-desc {
    color: var(--gray-500);
    font-size: var(--text-body);
    margin: 0 0 1.25rem 0;
}

.template-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}

.template-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 1.25rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.template-card:hover {
    border-color: var(--gray-300);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.template-card.customized {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-color: var(--brand-green-200);
}

.template-card.customized:hover {
    border-color: var(--brand-green-300);
}

.template-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.template-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.template-card-icon.basic {
    background: var(--gray-100);
    color: var(--gray-600);
}

.template-card-icon.customized {
    background: var(--brand-green-100);
    color: var(--brand-green-600);
}

.template-card-title {
    flex: 1;
}

.template-card-title h4 {
    margin: 0 0 0.25rem 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.template-card-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--gray-200);
    color: var(--gray-600);
}

.template-card-badge.recommended {
    background: var(--brand-green-100);
    color: var(--brand-green-700);
}

.template-card-desc {
    font-size: var(--text-body);
    color: var(--gray-600);
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.template-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.template-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    color: var(--gray-600);
    margin-bottom: 0.4rem;
}

.template-features li svg {
    color: var(--success);
    flex-shrink: 0;
}

.template-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.template-card-actions .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
    gap: 0.35rem;
}

.template-unavailable {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--gray-100);
    border-radius: 6px;
    color: var(--gray-500);
    font-size: var(--text-body);
    width: 100%;
}

.template-unavailable svg {
    color: var(--warning);
}

.template-data-info {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--brand-green-200);
}

.template-data-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-sm);
    color: var(--brand-green-700);
}

.template-data-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-green-500);
}

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

    .template-card-actions {
        flex-direction: column;
    }

    .template-card-actions .btn {
        width: 100%;
    }
}

.data-upload-section {
    margin-bottom: 2rem;
}

.section-header {
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header.people {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--brand-indigo-200) 100%);
    border-left: 4px solid var(--primary);
}

.section-header.financial {
    background: linear-gradient(135deg, var(--brand-green-100) 0%, var(--brand-green-200) 100%);
    border-left: 4px solid var(--success);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header.people .section-title svg {
    color: var(--primary);
}

.section-header.financial .section-title svg {
    color: var(--success);
}

.section-title h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin: 0;
    color: var(--gray-800);
}

.section-desc {
    color: var(--gray-600);
    font-size: var(--text-body);
    margin: 0;
}

/* People month cards styling (blue theme) */
.people-section .month-card {
    border-color: var(--brand-indigo-200);
}

.people-section .month-card.has-data {
    border-color: var(--primary);
    border-left: 4px solid var(--primary);
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--primary-light) 100%);
}

.people-section .month-card .month-status.has-data {
    background: var(--primary);
}

.people-section .month-card .btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.people-section .month-card .btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.people-section .month-card .stat-value {
    color: var(--primary);
}

/* Financial month cards styling (green theme) */
.financial-section .month-card {
    border-color: var(--brand-green-200);
}

.financial-section .month-card.has-data {
    border-color: var(--success);
    border-left: 4px solid var(--success);
    background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--brand-green-100) 100%);
}

.financial-section .month-card .month-status.has-data {
    background: var(--success);
}

.financial-section .month-card .btn-primary {
    background: var(--success);
    border-color: var(--success);
}

.financial-section .month-card .btn-primary:hover {
    background: var(--brand-green-700);
    border-color: var(--brand-green-700);
}

.financial-section .month-card .stat-value {
    color: var(--success);
}

/* Year Selector */
.year-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 0;
    margin-bottom: 0.5rem;
}

.year-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.15s ease;
}

.year-nav-btn:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-800);
}

.year-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.year-display {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    min-width: 60px;
    text-align: center;
}

/* Deprecated 2026-06-11: .upload-tabs-container scoped tab rules + .upload-tab-content
   replaced by canonical global .tab-btn / .tabs / .tab-content. */
.upload-tabs-container {
    margin-bottom: 1.5rem;
}

/* History Year Selector (inside Upload History tab) */
/* History on a month card: the month / All months switch and a note */
.history-month-filter:empty { display: none; }
.history-month-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0 0 1rem;
}
.history-month-filter .filter-pill-group { flex: none; }
.history-month-filter .filter-pill { white-space: nowrap; }

.history-year-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 0;
    margin-bottom: 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
}

/* Upload History Section */
.upload-history-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
}

.upload-history-section:first-of-type {
    margin-top: 0;
}

.upload-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.upload-history-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin: 0;
}

.upload-history-header h4 svg {
    color: var(--gray-500);
}

.upload-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 320px;
    overflow-y: auto;
}

.upload-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
}

.upload-history-item:hover {
    border-color: var(--gray-300);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.upload-history-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.upload-history-filename {
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-history-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.upload-history-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.upload-history-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-history-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.upload-history-actions .btn {
    padding: 0.35rem 0.75rem;
    font-size: var(--text-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.upload-history-actions .btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Upload History Month Groups */
.upload-history-month-group {
    margin-bottom: 1.5rem;
}

.upload-history-month-group:last-child {
    margin-bottom: 0;
}

.upload-history-month-header {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.upload-history-month-group .upload-history-item {
    margin-bottom: 0.5rem;
}

.upload-history-month-group .upload-history-item:last-child {
    margin-bottom: 0;
}

/* People section upload history accent */
.people-section .upload-history-section {
    border-left: 3px solid var(--primary);
}

.people-section .upload-history-header h4 svg {
    color: var(--primary);
}

/* Financial section upload history accent */
.financial-section .upload-history-section {
    border-left: 3px solid var(--success);
}

.financial-section .upload-history-header h4 svg {
    color: var(--success);
}

/* Rewards Comparison Section */
.rewards-comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.rewards-comparison-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.rewards-comparison-card.primary {
    border-color: var(--primary);
    border-width: 2px;
}

.rewards-comparison-card.aggregate {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

.rewards-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    transition: background 150ms ease;
}

.rewards-comparison-card.primary .rewards-card-header {
    background: transparent;
}

.rewards-card-header h4 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    margin: 0;
    color: var(--brand-amber-900);
}

.rewards-card-body {
    padding: 1.25rem;
}

.rewards-totals {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.rewards-total-item {
    text-align: center;
}

.rewards-total-value {
    display: block;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--primary);
}

.rewards-total-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.rewards-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rewards-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.rewards-label {
    font-size: var(--text-body);
    color: var(--gray-700);
}

.rewards-value {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    text-align: right;
}

.rewards-avg {
    font-size: var(--text-sm);
    color: var(--gray-500);
    text-align: right;
    min-width: 80px;
}

/* Turnover Analysis Card */
.turnover-analysis-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    overflow: hidden;
    transition: background-color 0.25s ease;
}

.turnover-analysis-card.card-expanded {
    background: var(--white);
}

.turnover-analysis-card.card-expanded .turnover-card-header {
    background: transparent;
}

.turnover-card-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 150ms ease;
}

.turnover-card-header.collapsed {
    border-radius: 0;
}

.turnover-card-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.turnover-card-body {
    padding: 1.25rem;
}

.turnover-metrics {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.turnover-metric {
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.turnover-metric-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    line-height: 1.2;
}

.turnover-metric-value.turnover-low {
    color: var(--success);
}

.turnover-metric-value.turnover-medium {
    color: var(--brand-amber-600);
}

.turnover-metric-value.turnover-high {
    color: var(--danger);
}

/* Composite score colors */
.turnover-metric-value.composite-good {
    color: var(--success);
}

.turnover-metric-value.composite-neutral {
    color: var(--brand-amber-600);
}

.turnover-metric-value.composite-poor {
    color: var(--danger);
}

.turnover-metric-clickable {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.turnover-metric-clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.turnover-metric-label {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-top: 0.5rem;
}

.turnover-metric-detail {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.turnover-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--primary-lighter);
    border: 1px solid var(--brand-indigo-200);
    border-radius: var(--radius);
    color: var(--brand-indigo-800);
    font-size: var(--text-body);
}

.turnover-note svg {
    flex-shrink: 0;
}

@media (max-width: 1100px) {
    .turnover-metrics {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 768px) {
    .turnover-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 500px) {
    .turnover-metrics {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Turnover Performance Breakdown */
.turnover-perf-section {
    margin-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
}

.turnover-perf-section-title,
.turnover-dept-section-title {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.turnover-perf-grid {
    display: grid;
    gap: 0.75rem;
}

.turnover-perf-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.15s;
}

.turnover-perf-cell:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.turnover-perf-cell:active {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* High performer turnover — red (losing top talent is bad) */
.turnover-perf-cell.tp-high {
    background: var(--danger-lighter);
    border-color: var(--brand-red-300);
}

/* Solid performer turnover — amber */
.turnover-perf-cell.tp-solid {
    background: var(--warning-lighter);
    border-color: var(--brand-amber-200);
}

/* Low performer turnover — green (natural/healthy attrition) */
.turnover-perf-cell.tp-low {
    background: var(--brand-green-50);
    border-color: var(--brand-green-200);
}

.turnover-perf-cell.tp-unrated {
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.turnover-perf-cell-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    line-height: 1.2;
    margin-bottom: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.turnover-perf-cell-score {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    line-height: 1.2;
}

.tp-high .turnover-perf-cell-score { color: var(--danger); }
.tp-solid .turnover-perf-cell-score { color: var(--brand-amber-600); }
.tp-low .turnover-perf-cell-score { color: var(--brand-green-600); }
.tp-unrated .turnover-perf-cell-score { color: var(--gray-500); }

.turnover-perf-cell-meta {
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-top: 0.15rem;
}

.turnover-perf-cell-empty {
    opacity: 0.5;
    cursor: default;
}

.turnover-perf-cell-empty:hover {
    transform: none;
    box-shadow: none;
}

/* Turnover Category Bars */
.turnover-perf-categories {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.turnover-cat-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.turnover-cat-healthy {
    background: var(--brand-green-100);
    color: var(--brand-green-700);
    border: 1px solid var(--brand-green-200);
}

.turnover-cat-mixed {
    background: var(--brand-amber-100);
    color: var(--brand-amber-700);
    border: 1px solid var(--brand-amber-200);
}

.turnover-cat-regrettable {
    background: var(--brand-red-100);
    color: var(--brand-red-700);
    border: 1px solid var(--brand-red-200);
}

.turnover-cat-unrated {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
}

/* --------------------------------------------------------------------------
   Exit-mix strip — the compact sibling of `.turnover-cat-bar` above.

   Same four categories, same meaning, same colour semantics; the only
   difference is scale. `.turnover-cat-bar` is a full-width labelled band that
   reads on its own; this is a 92px unlabelled strip that lives in a table cell,
   where a labelled band would be taller than the row. Deliberately placed
   against the family it extends rather than in the table section, so the two
   cannot drift apart.

   Segments reuse `.turnover-cat-healthy/-mixed/-regrettable/-unrated` for the
   fill. Those rules also carry a border, which would show as a hairline between
   1px-wide segments — hence the border reset here.
   -------------------------------------------------------------------------- */
.turnover-cat-strip {
    display: inline-flex;
    width: 92px;
    height: 7px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--gray-100);
    vertical-align: middle;
    cursor: help;
}

.turnover-cat-strip > i {
    display: block;
    height: 100%;
    border: none;
    border-radius: 0;
    min-width: 2px;   /* a single leaver in a large group must stay visible */
}

/* Solid fills, not the 100-level tints the labelled band uses: at 7px tall a
   tint reads as empty. Same hues, one step up the scale. */
.turnover-cat-strip > i.turnover-cat-healthy     { background: var(--brand-green-500); }
.turnover-cat-strip > i.turnover-cat-mixed       { background: var(--brand-amber-500); }
.turnover-cat-strip > i.turnover-cat-regrettable { background: var(--brand-red-500); }
.turnover-cat-strip > i.turnover-cat-unrated     { background: var(--gray-300); }

.turnover-cat-strip-none {
    color: var(--gray-400);
    font-size: var(--text-sm);
}

/* --------------------------------------------------------------------------
   Turnover breakdown table — chrome only.

   The table itself is the canonical `.data-table.data-table-compact` inside a
   `.table-container`; everything here is sort affordance, row affordance and
   the status cell. Nothing below restyles a border, a padding or a header
   background — if it starts to, the canonical is being forked.
   Builder: client/turnover-table.js.
   -------------------------------------------------------------------------- */
.tt-table th.tt-th-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.tt-table th.tt-th-sortable:hover {
    color: var(--gray-900);
}

/* `.cell-value` is the canonical numeric-cell class; on a TH we want only its
   alignment. Its monospace face is for digits, and a monospaced uppercase
   header reads as a different table. */
.tt-table th.cell-value {
    font-family: inherit;
}

/* Always in the DOM so sorting cannot reflow the header row; revealed on hover
   and on the active column. */
.tt-sort-arrow {
    margin-left: 0.3rem;
    font-size: 9px;
    opacity: 0;
    transition: opacity 0.12s ease;
}

.tt-table th.tt-th-sortable:hover .tt-sort-arrow { opacity: 0.4; }
.tt-table th[aria-sort] { color: var(--primary-color); }
.tt-table th[aria-sort] .tt-sort-arrow { opacity: 1; }

.tt-table tr.tt-row { cursor: pointer; }

.tt-table tr.tt-row:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* --------------------------------------------------------------------------
   Values centred under their headers; the first column stays left.

   This DIVERGES from the approved `.data-table` convention, where `.cell-value`
   is right-aligned so digits line up at the units place. That convention earns
   its keep on long numbers in narrow columns. These tables are the opposite:
   wide columns, values of one to three characters, so a right-aligned value
   drifts away from the label it belongs to and the row reads as scattered.
   `tabular-nums` stays on, so every digit keeps the same width and the numbers
   still form a tidy stack — the trade is only that magnitudes no longer align.

   Decided 2026-08-10 across both card families at once, so the Turnover and
   Gender tables cannot end up disagreeing about what a table looks like.

   `.data-table.tt-table` (0,3,1) rather than `.tt-table` (0,2,1), so this wins
   on specificity rather than on being further down the file.
   -------------------------------------------------------------------------- */
.tt-table th,
.tt-table td { text-align: center; }
.data-table.tt-table th.cell-value,
.data-table.tt-table td.cell-value { text-align: center; }
.tt-table th:first-child,
.tt-table td:first-child { text-align: left; }

/* A grade label is short by construction ("Grade 10"), so it should never wrap
   into two lines just because the row has nine columns. Scoped to the grade
   lenses; a department name legitimately wraps rather than widening the table. */
.tt-table[data-tt-lens="grade"] .tt-cell-name { white-space: nowrap; }

/* --------------------------------------------------------------------------
   Row shading. Deliberately near-invisible in isolation — its whole job is to
   let the eye track ACROSS a wide row without a rule to follow, and anything
   strong enough to notice on its own competes with the status dots and charts.

   The three states must stay separable, which fixes their order: zebra faintest,
   hover a clear step up (and NOT `--gray-50`, which the zebra tint sits right
   next to), selection winning outright.
   -------------------------------------------------------------------------- */
.tt-table { --tt-zebra: rgba(17, 24, 39, 0.022); }
.tt-table tbody tr:nth-child(even) { background: var(--tt-zebra); }
.tt-table tbody tr:hover,
.tt-table tbody tr:nth-child(even):hover { background: var(--gray-100); }
.tt-table tbody tr.is-l3-selected,
.tt-table tbody tr.is-l3-selected:hover { background: var(--primary-light); }

.tt-cell-name {
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

/* The small-cohort flag sits with the rate it qualifies, not in its own column:
   it is a caveat on that number, not a separate fact. It hangs to the LEFT of
   the figure so the right-aligned rates stay in one readable column — a badge
   after the number pushes that row's rate out of line with every other. */
.tt-table td.cell-value .sample-size-badge {
    margin-right: 0.4rem;
    font-family: var(--font-sans);
    vertical-align: baseline;
}

.tt-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.tt-status .card-l3-mgr-dot { flex: 0 0 auto; }

/* "No exits" / "Not rated" — an absence, stated. Muted so it does not read as a
   fourth RAG state alongside regrettable / mixed / healthy. */
.tt-status-none { color: var(--gray-400); }

.tt-note {
    margin: 0 0 0.75rem;
    font-size: var(--text-sm);
    color: var(--gray-500);
}

/* Key for the exit-mix strip. An unfamiliar visualisation needs a caption
   (ux-patterns §7.2); the per-row `title` is not one, because a hover tooltip
   does not exist on touch. */
.tt-legend {
    margin: 0.6rem 0 0;
    font-size: var(--text-xs);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tt-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.tt-legend-item > i {
    width: 10px;
    height: 7px;
    border-radius: 2px;
    border: none;
    display: inline-block;
}

.tt-legend-item > i.turnover-cat-regrettable { background: var(--brand-red-500); }
.tt-legend-item > i.turnover-cat-mixed       { background: var(--brand-amber-500); }
.tt-legend-item > i.turnover-cat-healthy     { background: var(--brand-green-500); }

/* Sortability must be visible without hovering. On a touch screen there is no
   hover state at all, so the arrow would never appear and the columns would
   read as static. */
@media (hover: none) {
    .tt-sort-arrow { opacity: 0.35; }
}

/* --------------------------------------------------------------------------
   Gender distribution chart — one element, three sizes, always with the target.

   Replaces both the full-width `.gender-grade-bar-*` stack and the two card
   grids that had no target at all. A bar with no band cannot be judged: 30%
   female and 50% female look identical with nothing to place them against, on
   a card whose whole subject is a target.

   Colours are the `--gender-*` tokens. NOT `.gender-grade-bar-fill.female`'s
   `#6366f1`, which is indigo, in raw hex, and breaks the platform's own rule
   that indigo is navigation chrome and never a data series.
   Builder: client/gender-table.js.
   -------------------------------------------------------------------------- */
/* The track takes whatever its column can spare, with a floor so it cannot collapse to a sliver. */
.gt-cell-dist { width: 32%; }

/* --------------------------------------------------------------------------
   Narrow panes: drop the two count columns rather than scroll.

   Female and Male counts are derivable from People and the percentage beside
   them, so they are the columns to lose when the pane cannot hold eight. Losing
   them is a real cost, which is why it happens only when the alternative is a
   horizontal scroll on a table whose whole point is reading DOWN it.

   Class-driven for the drawer, media query for the viewport — the pane narrows
   when the drawer opens WITHOUT the viewport changing, so a width query alone
   would never fire. Same reason the l3-drawer push rules are class-driven.
   -------------------------------------------------------------------------- */
body.l3-drawer-open .gt-col-drop { display: none; }

@media (max-width: 1100px) {
    .gt-col-drop { display: none; }
}




.gt-cell-dist { line-height: 0; }

/* Key for the chart. An unfamiliar visualisation needs a caption (ux-patterns
   §7.2); the per-row `title` is not one, because hover does not exist on touch. */
.gt-legend {
    margin: 0.6rem 0 0;
    font-size: var(--text-xs);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.gt-legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.gt-legend-item > i { width: 10px; height: 7px; border-radius: 2px; display: inline-block; }
.gt-legend-sep { color: var(--gray-300); }
.gt-legend-hidden { margin-left: auto; }

.gt-key-female { background: var(--gender-female); }
.gt-key-male   { background: var(--gender-male); }
.gt-key-other  { background: var(--gender-other); }
/* The band swatch is the fill seen THROUGH the band, which is what it is on the
   chart — so a reader can match it without being told. */

/* Δ against the next grade down. Direction is carried by sign AND weight, not
   colour alone — and deliberately not the RAG palette: a fall in female share is
   a finding to read, not a threshold breach. */
.gt-delta { font-variant-numeric: tabular-nums; }
.gt-delta.is-drop { color: var(--danger); font-weight: var(--font-semibold); }
.gt-delta.is-rise { color: var(--gray-700); }
.gt-delta.is-flat { color: var(--gray-400); }
.gt-delta-none { color: var(--gray-300); }

/* The drawer's ladder. Same canonical table, narrower gutters — it sits in a
   430px panel, not a 1000px pane. Its rows are evidence, not targets: nothing
   opens when you click one, so it keeps the zebra and drops the hover. */
.gt-ladder { font-size: var(--text-xs); }
.gt-ladder th,
.gt-ladder td { padding: 0.35rem 0.4rem; }
.gt-ladder th:first-child,
.gt-ladder td:first-child { padding-left: 0; }
.gt-ladder th:last-child,
.gt-ladder td:last-child { padding-right: 0; }
.gt-ladder tbody tr { cursor: default; }
.tt-table.gt-ladder tbody tr:hover,
.tt-table.gt-ladder tbody tr:nth-child(even):hover { background: var(--tt-zebra); }
.tt-table.gt-ladder tbody tr:nth-child(odd):hover { background: transparent; }

/* Gender on a person row: a NEUTRAL chip carrying the chart's colour as a dot.
   Not `.badge-success` / `.badge-info`, which would quietly assign valence to
   someone's gender. Gender is not a status, so it does not get the status
   palette. */
.gt-chip { gap: 0.3rem; text-transform: none; }
.gt-chip > i {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    display: inline-block;
    flex: 0 0 auto;
}

/* The one sentence the drawer exists to deliver, ahead of the evidence. */
.l3-drawer-topnote {
    margin: 0 0 1rem;
    padding: 0.6rem 0.7rem;
    border-left: 3px solid var(--gray-300);
    background: var(--gray-50);
    border-radius: 0 6px 6px 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--gray-700);
}
.l3-drawer-topnote strong { color: var(--gray-900); font-weight: 600; }
.gt-below { color: var(--danger); }

/* --------------------------------------------------------------------------
   Retirement › By department — the timeline strip and its table.

   The strip is a PURE COMPOSITION: this year / next year / later, as proportions
   of the department's retirees. Deliberately no target band and no position
   marker, unlike the gender chart — retirement has no threshold to plot against,
   and a band drawn on a metric nobody set a target for is a claim the data
   cannot support. Urgency-only RAG.

   Geometry comes from the shared itCompStripHtml; only the colours are here,
   and they are the same RAG the card already uses for its status dots, so the
   strip and the dot beside it cannot disagree.
   Builder: client/retirement-table.js.
   -------------------------------------------------------------------------- */
.rt-strip {
    display: flex;
    width: 100%;
    min-width: 80px;
    height: 7px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--gray-100);
    vertical-align: middle;
    cursor: help;
}
.rt-strip > i { display: block; height: 100%; min-width: 2px; }
.rt-seg-now   { background: var(--brand-red-500); }
.rt-seg-next  { background: var(--brand-amber-500); }
.rt-seg-later { background: var(--brand-green-500); }
.rt-strip-none { color: var(--gray-400); font-size: var(--text-sm); }
.rt-cell-strip { width: 22%; }
.rt-drawer-strip { margin-bottom: 1rem; }
.rt-none { color: var(--gray-400); }
.rt-below { color: var(--danger); }

.rt-legend {
    margin: 0.6rem 0 0;
    font-size: var(--text-xs);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.rt-legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.rt-legend-item > i { width: 10px; height: 7px; border-radius: 2px; display: inline-block; }
.rt-legend-sep { color: var(--gray-300); }

/* Most senior grade losing anybody. `all` is the loud case — a department can be
   2% by headcount and still be losing every person at its top level. */
.rt-topgrade { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rt-topgrade.is-whole { font-weight: var(--font-semibold); color: var(--danger); }
.rt-whole {
    margin-left: 0.3rem;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--brand-red-50);
    color: var(--brand-red-700);
    padding: 0.05rem 0.25rem;
    border-radius: 3px;
}
.rt-whole-cell { color: var(--danger); font-weight: var(--font-semibold); }

/* "3 of 4" on the grade lens: the count is the finding, the denominator is
   context, so they are not the same weight. */
.rt-of { font-weight: var(--font-normal); color: var(--gray-500); }

/* Single points of failure among the retiring. NOT the RAG palette — a SPOF is
   a property of the role, not a threshold breach, and colouring it red would
   make it compete with the urgency status beside it. */
.rt-spof { font-variant-numeric: tabular-nums; }
.rt-spof.has-spof { font-weight: var(--font-semibold); color: var(--gray-900); }
.rt-spof.has-spof::after {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-left: 0.3rem;
    border-radius: 50%;
    background: var(--brand-red-500);
    vertical-align: 2px;
}
.rt-spof.no-spof { color: var(--gray-400); }

/* Person rows in the drawer. */
.rt-person-right { display: inline-flex; gap: 0.35rem; align-items: center; }
.rt-chip {
    font-size: 10.5px;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    white-space: nowrap;
    align-self: center;
}
.rt-chip.critical { background: var(--brand-red-50); color: var(--brand-red-700); }
.rt-chip.high     { background: var(--brand-amber-50); color: var(--brand-amber-700); }
.rt-year {
    font-size: 11px;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    white-space: nowrap;
    align-self: center;
    font-variant-numeric: tabular-nums;
}
.rt-year.now   { background: var(--brand-red-50); color: var(--brand-red-700); }
.rt-year.next  { background: var(--brand-amber-50); color: var(--brand-amber-700); }
.rt-year.later { background: var(--gray-100); color: var(--gray-600); }

/* The drawer's grade ladder. Same canonical table, narrower gutters — a 430px
   panel, not a 1000px pane. Its rows are evidence, not targets: nothing opens
   when you click one, so it keeps the zebra and drops the hover. */
.rt-ladder { font-size: var(--text-xs); }
.rt-ladder th,
.rt-ladder td { padding: 0.35rem 0.4rem; }
.rt-ladder th:first-child,
.rt-ladder td:first-child { padding-left: 0; }
.rt-ladder th:last-child,
.rt-ladder td:last-child { padding-right: 0; }
.rt-ladder tbody tr { cursor: default; }
.tt-table.rt-ladder tbody tr:hover,
.tt-table.rt-ladder tbody tr:nth-child(even):hover { background: var(--tt-zebra); }
.tt-table.rt-ladder tbody tr:nth-child(odd):hover { background: transparent; }
/* Grades losing nobody stay on the ladder — a full ladder and a one-rung ladder
   look identical otherwise — but they recede. */
.rt-ladder tbody tr.rt-row-quiet td { color: var(--gray-400); }
.rt-ladder .rt-strip { width: 64px; min-width: 64px; }
/* The drawer is clamp(360px, 30vw, 480px), so a long department name in the
   ladder overflows at the low end. The canonical overflow wrapper, same as
   every other table — a five-column ladder that clips is worse than one that
   scrolls inside its own region. */
.l3-drawer .table-container { max-width: 100%; }

/* Narrow panes: drop Headcount and Earliest rather than scroll. The percentage
   already carries the ratio Headcount is the denominator for, and the strip plus
   Status already say how urgent it is — Earliest only adds the exact year.
   Class-driven for the drawer, media query for the viewport, because the pane
   narrows when the drawer opens WITHOUT the viewport changing. */
body.l3-drawer-open .rt-col-drop { display: none; }

@media (max-width: 1100px) {
    .rt-col-drop { display: none; }
}

/* Turnover Department Breakdown */
.turnover-dept-section {
    margin-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
}

.turnover-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.turnover-quality-patch {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: #fff;
    white-space: nowrap;
}

/* Turnover Popup Visual */
.turnover-popup-visual {
    margin-bottom: 1.25rem;
}

.turnover-verdict {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.turnover-verdict-healthy {
    background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--brand-green-100) 100%);
    border: 1px solid var(--brand-green-200);
}

.turnover-verdict-mixed {
    background: linear-gradient(135deg, var(--brand-amber-50) 0%, var(--brand-amber-100) 100%);
    border: 1px solid var(--brand-amber-200);
}

.turnover-verdict-regrettable {
    background: linear-gradient(135deg, var(--brand-red-50) 0%, var(--brand-red-100) 100%);
    border: 1px solid var(--brand-red-200);
}

.turnover-verdict-neutral {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border: 1px solid var(--gray-200);
}

.turnover-verdict-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    flex-shrink: 0;
}

.turnover-verdict-healthy .turnover-verdict-icon {
    background: var(--brand-green-500);
    color: white;
}

.turnover-verdict-mixed .turnover-verdict-icon {
    background: var(--warning);
    color: white;
}

.turnover-verdict-regrettable .turnover-verdict-icon {
    background: var(--brand-red-500);
    color: white;
}

.turnover-verdict-neutral .turnover-verdict-icon {
    background: var(--gray-400);
    color: white;
}

.turnover-verdict-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.turnover-verdict-label {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    letter-spacing: 0.02em;
}

.turnover-verdict-healthy .turnover-verdict-label { color: var(--brand-green-700); }
.turnover-verdict-mixed .turnover-verdict-label { color: var(--brand-amber-700); }
.turnover-verdict-regrettable .turnover-verdict-label { color: var(--danger); }
.turnover-verdict-neutral .turnover-verdict-label { color: var(--gray-500); }

.turnover-verdict-desc {
    font-size: var(--text-body);
    color: var(--gray-600);
}

.turnover-breakdown {
    padding: 0 0.25rem;
}

.turnover-bar-container {
    display: flex;
    height: 24px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--gray-100);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

.turnover-bar-seg {
    height: 100%;
    transition: width 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    min-width: 0;
}

.turnover-bar-seg.has-count {
    min-width: 28px;
}

.turnover-bar-seg-empty {
    min-width: 6px;
    max-width: 6px;
    opacity: 0.25;
}

.turnover-bar-seg:hover {
    filter: brightness(1.1);
}

.turnover-bar-low {
    background: linear-gradient(180deg, var(--brand-green-400) 0%, var(--brand-green-500) 100%);
}

.turnover-bar-solid {
    background: linear-gradient(180deg, #60a5fa 0%, var(--chart-2) 100%);
}

.turnover-bar-high {
    background: linear-gradient(180deg, var(--brand-red-400) 0%, var(--brand-red-500) 100%);
}

.turnover-bar-unrated {
    background: linear-gradient(180deg, var(--gray-300) 0%, var(--gray-400) 100%);
}

.turnover-bar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.75rem;
    justify-content: center;
}

.turnover-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.turnover-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.turnover-dot-low { background: var(--brand-green-500); }
.turnover-dot-solid { background: var(--chart-2); }
.turnover-dot-high { background: var(--brand-red-500); }
.turnover-dot-unrated { background: var(--gray-400); }

.turnover-legend-empty {
    opacity: 0.4;
}

.turnover-popup-list {
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
}

.turnover-list-header {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.75rem;
}

/* Manager Popup Summary Stats */
.turnover-manager-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.turnover-manager-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.turnover-manager-stat-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}

.turnover-manager-stat-value.turnover-rate-high {
    color: var(--danger);
}

.turnover-manager-stat-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 0.15rem;
}

/* ══════════════════════════════════════════════════════════════════════════════
   TURNOVER CARD — Card Hierarchy Design System
   ══════════════════════════════════════════════════════════════════════════════ */

/* Header flag badge */
.card-flag-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    background: var(--brand-indigo-100);
    border: 1px solid var(--brand-indigo-300);
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-700);
    margin-left: 0.5rem;
}

/* L1 Metric RAG colors for turnover */
.card-metric-value.turnover-good { color: var(--brand-green-600); }
.card-metric-value.turnover-moderate { color: var(--brand-amber-600); }
.card-metric-value.turnover-high { color: var(--danger); }

@media (max-width: 768px) {
    .turnover-manager-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Turnover Quality Methodology Modal */
.methodology-content {
    font-size: var(--text-body);
    line-height: 1.6;
    color: var(--gray-700);
}

.methodology-current-score {
    text-align: center;
    padding: 1.25rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.methodology-score-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    line-height: 1;
}

.methodology-score-value.composite-good {
    color: var(--success);
}

.methodology-score-value.composite-neutral {
    color: var(--brand-amber-600);
}

.methodology-score-value.composite-poor {
    color: var(--danger);
}

.methodology-score-label {
    font-size: var(--text-body);
    color: var(--gray-600);
    margin-top: 0.5rem;
}

.methodology-section {
    margin-bottom: 1.25rem;
}

.methodology-section h4 {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--gray-200);
}

.methodology-section p {
    margin: 0 0 0.5rem 0;
}

.methodology-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
    margin: 0.5rem 0;
}

.methodology-table th,
.methodology-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border: 1px solid var(--gray-200);
}

.methodology-table th {
    background: var(--gray-100);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.methodology-table td {
    background: white;
    vertical-align: top;
}

.methodology-table-compact {
    width: auto;
}

.methodology-table-compact td:first-child {
    font-weight: var(--font-medium);
    white-space: nowrap;
}

.methodology-table-compact td:last-child {
    text-align: right;
    font-family: monospace;
}

.methodology-note {
    font-size: var(--text-sm);
    color: var(--gray-500);
    font-style: italic;
    margin-top: 0.5rem;
}

.methodology-thresholds {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.methodology-threshold {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: var(--text-body);
}

.methodology-threshold .threshold-range {
    font-weight: var(--font-bold);
    min-width: 60px;
}

.methodology-threshold .threshold-label {
    color: var(--gray-700);
}

.methodology-threshold.threshold-good {
    background: var(--success-lighter);
    border-left: 3px solid var(--success);
}

.methodology-threshold.threshold-good .threshold-range {
    color: var(--success);
}

.methodology-threshold.threshold-neutral {
    background: var(--brand-amber-50);
    border-left: 3px solid var(--brand-amber-500);
}

.methodology-threshold.threshold-neutral .threshold-range {
    color: var(--brand-amber-600);
}

.methodology-threshold.threshold-poor {
    background: var(--danger-lighter);
    border-left: 3px solid var(--danger);
}

.methodology-threshold.threshold-poor .threshold-range {
    color: var(--danger);
}

.methodology-formula {
    background: var(--gray-800);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-family: monospace;
    font-size: var(--text-sm);
}

.methodology-formula code {
    display: block;
    color: var(--brand-teal-300);
    margin: 0.25rem 0;
}

/* Turnover Cost Configuration Form */
.turnover-cost-config {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.turnover-cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.turnover-cost-band {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.turnover-cost-band-name {
    font-weight: var(--font-semibold);
    font-size: var(--text-body);
    color: var(--gray-800);
}

.turnover-cost-band-grades {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.turnover-cost-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.turnover-cost-input {
    width: 70px;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: var(--text-body);
    text-align: center;
    font-weight: var(--font-semibold);
}

.turnover-cost-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.turnover-cost-suffix {
    font-size: var(--text-body);
    color: var(--gray-500);
    white-space: nowrap;
}

.turnover-cost-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--brand-amber-50);
    border: 1px solid var(--brand-amber-200);
    border-radius: var(--radius);
    font-size: var(--text-body);
    color: var(--brand-amber-800);
}

.turnover-cost-note svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
    stroke: var(--brand-amber-600);
}

/* Turnover Cost Display on Cards */
.turnover-cost-summary-card {
    background: linear-gradient(135deg, var(--brand-red-50) 0%, var(--brand-pink-50) 100%);
    border: 1px solid var(--brand-red-200);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    text-align: center;
}

.turnover-cost-summary-card .value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--brand-red-600);
    line-height: 1.2;
}

.turnover-cost-summary-card .label {
    font-size: var(--text-body);
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.turnover-cost-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--brand-amber-50);
    border: 1px solid var(--brand-amber-200);
    border-radius: var(--radius);
    margin-top: 1rem;
    font-size: var(--text-body);
    color: var(--brand-amber-800);
}

.turnover-cost-warning svg {
    flex-shrink: 0;
    stroke: var(--brand-amber-600);
}

.turnover-cost-warning a {
    color: var(--primary);
    text-decoration: underline;
}

/* Retirement Analysis Card */
.retirement-analysis-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    overflow: visible;
}

.retirement-card-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 150ms ease;
}

.retirement-card-header.collapsed {
    border-radius: 0;
}

.retirement-card-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.retirement-card-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.retirement-age-note {
    font-size: var(--text-sm);
    color: var(--brand-indigo-500);
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.retirement-card-body {
    padding: 1.25rem;
}

.retirement-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.retirement-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.retirement-tab:hover {
    border-color: var(--brand-indigo-500);
    background: var(--brand-indigo-50);
}

.retirement-tab.has-data {
    border-color: var(--brand-indigo-500);
    background: var(--brand-indigo-50);
}

.retirement-tab.has-data:hover {
    background: var(--brand-indigo-100);
}

.retirement-tab-count {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--gray-400);
    line-height: 1;
}

.retirement-tab.has-data .retirement-tab-count {
    color: var(--primary);
}

.retirement-tab-label {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-top: 0.5rem;
}

.retirement-tab-year {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Retirement Department Impact Cards */
.retirement-dept-section {
    margin-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
}

.retirement-dept-heading {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: var(--brand-indigo-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.retirement-dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

.retirement-dept-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.85rem 0.75rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    background: white;
}
.retirement-dept-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.retirement-dept-card.active {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Impact: Critical — red */
.retirement-dept-card.impact-critical { background: var(--danger-lighter); border-color: var(--brand-red-300); }
.retirement-dept-card.impact-critical .retirement-dept-card-count { color: var(--danger); }
.retirement-dept-card.impact-critical.active { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2); }

/* Impact: High — orange */
.retirement-dept-card.impact-high { background: var(--brand-amber-50); border-color: var(--brand-amber-300); }
.retirement-dept-card.impact-high .retirement-dept-card-count { color: var(--brand-amber-600); }
.retirement-dept-card.impact-high.active { border-color: var(--brand-amber-600); box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.2); }

/* Impact: Moderate — amber */
.retirement-dept-card.impact-moderate { background: var(--warning-lighter); border-color: var(--brand-amber-200); }
.retirement-dept-card.impact-moderate .retirement-dept-card-count { color: var(--brand-amber-600); }
.retirement-dept-card.impact-moderate.active { border-color: var(--brand-amber-600); box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2); }

/* Impact: Low — green */
.retirement-dept-card.impact-low { background: var(--brand-green-50); border-color: var(--brand-green-200); }
.retirement-dept-card.impact-low .retirement-dept-card-count { color: var(--brand-green-600); }
.retirement-dept-card.impact-low.active { border-color: var(--brand-green-600); box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2); }

.retirement-dept-card-count {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    line-height: 1;
}

.retirement-dept-card-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-top: 0.35rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.retirement-dept-card-meta {
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-top: 0.25rem;
    white-space: nowrap;
}

.retirement-dept-card-urgent {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--danger);
    margin-top: 0.25rem;
    background: var(--danger-light);
    padding: 1px 6px;
    border-radius: 8px;
}

/* Retirement Department Detail Panel */
.retirement-dept-detail {
    margin-top: 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    animation: retirementDeptSlideIn 0.2s ease;
}

.retirement-dept-detail.hidden {
    display: none;
}

@keyframes retirementDeptSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.retirement-dept-detail-header {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: #f0f4ff;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.retirement-dept-detail-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    color: #1e1b4b;
}

.retirement-dept-detail-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    background: var(--brand-indigo-200);
    color: var(--brand-indigo-800);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.retirement-dept-detail-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: var(--text-lg);
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.2rem;
    line-height: 1;
}

.retirement-dept-detail-close:hover {
    color: var(--gray-700);
}

.retirement-dept-detail-list {
    padding: 0;
}

.retirement-dept-detail-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 0.5fr 0.75fr;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    font-size: var(--text-body);
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
    align-items: center;
}

.retirement-dept-detail-row:last-child {
    border-bottom: none;
}

.retirement-dept-detail-row-header {
    background: var(--gray-50);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rddr-name strong {
    display: block;
    font-size: var(--text-body);
    color: var(--gray-800);
}

.rddr-name small {
    font-size: var(--text-xs);
    color: var(--gray-400);
}

.rddr-age, .rddr-year {
    text-align: center;
    font-weight: var(--font-semibold);
}

.rddr-year {
    color: var(--brand-indigo-500);
}

/* Retirement Modal Styles */
.retirement-list-header {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 0.5fr 1fr;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--gray-100);
    border-radius: var(--radius) var(--radius) 0 0;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.retirement-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
}

.retirement-list-item {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 0.5fr 1fr;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: var(--text-body);
    align-items: center;
}

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

.retirement-list-item:hover {
    background: var(--gray-50);
}

.retirement-list-item .col-name strong {
    display: block;
    color: var(--gray-800);
}

.retirement-list-item .col-name small {
    color: var(--gray-500);
    font-size: var(--text-sm);
}

.retirement-list-item .col-age {
    text-align: center;
}

.retirement-list-item .col-retirement {
    font-weight: var(--font-semibold);
    color: var(--primary);
}

.retirement-list-footer {
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: var(--text-body);
    color: var(--gray-600);
    font-weight: var(--font-medium);
}

/* ══════════════════════════════════════════════════════════════════════════════
   RETIREMENT TIMELINE DIAGRAM
   ══════════════════════════════════════════════════════════════════════════════ */

.retirement-timeline-container {
    position: relative;
    padding: 4rem 2rem 1rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    min-height: 180px;
    overflow: visible;
}

.retirement-timeline-track {
    position: absolute;
    left: 2rem;
    right: 2rem;
    bottom: 60px;
    height: 2px;
}

.retirement-timeline-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gray-300), var(--gray-400), var(--gray-300));
    border-radius: 1px;
}

.retirement-timeline-year {
    position: absolute;
    transform: translateX(-50%);
    top: -4px;
}

.retirement-timeline-year-line {
    width: 2px;
    height: 12px;
    background: var(--gray-400);
    margin: 0 auto;
    border-radius: 1px;
}

.retirement-timeline-year.active .retirement-timeline-year-line {
    background: var(--primary-600);
    height: 16px;
}

.retirement-timeline-year-label {
    display: block;
    margin-top: 6px;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-align: center;
}

.retirement-timeline-year.active .retirement-timeline-year-label {
    color: var(--primary-700);
    font-weight: var(--font-bold);
}

.retirement-timeline-now {
    position: absolute;
    top: -28px;
    bottom: -60px;
    transform: translateX(-50%);
    z-index: 10;
}

.retirement-timeline-now span {
    display: block;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: var(--white);
    background: var(--brand-green-600);
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 2px 4px var(--brand-green-200);
}

.retirement-timeline-now::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 22px;
    bottom: 60px;
    transform: translateX(-50%);
    width: 2px;
    background: var(--brand-green-600);
    border-radius: 1px;
}

.retirement-timeline-dots {
    position: absolute;
    left: 2rem;
    right: 2rem;
    bottom: 60px;
    top: 1rem;
}

.retirement-timeline-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1;
}

.retirement-timeline-dot.highlighted {
    background: linear-gradient(135deg, var(--brand-indigo-500) 0%, var(--brand-indigo-700) 100%);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}

.retirement-timeline-dot.dimmed {
    background: var(--gray-300);
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    opacity: 0.6;
}

.retirement-timeline-dot:hover {
    transform: translateX(-50%) scale(1.3);
    z-index: 10;
}

.retirement-timeline-dot.highlighted:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.5);
}

.retirement-timeline-dot.dimmed:hover {
    opacity: 1;
    background: var(--gray-400);
}

.retirement-timeline-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: var(--white);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: var(--text-sm);
    /* Was `white-space: nowrap`, which let a long name+role escape the column
       entirely on a dot near either edge — the container is `overflow: visible`
       so nothing clipped it, it just hung outside the pane. Wrapping inside a
       sensible measure keeps it in bounds at any container width. */
    white-space: normal;
    width: max-content;
    max-width: 260px;
    text-align: center;
    pointer-events: none;
    z-index: 10001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.retirement-timeline-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--gray-900);
}

.retirement-timeline-dot:hover .retirement-timeline-tooltip {
    opacity: 1;
    visibility: visible;
}

.retirement-timeline-tooltip strong {
    display: block;
    font-weight: var(--font-semibold);
    margin-bottom: 2px;
    color: #fff;
}

.retirement-timeline-tooltip span {
    display: block;
    color: var(--gray-300);
    line-height: 1.4;
}

.retirement-timeline-tooltip .retirement-date {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--gray-700);
    color: #93c5fd;
    font-weight: var(--font-semibold);
}

.retirement-timeline-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
}

.retirement-timeline-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    color: var(--gray-600);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.legend-dot.highlighted {
    background: linear-gradient(135deg, var(--brand-indigo-500) 0%, var(--brand-indigo-700) 100%);
}

/* Horizon strip — coloured bands aligned to year columns under the timeline.
   Strip's horizontal margins match .retirement-timeline-container padding (2rem)
   so segments align with the year-axis. */
.retirement-timeline-horizons {
    display: flex;
    margin: 0.5rem 2rem 0;
    height: 28px;
    border-radius: 6px;
    overflow: hidden;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.retirement-timeline-horizon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.retirement-timeline-horizon-critical   { background: var(--verdict-bad);  flex: 0 0 33.333%; }
.retirement-timeline-horizon-planning   { background: var(--verdict-warn); flex: 0 0 16.667%; }
.retirement-timeline-horizon-monitoring { background: var(--verdict-good); flex: 0 0 50%; }

/* SPOF-flagged retirement dot (critical+high tier from SPOF analysis).
   Wins over .retirement-timeline-dot.highlighted via .is-spof specificity below. */
.retirement-timeline-dot.is-spof {
    background: var(--verdict-bad);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--verdict-bad), 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 2;
}
.retirement-timeline-dot.is-spof:hover {
    box-shadow: 0 0 0 3px var(--verdict-bad), 0 4px 10px rgba(0, 0, 0, 0.35);
}
.retirement-spof-flag {
    display: block;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 11px;
    font-weight: 600;
    color: var(--brand-red-200);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.retirement-spof-legend {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--gray-300);
    font-size: var(--text-sm);
    color: var(--gray-700);
}
.retirement-spof-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--verdict-bad);
    border: 1.5px solid white;
    box-shadow: 0 0 0 1px var(--verdict-bad);
}

.legend-dot.dimmed {
    background: var(--gray-300);
    opacity: 0.6;
}

.retirement-timeline-summary {
    text-align: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-600);
}

@media (max-width: 768px) {
    .retirement-tabs {
        grid-template-columns: repeat(2, 1fr);
    }

    .retirement-list-header,
    .retirement-list-item {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .retirement-list-header .col-department,
    .retirement-list-header .col-position,
    .retirement-list-item .col-department,
    .retirement-list-item .col-position {
        display: none;
    }
}

/* Attrition 5-column layout (repeat role detail) */
.attrition-5col {
    grid-template-columns: 2fr 1.5fr 0.6fr 0.7fr 0.8fr !important;
}
/* Attrition 6-column layout (with compa ratio) */
.attrition-6col {
    grid-template-columns: 2fr 1.5fr 1.2fr 0.5fr 0.7fr 0.8fr !important;
}
/* Attrition 7-column layout (with manager + compa ratio) */
.attrition-7col {
    grid-template-columns: 1.8fr 1.3fr 1fr 1fr 0.5fr 0.6fr 0.7fr !important;
}

/* Repeat role summary stats in popup */
.repeat-role-summary-stats {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 0 1rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}
.repeat-role-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}
.repeat-role-stat-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}
.repeat-role-stat-value.rate-critical {
    color: var(--danger);
}
.repeat-role-stat-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.col-compa {
    text-align: center;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
}
.col-compa.compa-low {
    color: var(--primary);
}
.col-compa.compa-normal {
    color: var(--gray-600);
}
.col-compa.compa-high {
    color: var(--brand-amber-700);
}
.col-manager {
    font-size: var(--text-body);
    color: var(--gray-600);
}

@media (max-width: 768px) {
    .attrition-5col {
        grid-template-columns: 1fr 1fr !important;
    }
    .attrition-5col .col-compa,
    .attrition-5col .col-department {
        display: none;
    }
    .attrition-6col {
        grid-template-columns: 1fr 1fr !important;
    }
    .attrition-6col .col-compa,
    .attrition-6col .col-department,
    .attrition-6col .col-position {
        display: none;
    }
    .attrition-7col {
        grid-template-columns: 1fr 1fr !important;
    }
    .attrition-7col .col-compa,
    .attrition-7col .col-manager,
    .attrition-7col .col-department,
    .attrition-7col .col-position {
        display: none;
    }
    .repeat-role-summary-stats {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

/* Early Attrition Card */
.early-attrition-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    overflow: hidden;
}

.early-attrition-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 150ms ease;
}

.early-attrition-header.collapsed {
    border-radius: 0;
}

.early-attrition-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.early-attrition-total {
    font-size: var(--text-sm);
    color: var(--danger);
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: var(--font-medium);
}

.early-attrition-body {
    padding: 1.25rem;
}

.attrition-tabs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.attrition-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.attrition-tab:hover {
    border-color: var(--brand-red-400);
    background: var(--danger-lighter);
}

.attrition-tab.has-data {
    border-color: var(--brand-red-400);
    background: var(--danger-lighter);
}

.attrition-tab.has-data:hover {
    background: var(--danger-light);
}

.attrition-tab-count {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--gray-400);
    line-height: 1;
}

.attrition-tab.has-data .attrition-tab-count {
    color: var(--danger);
}

.attrition-tab-label {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-top: 0.5rem;
    text-align: center;
}

/* Expand Section */
/* Attrition timeline diagram */
.attrition-timeline-diagram {
    margin: 1.25rem 0 0.5rem;
    text-align: center;
}
.attrition-timeline-svg {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: var(--white);
    padding: 0.5rem;
}

.attrition-departments-panel {
    margin-top: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.attrition-departments-panel.hidden {
    display: none;
}

.department-attrition-list {
    max-height: 300px;
    overflow-y: auto;
}

.department-attrition-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.15s;
}

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

.department-attrition-item:hover {
    background: var(--danger-lighter);
}

.dept-rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-200);
    border-radius: 50%;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
}

.department-attrition-item:nth-child(1) .dept-rank {
    background: var(--danger);
    color: white;
}

.department-attrition-item:nth-child(2) .dept-rank {
    background: var(--brand-red-400);
    color: white;
}

.department-attrition-item:nth-child(3) .dept-rank {
    background: var(--brand-red-300);
    color: var(--brand-red-800);
}

.dept-name {
    flex: 1;
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-800);
}

.dept-count {
    font-size: var(--text-body);
    color: var(--danger);
    font-weight: var(--font-semibold);
}

.dept-arrow {
    color: var(--gray-400);
}

.no-attrition-data {
    padding: 1.5rem;
    text-align: center;
    color: var(--gray-500);
    font-size: var(--text-body);
}

@media (max-width: 900px) {
    .attrition-tabs {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .attrition-tabs {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Attrition compa-ratio summary box */
.attrition-compa-box {
    cursor: pointer;
    border-color: var(--gray-200) !important;
    background: var(--gray-50) !important;
}
.attrition-compa-box.has-data {
    border-color: var(--primary) !important;
    background: #eff6ff !important;
}
.attrition-compa-box.has-data:hover {
    background: #dbeafe !important;
}
.attrition-compa-box .attrition-tab-count {
    color: var(--gray-400);
}
.attrition-compa-box.has-data .attrition-tab-count {
    color: var(--primary);
}
.attrition-compa-detail {
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-top: 0.15rem;
}

.attrition-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

/* Attrition Recommendation Button & Panel */
/* ============================
   Insights buttons — canonical 3-tier pattern
   See docs/ui-elements.md § Insights buttons for the full spec.
   ============================ */
.insights-btn {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    color: var(--gray-700);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 0.4rem 0.7rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    white-space: nowrap;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.insights-btn:hover {
    background: var(--gray-50);
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.insights-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.insights-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.insights-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.insights-btn--card {
    /* default sizing — no overrides */
}
.insights-btn--lens {
    width: 28px;
    height: 28px;
    padding: 0;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}
.insights-btn--item {
    font-size: 11px;
    padding: 0.3rem 0.55rem;
    border-radius: 5px;
}
.insights-btn--item svg {
    width: 12px;
    height: 12px;
}

/* Legacy aliases — same visual treatment as .insights-btn--card so existing
   markup keeps working until callsites migrate. Do not introduce new uses. */
.attrition-recommendation-btn {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    color: var(--gray-700);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 0.4rem 0.7rem;
    margin-left: auto;
    flex-shrink: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.attrition-recommendation-btn:hover {
    background: var(--gray-50);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.attrition-rec-content {
    padding: 0.5rem 0;
}

/* Threshold Scale Visualization */
.attrition-rec-thresholds {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.threshold-scale-container {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    /* Was `overflow: hidden`, which clipped the floating value pill. The pill is
       positioned by percentage and is `white-space: nowrap`, so in a ~390px drawer any
       marker past roughly 70% pushed it past the edge and it was silently cut off. The
       edge-clamp bands in buildThresholdScale were widened to <20 / >80 to match. */
    overflow: visible;
}

.threshold-scale-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.threshold-scale-bar-wrapper {
    position: relative;
    padding-top: 1.75rem;
}

.threshold-value-label {
    position: absolute;
    top: 0;
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.threshold-value-label.threshold-green {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.threshold-value-label.threshold-amber {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.threshold-value-label.threshold-red {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.threshold-scale-label {
    font-size: var(--text-sm);
    color: #64748b;
    font-weight: var(--font-medium);
}

.threshold-scale-value {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
}

.threshold-scale-value.threshold-green {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.threshold-scale-value.threshold-amber {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.threshold-scale-value.threshold-red {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.threshold-scale-bar {
    position: relative;
    height: 12px;
    border-radius: 6px;
    overflow: visible;
    background: var(--gray-200);
}

.threshold-zone {
    position: absolute;
    top: 0;
    height: 100%;
}

.threshold-zone:first-child {
    border-radius: 6px 0 0 6px;
}

.threshold-zone:nth-child(3) {
    border-radius: 0 6px 6px 0;
}

.threshold-zone.threshold-green {
    background: #22c55e;
}

.threshold-zone.threshold-amber {
    background: #f59e0b;
}

.threshold-zone.threshold-red {
    background: #ef4444;
}

.threshold-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 3px solid #1f2937;
    border-radius: 50%;
    z-index: 10;
}

.threshold-marker.marker-green {
    background: #22c55e;
}

.threshold-marker.marker-amber {
    background: #f59e0b;
}

.threshold-marker.marker-red {
    background: #ef4444;
}

.threshold-scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.threshold-label-item {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    text-transform: uppercase;
}

.threshold-label-item.threshold-green-text {
    color: #16a34a;
}

.threshold-label-item.threshold-amber-text {
    color: #d97706;
}

.threshold-label-item.threshold-red-text {
    color: #dc2626;
}

.threshold-scale-axis {
    position: relative;
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.25rem;
    height: 1rem;
}

.threshold-axis-min {
    position: absolute;
    left: 0;
}

.threshold-axis-max {
    position: absolute;
    right: 0;
}

.threshold-axis-mark {
    position: absolute;
    transform: translateX(-50%);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
}

.threshold-scale-legend {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.threshold-legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--text-xs);
    color: var(--gray-700);
}

.threshold-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.threshold-legend-dot.threshold-green {
    background: #22c55e;
}

.threshold-legend-dot.threshold-amber {
    background: #f59e0b;
}

.threshold-legend-dot.threshold-red {
    background: #ef4444;
}

.threshold-legend-marker {
    width: 10px;
    height: 10px;
    border: 2px solid #1f2937;
    border-radius: 50%;
    flex-shrink: 0;
}

.threshold-legend-marker.marker-green {
    background: #22c55e;
}

.threshold-legend-marker.marker-amber {
    background: #f59e0b;
}

.threshold-legend-marker.marker-red {
    background: #ef4444;
}

.threshold-legend-direction {
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-style: italic;
    margin-top: 0.5rem;
    text-align: right;
}

/* Team Salary Distribution Chart (Manager Inversions) */
.team-salary-chart {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.team-salary-chart-header {
    margin-bottom: 0.75rem;
}

.team-salary-chart-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.team-salary-chart-track {
    position: relative;
    height: 40px;
    margin: 0.5rem 0;
}

.team-salary-track-bar {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    transform: translateY(-50%);
}

.team-salary-dot {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 5;
    transition: transform 0.15s ease;
}

.team-salary-dot:hover {
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 8;
}

.team-salary-dot.below-manager {
    background: #22c55e;
    border: 2px solid #16a34a;
}

.team-salary-dot.above-manager {
    background: #ef4444;
    border: 2px solid #dc2626;
}

.team-salary-manager-line {
    position: absolute;
    top: 0;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 6;
}

.team-salary-manager-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 14px solid #1f2937;
}

.team-salary-chart-labels {
    position: relative;
    font-size: var(--text-xs);
    color: var(--gray-600);
    margin-top: 0.25rem;
    height: 2.5rem;
}

.team-salary-label-min,
.team-salary-label-max {
    position: absolute;
    transform: translateX(-50%);
    font-weight: var(--font-medium);
    text-align: center;
    color: var(--gray-600);
}

.team-salary-label-manager {
    position: absolute;
    transform: translateX(-50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.team-salary-manager-value {
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.team-salary-manager-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
}

.team-salary-chart-legend {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

.team-salary-legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--text-xs);
    color: var(--gray-600);
}

.team-salary-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.team-salary-legend-dot.below-manager {
    background: #22c55e;
    border: 1px solid #16a34a;
}

.team-salary-legend-dot.above-manager {
    background: #ef4444;
    border: 1px solid #dc2626;
}

.team-salary-legend-marker {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #1f2937;
    flex-shrink: 0;
}

.team-salary-chart-empty {
    text-align: center;
    color: var(--gray-400);
    font-size: var(--text-body);
    padding: 1rem;
}

/* Manager Inversion Cards */
.manager-inversion-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Manager Inversion Modal */
.manager-inversion-modal-content {
    min-width: 500px;
}

.manager-inversion-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.manager-inversion-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

.manager-inversion-info p {
    margin: 0;
    font-size: var(--text-body);
    color: var(--gray-600);
}

.manager-inversion-info .manager-dept {
    color: var(--gray-500);
    font-size: var(--text-body);
    margin-top: 0.25rem;
}

.manager-inversion-stats {
    display: flex;
    gap: 1rem;
}

.manager-stat {
    text-align: center;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    min-width: 80px;
}

.manager-stat.warning {
    background: #fef2f2;
}

.manager-stat-value {
    display: block;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

.manager-stat.warning .manager-stat-value {
    color: #dc2626;
}

.manager-stat-label {
    display: block;
    font-size: var(--text-xs);
    text-transform: uppercase;
    color: var(--gray-500);
    margin-top: 0.125rem;
}

/* Insights intro section */
.attrition-rec-intro {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #334155;
}

.attrition-rec-intro-text {
    font-size: var(--text-body);
    color: #64748b;
    line-height: 1.5;
}

/* Percentile Explainer (collapsible) */
.percentile-explainer {
    margin-top: 0.75rem;
}

.percentile-explainer-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--primary-color);
    user-select: none;
}

.percentile-explainer-toggle:hover {
    text-decoration: underline;
}

.percentile-explainer-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.percentile-explainer.expanded .percentile-explainer-chevron {
    transform: rotate(180deg);
}

.percentile-explainer-body {
    display: none;
    margin-top: 0.75rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.percentile-explainer.expanded .percentile-explainer-body {
    display: block;
}

.percentile-explainer-intro {
    font-size: var(--text-body);
    color: var(--gray-600);
    margin: 0 0 0.75rem 0;
}

.percentile-explainer-bar {
    display: flex;
    height: 28px;
    border-radius: 14px;
    overflow: hidden;
}

.percentile-explainer-zone {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.percentile-explainer-zone span {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
}

.percentile-explainer-zone.zone-green { background: #22c55e; }
.percentile-explainer-zone.zone-light-green { background: #86efac; }
.percentile-explainer-zone.zone-light-green span { color: #166534; text-shadow: none; }
.percentile-explainer-zone.zone-amber { background: #fbbf24; }
.percentile-explainer-zone.zone-amber span { color: #92400e; text-shadow: none; }
.percentile-explainer-zone.zone-red { background: #ef4444; }

.percentile-explainer-markers {
    position: relative;
    height: 20px;
    margin-top: 2px;
}

.percentile-explainer-markers span {
    position: absolute;
    transform: translateX(-50%);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
}

.percentile-explainer-definitions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.percentile-explainer-def {
    font-size: var(--text-body);
    color: var(--gray-700);
    line-height: 1.4;
}

.percentile-explainer-def strong {
    color: var(--gray-900);
}

.percentile-explainer-direction {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #eff6ff;
    border-left: 3px solid var(--primary-color);
    border-radius: 0 6px 6px 0;
    font-size: var(--text-body);
    color: var(--gray-700);
}

/* Insights section dividers */
.insights-section {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.insights-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.insights-section > strong {
    display: block;
    font-size: var(--text-body);
    color: var(--brand-indigo-700);
    margin-bottom: 0.25rem;
}

.insights-section ul {
    margin: 0;
    padding-left: 1.25rem;
}

.insights-section li {
    font-size: var(--text-body);
    color: var(--gray-700);
    line-height: 1.5;
    margin-bottom: 0.15rem;
}

.attrition-rec-heading {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: #334155;
    margin-bottom: 0.5rem;
}

.attrition-rec-methodology {
    margin-bottom: 1rem;
    border-bottom: 1px solid #334155;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border-radius: 6px;
    border-left: 3px solid #334155;
    overflow: hidden;
}
.attrition-rec-methodology-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: #334155;
    user-select: none;
    transition: background 0.15s ease;
}
.attrition-rec-methodology-header:hover {
    background: rgba(51, 65, 85, 0.08);
}
.attrition-rec-methodology-header svg {
    flex-shrink: 0;
}
.methodology-chevron {
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}
.attrition-rec-methodology.collapsed .methodology-chevron {
    transform: rotate(-90deg);
}
.attrition-rec-methodology-text {
    font-size: var(--text-body);
    color: #64748b;
    line-height: 1.65;
    margin: 0;
    padding: 0 0.75rem 0.75rem 0.75rem;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.2s ease;
    opacity: 1;
}
.attrition-rec-methodology.collapsed .attrition-rec-methodology-text {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}
.attrition-rec-methodology-text code {
    background: var(--brand-indigo-100);
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--brand-indigo-700);
}
.attrition-rec-methodology ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
}
.attrition-rec-methodology li {
    margin-bottom: 0.25rem;
}

.attrition-rec-summary {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #334155;
}
.attrition-rec-summary-text {
    font-size: var(--text-body);
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

.attrition-rec-summary ul {
    margin: 0.4rem 0 0.6rem 0;
    padding-left: 1.25rem;
    font-size: var(--text-body);
    color: #64748b;
    line-height: 1.6;
}

.attrition-rec-summary li {
    margin-bottom: 0.2rem;
}

.attrition-rec-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.attrition-rec-item {
    background: white;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 0.7rem 0.9rem;
}
.attrition-rec-item-title {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: #334155;
    margin-bottom: 0.3rem;
}
.attrition-rec-item-text {
    font-size: var(--text-body);
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

.attrition-rec-item ul {
    margin: 0.4rem 0 0 0;
    padding-left: 1.25rem;
    font-size: var(--text-body);
    color: #64748b;
    line-height: 1.6;
}

.attrition-rec-item li {
    margin-bottom: 0.2rem;
}

/* Gender Analysis Card */
.gender-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1.25rem;
}

.gender-card-header,
.turnover-card-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 150ms ease;
}

.gender-card-header.collapsed,
.turnover-card-header.collapsed {
    border-radius: 0;
}

.gender-card-header:hover,
.turnover-card-header:hover,
.early-attrition-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.gender-card-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.gender-flag-count {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    background: white;
    color: var(--danger);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.gender-card-body {
    padding: 1.25rem;
}

/* Overall summary row */
.gender-summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.gender-summary-stat {
    text-align: center;
    padding: 0.75rem;
    border-radius: var(--radius);
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
}

.gender-summary-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    line-height: 1.2;
}
.gender-summary-value.gender-male { color: var(--gender-male); }
.gender-summary-value.gender-female { color: var(--gender-female); }
.gender-summary-value.gender-other { color: var(--gray-500); }

.gender-summary-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    margin-top: 0.15rem;
}

.gender-summary-pct {
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-top: 0.1rem;
}

/* Overall bar with target zone */
.gender-overall-bar-wrapper {
    margin-bottom: 1rem;
}

.gender-overall-bar-container {
    position: relative;
    height: 24px;
    background: var(--gray-100);
    border-radius: 6px;
    overflow: visible;
}

.gender-overall-bar-zone {
    position: absolute;
    left: 40%;
    width: 20%;
    height: 100%;
    background: rgba(34, 197, 94, 0.15);
    border-left: 2px dashed #22c55e;
    border-right: 2px dashed #22c55e;
    z-index: 1;
}

.gender-overall-bar-marker {
    position: absolute;
    top: -4px;
    width: 0;
    height: calc(100% + 8px);
    border-left: 2px dashed var(--gray-400);
    z-index: 2;
}

.gender-overall-bar {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    display: flex;
    height: 16px;
    border-radius: 4px;
    overflow: hidden;
    z-index: 3;
}

.gender-overall-bar-indicator {
    position: absolute;
    top: -2px;
    width: 3px;
    height: calc(100% + 4px);
    background: var(--gray-800);
    border-radius: 2px;
    z-index: 4;
    transform: translateX(-50%);
}

.gender-overall-bar-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.35rem;
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.gender-overall-label-target {
    color: #16a34a;
    font-weight: var(--font-medium);
}

.gender-bar-seg { height: 100%; min-width: 2px; }
.gender-bar-male { background: var(--gender-male); }
.gender-bar-female { background: var(--gender-female); }
.gender-bar-other { background: var(--gray-400); }
.gender-bar-seg:first-child { border-radius: 4px 0 0 4px; }
.gender-bar-seg:last-child { border-radius: 0 4px 4px 0; }
.gender-bar-seg:only-child { border-radius: 4px; }

/* Legend */
.gender-legend {
    display: flex;
    justify-content: center;
    gap: 0.75rem 1.25rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot.gender-poor-dot { background: var(--brand-red-500); }
.legend-dot.gender-moderate-dot { background: var(--warning); }
.legend-dot.gender-good-dot { background: var(--brand-green-500); }

/* Flat legend dots (no gradient/shadow) */
.legend-dot-flat {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.legend-dot-flat.status-green { background: #22c55e; }
.legend-dot-flat.status-amber { background: #f59e0b; }
.legend-dot-flat.status-red { background: #ef4444; }

/* Department grid */
.gender-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
}

.gender-cell {
    position: relative;
    border-radius: var(--radius);
    padding: 0.85rem 0.75rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 2px solid transparent;
}
.gender-cell:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.gender-cell.active {
    border-color: #581c87;
    box-shadow: 0 0 0 2px rgba(88, 28, 135, 0.2);
}

.gender-cell.gender-poor {
    background: var(--danger-lighter);
    border-color: var(--brand-red-300);
}
.gender-cell.gender-moderate {
    background: var(--warning-lighter);
    border-color: var(--brand-amber-200);
}
.gender-cell.gender-good {
    background: var(--brand-green-50);
    border-color: var(--brand-green-200);
}

.gender-cell.active.gender-poor { border-color: var(--danger); }
.gender-cell.active.gender-moderate { border-color: var(--brand-amber-600); }
.gender-cell.active.gender-good { border-color: var(--brand-green-600); }

.gender-cell-flagged::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
}

.gender-cell-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.gender-cell-score {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    line-height: 1;
}
.gender-cell.gender-poor .gender-cell-score { color: var(--danger); }
.gender-cell.gender-moderate .gender-cell-score { color: var(--brand-amber-600); }
.gender-cell.gender-good .gender-cell-score { color: var(--brand-green-600); }

.gender-cell-meta {
    font-size: var(--text-xs);
    color: var(--gray-400);
    white-space: nowrap;
}

.gender-cell-warn { display: none; }

/* Department card with status dot on left */
.gender-cell-with-dot {
    position: relative;
    border-radius: var(--radius);
    padding: 0.75rem;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
}
.gender-cell-with-dot:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: white;
}
.gender-cell-with-dot.active {
    border-color: #581c87;
    box-shadow: 0 0 0 2px rgba(88, 28, 135, 0.2);
}

.gender-cell-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.gender-cell-dot.status-green { background: #22c55e; }
.gender-cell-dot.status-amber { background: #f59e0b; }
.gender-cell-dot.status-red { background: #ef4444; }

.gender-cell-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}
.gender-cell-content .gender-cell-name {
    text-align: left;
}
.gender-cell-content .gender-cell-score {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--gray-700);
}
.gender-cell-content .gender-cell-meta {
    text-align: left;
}

/* Detail panel */
.gender-detail-popup .gender-detail-header {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.gender-detail-popup .gender-detail-bar-container {
    margin: 0.75rem 0 0;
}

.gender-detail-popup .diversity-nat-table {
    margin-top: 1rem;
}

.gender-detail-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}
.gender-detail-title strong {
    font-size: var(--text-body);
    color: var(--gray-800);
}

.gender-detail-sub {
    font-size: var(--text-sm);
    color: var(--gray-400);
}

.gender-dept-index {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
}
.gender-dept-index small {
    font-weight: var(--font-medium);
    font-size: var(--text-xs);
    opacity: 0.8;
    margin-left: 0.15rem;
}
.gender-dept-index.gender-poor { background: var(--danger-lighter); color: var(--danger); }
.gender-dept-index.gender-moderate { background: var(--warning-lighter); color: var(--brand-amber-600); }
.gender-dept-index.gender-good { background: var(--brand-green-50); color: var(--brand-green-600); }

.gender-detail-bar-container {
    display: flex;
    height: 10px;
    margin: 0.75rem 1rem 0;
    border-radius: 5px;
    overflow: hidden;
}

/* Enhanced stacked bar with target zone */
.gender-target-bar-wrapper {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.gender-target-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-bottom: 0.35rem;
    padding: 0 2px;
}

.gender-target-bar-container {
    position: relative;
    height: 32px;
    background: var(--gray-200);
    border-radius: 6px;
    overflow: visible;
}

/* Target zone (40-60% balanced zone) */
.gender-target-zone {
    position: absolute;
    top: -4px;
    bottom: -4px;
    background: var(--zone-target-fill);
    border-left: 2px dashed var(--brand-green-400);
    border-right: 2px dashed var(--brand-green-400);
    z-index: 1;
    pointer-events: none;
}

.gender-target-zone-label {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--brand-green-600);
    background: var(--brand-green-50);
    padding: 1px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

/* Zone boundary markers */
.gender-target-marker {
    position: absolute;
    top: 100%;
    transform: translateX(-50%);
    z-index: 2;
}

.gender-target-marker span {
    display: block;
    font-size: var(--text-xs);
    color: var(--brand-green-600);
    margin-top: 2px;
}

/* Center line (50%) */
.gender-target-center {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--gray-400);
    z-index: 1;
}

/* Stacked bar */
.gender-target-bar {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    z-index: 3;
}

.gender-target-bar-seg {
    height: 100%;
    transition: width 0.3s ease;
}

.gender-target-bar-seg.female {
    background: linear-gradient(90deg, var(--gender-female) 0%, var(--brand-indigo-400) 100%);
}

.gender-target-bar-seg.male {
    background: linear-gradient(90deg, var(--brand-teal-400) 0%, var(--gender-male) 100%);
}

.gender-target-bar-seg.other {
    background: var(--gray-400);
}

/* Position indicator */
.gender-target-indicator {
    position: absolute;
    top: -2px;
    bottom: -2px;
    transform: translateX(-50%);
    z-index: 4;
    pointer-events: none;
}

.gender-target-indicator-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-700);
    transform: translateX(-50%);
    border-radius: 1px;
}

.gender-target-indicator-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: var(--gray-700);
    background: var(--white);
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid var(--gray-300);
    white-space: nowrap;
}

/* Legend */
.gender-target-bar-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.75rem;
    flex-wrap: wrap;
}

.gender-target-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.gender-target-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.gender-target-legend-dot.female {
    background: linear-gradient(90deg, var(--gender-female) 0%, var(--brand-indigo-400) 100%);
}

.gender-target-legend-dot.male {
    background: linear-gradient(90deg, var(--brand-teal-400) 0%, var(--gender-male) 100%);
}

.gender-target-legend-dot.other {
    background: var(--gray-400);
}

/* Status badge */
.gender-target-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}

.gender-target-status.gender-good {
    background: var(--brand-green-50);
    color: var(--brand-green-700);
}

.gender-target-status.gender-moderate {
    background: var(--warning-lighter);
    color: var(--brand-amber-700);
}

.gender-target-status.gender-poor {
    background: var(--danger-lighter);
    color: var(--danger);
}

.gender-target-status-icon {
    font-size: var(--text-body);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .gender-target-bar-legend {
        gap: 0.5rem;
    }

    .gender-target-legend-item {
        font-size: var(--text-xs);
    }

    .gender-target-zone-label {
        display: none;
    }
}

@media (max-width: 768px) {
    .gender-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.4rem;
    }
    .gender-cell {
        padding: 0.65rem 0.5rem;
    }
    .gender-cell-name { font-size: var(--text-xs); }
    .gender-cell-score { font-size: var(--text-body); }
    .gender-summary-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Gender Population Pyramid */
.gender-pyramid-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
}

/* Gender by Grade - Horizontal Bars */
.gender-grade-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
}

.gender-grade-section .gender-section-title {
    margin-bottom: 0.75rem;
}


.gender-grade-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.gender-grade-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.gender-grade-legend-dot.female { background: var(--gender-female); }
.gender-grade-legend-dot.male { background: var(--gender-male); }

.gender-grade-legend-zone {
    width: 16px;
    height: 12px;
    background: rgba(34, 197, 94, 0.2);
    border: 1px dashed var(--brand-green-400);
    border-radius: 2px;
}

/* Container-relative, not viewport-relative. These bar rows are dense — name,
   40px track, target zone, two markers, two % labels and a status pill — so they
   need ~320px to stay legible. At full width that still yields the original 4-up;
   inside the split drill-in's evidence pane it folds to 2-up instead of crushing
   four cards into ~205px each, which the old repeat(4, 1fr) did because its only
   relief was viewport media queries that never fire when a *pane* narrows. */
.gender-grade-bars {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.75rem;
    justify-content: center;
}

/* Fewer than 4 grades — centre them rather than stretching each to full width */
.gender-grade-bars.grades-centered {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.gender-grade-bars.grades-centered .gender-grade-bar-row {
    flex: 0 1 320px;
    max-width: 420px;
}

/* Individual grade bar row (card in grid) */
.gender-grade-bar-row {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem;
}

.gender-grade-bar-row.grade-balanced {
    border-left: 3px solid var(--brand-green-500);
}

.gender-grade-bar-row.grade-warning {
    border-left: 3px solid var(--warning);
}

.gender-grade-bar-row.grade-poor {
    border-left: 3px solid var(--danger);
}

.gender-grade-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.gender-grade-bar-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.gender-grade-bar-count {
    font-size: var(--text-xs);
    color: var(--gray-400);
}



.gender-grade-bar-zone-labels {
    position: relative;
    height: 1rem;
    margin-bottom: 0.2rem;
    font-size: var(--text-xs);
    color: var(--brand-green-600);
    font-weight: var(--font-medium);
}

/* In card grid context, hide the top balanced label - it will be shown below the bar */





/* Target zone (40-60%) */

/* Zone boundary markers */

/* Center line (50%) */

/* Stacked bar track */





/* Position indicator */

/* Target label below bar (for card grid) */

/* Hide balanced label in modal/non-card contexts */

/* Labels below bar */



/* Status badge */
.gender-grade-bar-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
}

.gender-grade-bar-status.grade-balanced {
    color: var(--brand-green-600);
}

.gender-grade-bar-status.grade-warning {
    color: var(--brand-amber-600);
}

.gender-grade-bar-status.grade-poor {
    color: var(--danger);
}

.gender-grade-bar-status-icon {
    font-size: var(--text-body);
}

/* Column counts are handled by the auto-fill/minmax rules above — they respond to
   the container, which the viewport queries below could not. Only the type and
   spacing tweaks remain here. */
@media (max-width: 600px) {
    .gender-grade-bars.grades-centered {
        flex-direction: column;
        align-items: stretch;
    }

    .gender-grade-bars.grades-centered .gender-grade-bar-row {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .gender-grade-bar-row {
        padding: 0.6rem;
    }

    .gender-grade-bar-name {
        font-size: var(--text-sm);
    }




}

/* Legacy pyramid styles - keeping for reference */
.gender-pyramid-section h5 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gender-pyramid-container {
    position: relative;
    padding: 0.5rem 0;
}

.gender-pyramid-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
}

.gender-pyramid-header-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.gender-pyramid-header-label.female {
    text-align: right;
    color: var(--gender-female);
}

.gender-pyramid-header-label.male {
    text-align: left;
    color: var(--gender-male);
}

.gender-pyramid-header-label.grade {
    text-align: center;
    color: var(--gray-400);
}

/* Individual pyramid rows */
.gender-pyramid-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0.25rem;
    margin: 0.15rem 0;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    position: relative;
}

/* Center section with grade label and balance meter */
.gender-pyramid-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 100px;
}

/* Mini balance meter */
.gender-pyramid-meter {
    position: relative;
    width: 80px;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: visible;
}

.gender-pyramid-meter-zone {
    position: absolute;
    left: 40%;
    width: 20%;
    top: -1px;
    bottom: -1px;
    background: rgba(34, 197, 94, 0.25);
    border-radius: 2px;
}

.gender-pyramid-meter-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    border-radius: 3px;
    overflow: hidden;
}

.gender-pyramid-meter-fill {
    height: 100%;
}

.gender-pyramid-meter-fill.female {
    background: var(--gender-female);
}

.gender-pyramid-meter-fill.male {
    background: var(--gender-male);
}

.gender-pyramid-meter-fill.other {
    background: var(--gender-other);
}

.gender-pyramid-meter-marker {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 1px;
    background: var(--brand-green-500);
    transform: translateX(-50%);
}

/* Legend meter icon */
.gender-pyramid-legend-meter {
    width: 20px;
    height: 6px;
    background: linear-gradient(90deg, var(--gender-female) 0%, var(--gender-female) 40%, var(--brand-green-200) 40%, var(--brand-green-200) 60%, var(--gender-male) 60%, var(--gender-male) 100%);
    border-radius: 2px;
    border: 1px solid var(--gray-300);
}

.gender-pyramid-row:hover {
    background: var(--gray-50);
    transform: scale(1.01);
}

.gender-pyramid-row.pyramid-balanced:hover {
    background: var(--brand-green-50);
}

.gender-pyramid-row.pyramid-warning:hover {
    background: var(--warning-lighter);
}

.gender-pyramid-row.pyramid-poor:hover {
    background: var(--danger-lighter);
}

/* Bar containers */
.gender-pyramid-bar-container {
    display: flex;
    align-items: center;
    height: 24px;
    position: relative;
}

.gender-pyramid-bar-container.female {
    justify-content: flex-end;
    flex-direction: row;
}

.gender-pyramid-bar-container.male {
    justify-content: flex-start;
    flex-direction: row;
}

/* Bars */
.gender-pyramid-bar {
    height: 18px;
    border-radius: 3px;
    transition: width 0.3s ease;
    min-width: 2px;
}

.gender-pyramid-bar.female {
    background: linear-gradient(90deg, var(--gender-female) 0%, var(--brand-indigo-400) 100%);
    margin-left: auto;
}

.gender-pyramid-bar.male {
    background: linear-gradient(90deg, var(--brand-teal-400) 0%, var(--gender-male) 100%);
    margin-right: auto;
}

/* Percentage labels */
.gender-pyramid-pct {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    min-width: 32px;
    padding: 0 0.35rem;
}

.gender-pyramid-bar-container.female .gender-pyramid-pct {
    color: var(--gender-female);
    text-align: right;
    order: -1;
}

.gender-pyramid-bar-container.male .gender-pyramid-pct {
    color: var(--gender-male);
    text-align: left;
}

/* Grade label in center */
.gender-pyramid-grade {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    text-align: center;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius);
    background: var(--white);
    border: 1px solid var(--gray-200);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.gender-pyramid-count {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--gray-400);
    margin-left: 0.25rem;
}

/* Status indicators on rows */
.gender-pyramid-row.pyramid-balanced .gender-pyramid-grade {
    border-color: var(--brand-green-300);
    background: var(--brand-green-50);
}

.gender-pyramid-row.pyramid-warning .gender-pyramid-grade {
    border-color: var(--brand-amber-300);
    background: var(--warning-lighter);
}

.gender-pyramid-row.pyramid-poor .gender-pyramid-grade {
    border-color: var(--brand-red-300);
    background: var(--danger-lighter);
}

/* Status dot on grade label */
.gender-pyramid-status {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.pyramid-balanced .gender-pyramid-status { background: var(--brand-green-500); }
.pyramid-warning .gender-pyramid-status { background: var(--warning); }
.pyramid-poor .gender-pyramid-status { background: var(--danger); }

/* Grade detail popup (drilldown) - renders inside existing modal */
.gender-grade-detail-popup {
    /* Container for content inside modal body */
}

/* Responsive pyramid */
@media (max-width: 600px) {
    .gender-pyramid-row {
        grid-template-columns: 1fr 70px 1fr;
    }

    .gender-pyramid-center {
        min-width: 70px;
    }

    .gender-pyramid-grade {
        font-size: var(--text-xs);
        padding: 0.15rem 0.3rem;
        max-width: 70px;
    }

    .gender-pyramid-count {
        display: none;
    }

    .gender-pyramid-meter {
        width: 60px;
        height: 5px;
    }

    .gender-pyramid-pct {
        font-size: var(--text-xs);
        min-width: 28px;
    }

    .gender-pyramid-bar {
        height: 14px;
    }

    .gender-grade-stats {
        gap: 0.5rem;
    }

    .gender-grade-stat {
        padding: 0.4rem 0.5rem;
    }

    .gender-grade-stat-value {
        font-size: var(--text-body);
    }

    .gender-grade-emp-item {
        flex-wrap: wrap;
    }

    .gender-grade-emp-meta {
        max-width: 100%;
        font-size: var(--text-xs);
    }
}

/* Gender section title */
.gender-section-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin: 0 0 0.75rem 0;
}

/* Gender pyramid legend */
.gender-pyramid-legend {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.gender-pyramid-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.gender-pyramid-legend-bar {
    width: 16px;
    height: 8px;
    border-radius: 2px;
}

.gender-pyramid-legend-bar.female {
    background: linear-gradient(90deg, var(--gender-female) 0%, var(--brand-indigo-400) 100%);
}

.gender-pyramid-legend-bar.male {
    background: linear-gradient(90deg, var(--brand-teal-400) 0%, var(--gender-male) 100%);
}

/* Gender department section */
.gender-dept-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* Gender promotion section */
.gender-promotion-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.gender-promotion-cards {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.gender-promotion-cards .gender-summary-stat {
    flex: 1;
}

.gender-summary-stat.clickable {
    cursor: pointer;
    transition: all 0.15s ease;
}

.gender-summary-stat.clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.gender-promotion-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: var(--radius);
    background: var(--gray-50);
}

.gender-promotion-status.grade-balanced {
    color: var(--brand-green-600);
    background: var(--brand-green-50);
}

.gender-promotion-status.grade-warning {
    color: var(--brand-amber-600);
    background: var(--brand-amber-50);
}

.gender-promotion-status.grade-poor {
    color: var(--danger);
    background: var(--danger-lighter);
}

.promotion-total {
    font-weight: var(--font-normal);
    color: var(--gray-500);
}

/* Disproportionate warning for turnover */
.gender-disproportionate-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--brand-amber-50);
    border: 1px solid var(--brand-amber-200);
    border-radius: var(--radius);
    font-size: var(--text-body);
    color: var(--brand-amber-700);
}

.gender-disproportionate-icon {
    font-size: var(--text-base);
    flex-shrink: 0;
}

/* Promotion gender modal */
.promotion-gender-modal {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.promotion-gender-summary {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.promotion-gender-toggle {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.promotion-gender-toggle .btn {
    min-width: 120px;
}

.promotion-gender-breakdown {
    max-height: 400px;
    overflow-y: auto;
}

.promotion-gender-breakdown .gender-grade-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Gender grade drilldown popup - header stats */
.gender-grade-detail-popup .gender-grade-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.gender-grade-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.gender-grade-detail-popup .gender-grade-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(255,255,255,0.5);
    border-radius: var(--radius);
}

.gender-grade-detail-popup .gender-grade-stat-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-700);
}

.gender-grade-detail-popup .gender-grade-stat.female .gender-grade-stat-value { color: var(--gender-female); }
.gender-grade-detail-popup .gender-grade-stat.male .gender-grade-stat-value { color: var(--gender-male); }
.gender-grade-detail-popup .gender-grade-stat.other .gender-grade-stat-value { color: var(--gray-500); }

.gender-grade-detail-popup .gender-grade-stat-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    white-space: nowrap;
}

.gender-grade-status {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius);
}

.gender-grade-status.gender-good {
    background: var(--brand-green-100);
    color: var(--brand-green-700);
}

.gender-grade-status.gender-moderate {
    background: var(--warning-lighter);
    color: var(--brand-amber-700);
}

.gender-grade-status.gender-poor {
    background: var(--danger-lighter);
    color: var(--danger);
}

/* Employee sections in drilldown */
.gender-grade-emp-sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gender-grade-emp-section {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.gender-grade-emp-header {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    padding: 0.5rem 0.75rem;
    margin: 0;
    background: var(--gray-50);
}

.gender-grade-emp-header.female { color: var(--gender-female); border-left: 3px solid var(--gender-female); }
.gender-grade-emp-header.male { color: var(--gender-male); border-left: 3px solid var(--gender-male); }
.gender-grade-emp-header.other { color: var(--gray-600); border-left: 3px solid var(--gray-400); }

.gender-grade-emp-list {
    padding: 0.5rem 0;
}

.gender-grade-emp-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: var(--text-sm);
}

.gender-grade-emp-item:hover {
    background: var(--gray-50);
}

.gender-grade-emp-name {
    font-weight: var(--font-medium);
    color: var(--gray-800);
}

.gender-grade-emp-meta {
    font-size: var(--text-xs);
    color: var(--gray-400);
    text-align: right;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gender-grade-emp-more {
    font-size: var(--text-xs);
    color: var(--gray-400);
    font-style: italic;
    padding: 0.35rem 0.75rem;
    text-align: center;
}

/* Performance Analysis Card */
.performance-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    overflow: hidden;
}
.performance-card-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 150ms ease;
}

.performance-card-header.collapsed {
    border-radius: 0;
}
.performance-card-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}
.performance-card-header h4 svg { stroke: var(--brand-indigo-800); flex-shrink: 0; }
.performance-card-body {
    padding: 1.25rem;
}

/* Summary row */
.perf-summary-row {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.perf-summary-stat {
    text-align: center;
    padding: 0.85rem 0.75rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--gray-200);
    background: var(--gray-50);
    cursor: default;
    transition: all 0.15s;
    overflow: hidden;
    min-width: 0;
}
.perf-summary-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.perf-summary-stat.perf-high-bg {
    background: var(--success-lighter);
    border-color: var(--brand-green-200);
}
.perf-summary-stat.perf-solid-bg {
    background: var(--primary-lighter);
    border-color: var(--brand-indigo-200);
}
.perf-summary-stat.perf-low-bg {
    background: var(--danger-lighter);
    border-color: var(--brand-red-200);
}

.perf-summary-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    line-height: 1;
}
.perf-summary-stat.perf-high-bg .perf-summary-value { color: var(--success); }
.perf-summary-stat.perf-solid-bg .perf-summary-value { color: var(--primary); }
.perf-summary-stat.perf-low-bg .perf-summary-value { color: var(--danger); }

.perf-summary-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-top: 0.35rem;
    line-height: 1.2;
}
.perf-summary-sub {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Distribution chart */
.perf-distribution-section {
    margin-bottom: 1.25rem;
}

.perf-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.perf-section-header .perf-section-title {
    margin: 0;
}

.perf-chart-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--gray-100);
    padding: 0.2rem;
    border-radius: 6px;
}

.perf-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 26px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.15s ease;
}

.perf-toggle-btn:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.perf-toggle-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.perf-toggle-btn svg {
    width: 14px;
    height: 14px;
}

/* Line chart */
.perf-distribution-line {
    padding: 0;
}

.perf-line-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.perf-line-container.perf-line-large {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.perf-line-container.perf-line-large svg {
    width: 100%;
    max-width: 100%;
    height: auto;
    /* Source is 960×325 — wider aspect, room for the larger token-sized labels. */
    max-height: 325px;
}

/* Legend now sits above the chart */
.perf-line-container.perf-line-large .perf-line-legend {
    margin: 0 0 0.4rem;
}

.perf-line-container svg {
    display: block;
    margin-bottom: 0.5rem;
}

/* Line chart legend */
.perf-line-legend {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 0.5rem;
    font-size: var(--text-xs);
}

.perf-legend-actual,
.perf-legend-target {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--gray-600);
}

.perf-legend-line {
    width: 16px;
    height: 2px;
    border-radius: 1px;
}

.perf-legend-line.solid {
    background: linear-gradient(to right, var(--brand-red-500), var(--brand-green-600));
}

.perf-legend-line.dashed {
    background: repeating-linear-gradient(
        to right,
        var(--gray-400) 0px,
        var(--gray-400) 3px,
        transparent 3px,
        transparent 5px
    );
}

/* Variance summary */
.perf-variance-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    padding: 0.6rem 1rem;
    background: var(--gray-50);
    border-radius: 6px;
    margin-top: 0.5rem;
}

.perf-variance-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    margin-right: 0.25rem;
}

.perf-variance-item {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: var(--gray-100);
    color: var(--gray-600);
}

.perf-variance-item.variance-over {
    background: var(--brand-red-100);
    color: var(--brand-red-700);
}

.perf-variance-item.variance-under {
    background: var(--brand-amber-100);
    color: var(--brand-amber-700);
}

.perf-variance-item.variance-ok {
    background: var(--brand-green-100);
    color: var(--brand-green-700);
}

/* Mini line chart for department modal */
.perf-mini-line-container {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.perf-mini-line-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.perf-mini-legend {
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
}

.perf-mini-variance {
    padding: 0.4rem 0.75rem;
    margin-top: 0.75rem;
}

.perf-mini-variance .perf-variance-item {
    font-size: var(--text-xs);
    padding: 0.15rem 0.4rem;
}

/* Target % column in perf config */
.perf-cat-hdr-target {
    text-align: center;
}

.perf-cat-target-input {
    width: 60px;
    text-align: center;
    padding: 0.35rem 0.4rem;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: var(--text-body);
}

.perf-target-total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.5rem;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    background: var(--gray-50);
    border-radius: 4px;
}

.perf-target-total.perf-target-error {
    background: var(--brand-red-50);
    color: var(--brand-red-700);
}

.perf-target-total.perf-target-valid {
    background: var(--brand-green-50);
    color: var(--brand-green-700);
}

.perf-section-title {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.75rem 0;
}
.perf-dist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.perf-dist-header .perf-section-title {
    margin: 0;
}

.perf-distribution-waffle {
    padding: 0.5rem 0;
}

.perf-waffle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.perf-waffle-container svg {
    display: block;
    margin-bottom: 0.75rem;
}

.perf-waffle-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 0.35rem;
}

.perf-waffle-legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
    font-weight: var(--font-medium);
}

.perf-waffle-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.perf-waffle-note {
    font-size: var(--text-xs);
    color: var(--gray-400);
    font-style: italic;
}
.perf-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}
.perf-bar-count {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: var(--gray-500);
    margin-bottom: 2px;
}
.perf-bar {
    width: 100%;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
}
.perf-bar-high { background: linear-gradient(180deg, var(--brand-green-500), var(--success)); }
.perf-bar-solid { background: linear-gradient(180deg, var(--brand-indigo-500), var(--primary)); }
.perf-bar-low { background: linear-gradient(180deg, var(--brand-red-400), var(--danger)); }
.perf-bar-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 4px;
    font-weight: var(--font-semibold);
}
.perf-avg-line-label {
    text-align: center;
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-top: 0.4rem;
}
.perf-caveat {
    font-size: var(--text-sm);
    color: var(--gray-400);
    text-align: center;
    margin: 0.5rem 0 1rem;
    font-style: italic;
}

/* Department grid */
.perf-dept-section {
    margin-top: 0.5rem;
}
.perf-legend {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}
.perf-high-dot { background: var(--brand-green-500); }
.perf-solid-dot { background: var(--brand-indigo-500); }
.perf-low-dot { background: var(--danger); }

.perf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
}
.perf-cell {
    position: relative;
    border-radius: var(--radius);
    padding: 0.85rem 0.75rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    border: 1.5px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.perf-cell:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.perf-cell.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(107, 33, 168, 0.2);
}
.perf-cell.perf-high {
    background: var(--success-lighter);
    border-color: var(--brand-green-200);
}
.perf-cell.perf-solid {
    background: var(--primary-lighter);
    border-color: var(--brand-indigo-200);
}
.perf-cell.perf-low {
    background: var(--danger-lighter);
    border-color: var(--brand-red-200);
}
.perf-cell.active.perf-high { border-color: var(--success); }
.perf-cell.active.perf-solid { border-color: var(--primary); }
.perf-cell.active.perf-low { border-color: var(--danger); }

.perf-cell-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.perf-cell-score {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    line-height: 1;
}
.perf-cell.perf-high .perf-cell-score { color: var(--success); }
.perf-cell.perf-solid .perf-cell-score { color: var(--primary); }
.perf-cell.perf-low .perf-cell-score { color: var(--danger); }

.perf-cell-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.perf-cell.perf-high .perf-cell-label { color: var(--success); }
.perf-cell.perf-solid .perf-cell-label { color: var(--primary); }
.perf-cell.perf-low .perf-cell-label { color: var(--danger); }

.perf-cell-meta {
    font-size: var(--text-xs);
    color: var(--gray-400);
    white-space: nowrap;
}

/* Mini heat map tile grid */
.perf-tile-grid {
    display: flex;
    gap: 1px;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    width: 100%;
}

.perf-tile {
    flex: 1;
    height: 8px;
    border-radius: 1px;
    transition: all 0.15s ease;
    position: relative;
}

.perf-tile:hover {
    transform: scaleY(1.5);
    z-index: 1;
}

.perf-tile-high {
    background: linear-gradient(135deg, var(--brand-green-500) 0%, var(--success) 100%);
    box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.3);
}

.perf-tile-solid {
    background: linear-gradient(135deg, var(--brand-indigo-400) 0%, var(--brand-indigo-500) 100%);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.perf-tile-low {
    background: linear-gradient(135deg, var(--brand-red-400) 0%, var(--danger) 100%);
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.3);
}

/* Detail panel */
.perf-detail-panel {
    margin-top: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--gray-50);
}
.perf-detail-panel.hidden { display: none; }

.perf-detail-bars {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.perf-detail-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.perf-detail-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    min-width: 80px;
    text-align: right;
}
.perf-detail-bar-track {
    flex: 1;
    height: 10px;
    background: var(--gray-200);
    border-radius: 5px;
    overflow: hidden;
}
.perf-detail-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease;
}
.perf-detail-val {
    font-size: var(--text-xs);
    color: var(--gray-500);
    min-width: 60px;
}

.gender-dept-index.perf-high { background: var(--success-lighter); color: var(--success); }
.gender-dept-index.perf-solid { background: var(--primary-lighter); color: var(--primary); }
.gender-dept-index.perf-low { background: var(--danger-lighter); color: var(--danger); }

/* Performance popup styles */
.perf-popup-content {
    padding: 0.25rem 0;
}

.perf-popup-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    justify-content: center;
}

.perf-popup-stat {
    flex: 1;
    min-width: 70px;
    max-width: 120px;
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 0.6rem 0.5rem;
    text-align: center;
    overflow: hidden;
}

.perf-popup-stat-high { border-bottom: 3px solid #059669; }
.perf-popup-stat-solid { border-bottom: 3px solid var(--brand-indigo-500); }
.perf-popup-stat-low { border-bottom: 3px solid #ef4444; }

.perf-popup-stat-val {
    display: block;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    overflow: hidden;
    text-overflow: ellipsis;
}

.perf-popup-stat-val.perf-high { color: var(--brand-green-600); }
.perf-popup-stat-val.perf-solid { color: var(--primary); }
.perf-popup-stat-val.perf-low { color: var(--brand-red-500); }

.perf-popup-stat-lbl {
    display: block;
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-top: 0.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.perf-heatmap-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.perf-heatmap-legend-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
}

.perf-heatmap-legend-bar {
    flex: 1;
    height: 10px;
    border-radius: 5px;
}

.perf-heatmap-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-sm);
    color: var(--gray-700);
    font-weight: var(--font-medium);
}

.perf-heatmap-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.perf-heatmap-grid {
    display: flex;
    flex-wrap: wrap;
    direction: rtl;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
}

.perf-heatmap-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    direction: ltr;
}

.perf-heatmap-tile:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 2;
}

.perf-heatmap-initials {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: #fff;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

.perf-heatmap-rating {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: rgba(255,255,255,0.9);
    margin-top: 2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* Heatmap tile tooltip */
.perf-heatmap-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: #fff;
    font-size: var(--text-xs);
    line-height: 1.4;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.perf-heatmap-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--gray-800);
}

.perf-heatmap-tile:hover .perf-heatmap-tooltip {
    display: block;
}

/* Performance history popup */
.perf-history-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.perf-history-current {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.perf-history-current-rating {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    line-height: 1;
}

.perf-history-current-band {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.perf-history-meta {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

/* Performance history — year columns layout */
.perf-history-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.perf-history-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.perf-history-col-year {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.perf-history-col-tile {
    width: 100px;
    height: 100px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    transition: transform 0.15s;
}

.perf-history-col-tile:hover {
    transform: scale(1.05);
}

.perf-history-col-rating {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.perf-history-col-tile-empty {
    background: var(--gray-100);
    border: 2px dashed var(--gray-300);
}

.perf-history-col-na {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-400);
}

.perf-history-col-band {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    margin-bottom: 0.2rem;
}

.perf-history-col-months {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.perf-history-col-note {
    font-size: var(--text-xs);
    color: var(--gray-400);
    font-style: italic;
    max-width: 120px;
    line-height: 1.3;
}

.perf-history-arrow {
    font-size: var(--text-body);
}

.perf-trend-up { color: var(--brand-green-600); }
.perf-trend-down { color: var(--brand-red-500); }
.perf-trend-flat { color: var(--gray-400); }

.perf-history-trend-summary {
    margin-top: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: var(--text-body);
    color: var(--gray-600);
    text-align: center;
}

@media (max-width: 480px) {
    .perf-history-columns {
        gap: 0.5rem;
    }
    .perf-history-col-tile {
        width: 75px;
        height: 75px;
    }
    .perf-history-col-rating {
        font-size: var(--text-xl);
    }
}

@media (max-width: 480px) {
    .perf-heatmap-tile {
        width: 58px;
        height: 58px;
    }
    .perf-heatmap-initials {
        font-size: var(--text-sm);
    }
}

@media (max-width: 768px) {
    .perf-summary-row {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .perf-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.4rem;
    }
    .perf-cell {
        padding: 0.65rem 0.5rem;
    }
    .perf-cell-name { font-size: var(--text-xs); }
    .perf-cell-score { font-size: var(--text-body); }
    .perf-distribution-chart {
        height: 90px;
    }
}

/* Performance Trends Watchlist */
.perf-trends-container {
    margin-top: 0.5rem;
}

.perf-trends-divider {
    border-top: 1px solid var(--gray-200);
    margin: 1.25rem 0 0.75rem;
}

.perf-trends-section {
    margin-bottom: 1rem;
}

.perf-trends-section .perf-section-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.perf-trends-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: var(--white);
    background: var(--gray-400);
}

.perf-trends-warn .perf-trends-count { background: var(--brand-amber-600); }
.perf-trends-danger .perf-trends-count { background: var(--danger); }
.perf-trends-alert .perf-trends-count { background: var(--brand-indigo-500); }

.perf-trends-cell {
    background: var(--white);
    border-color: var(--gray-200);
    cursor: pointer;
}

.perf-trends-cell:hover {
    border-color: var(--gray-400);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.perf-trend-dots {
    display: flex;
    gap: 4px;
    margin-top: 0.3rem;
}

.perf-trend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.perf-trend-dot-empty {
    background: var(--gray-200);
    border: 1px dashed var(--gray-300);
}

.perf-trends-warn { border-left: 3px solid var(--brand-amber-600); padding-left: 0.75rem; }
.perf-trends-danger { border-left: 3px solid var(--danger); padding-left: 0.75rem; }
.perf-trends-alert { border-left: 3px solid #9333ea; padding-left: 0.75rem; }

/* Employee Performance Search */
.perf-search-section { margin: 1rem 0; }
/* Deprecated 2026-06-11: .perf-search-input was dead CSS (never applied as a class).
   Use canonical .search-bar via getSearchBarHtml() per docs/ui-elements.md → Search bars. */
.perf-search-results {
    margin-top: 0.35rem;
    max-height: 320px;
    overflow-y: auto;
    border-radius: 8px;
}
.perf-search-results:not(:empty) {
    border: 1px solid var(--gray-200);
    background: var(--white);
}
.perf-search-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.12s;
}
.perf-search-item:last-child { border-bottom: none; }
.perf-search-item:hover { background: var(--gray-50); }
.perf-search-item-name {
    font-weight: var(--font-semibold);
    font-size: var(--text-body);
    color: var(--gray-900);
    white-space: nowrap;
}
.perf-search-item-meta {
    font-size: var(--text-sm);
    color: var(--gray-500);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.perf-search-item-rating {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
/* Span of Control Card */
.span-control-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    overflow: hidden;
}

.span-control-header {
    background: transparent;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    transition: background 150ms ease;
}

.span-control-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--brand-amber-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.span-control-header h4 svg { stroke: var(--brand-amber-700); flex-shrink: 0; }

/* Span Control Header hover effect */
.span-control-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

/* Span Control L1 Metrics Row */
.span-control-metrics-row .card-metric {
    min-height: 90px;
}

/* Preview active state for L1 metrics */
.span-control-metrics-row.preview-active {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-indigo-100) 100%);
    border-radius: 8px;
    padding: 0.75rem;
    margin: -0.75rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.span-control-metrics-row.preview-active::before {
    content: 'Preview';
    position: absolute;
    top: -8px;
    left: 12px;
    background: var(--brand-indigo-600);
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
}

.span-control-metrics-row.preview-active .card-metric-value {
    color: var(--brand-indigo-700);
}

/* Mini Distribution Bar */
.span-mini-distribution-bar {
    display: flex;
    height: 24px;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 1rem;
    background: var(--gray-200);
}

.span-mini-dist-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    transition: flex 0.3s ease;
}

.span-mini-dist-segment.span-mini-dist-green {
    background: var(--brand-green-500);
}

.span-mini-dist-segment.span-mini-dist-amber {
    background: var(--brand-amber-500);
}

.span-mini-dist-segment.span-mini-dist-orange {
    background: #f97316;
}

.span-mini-dist-segment.span-mini-dist-red {
    background: var(--brand-red-500);
}

.span-mini-dist-count {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: white;
}

.span-mini-dist-legend {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    justify-content: center;
}

.span-mini-dist-legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--text-xs);
    color: var(--gray-600);
}

.span-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.span-legend-dot.span-legend-green { background: var(--brand-green-500); }
.span-legend-dot.span-legend-amber { background: var(--brand-amber-500); }
.span-legend-dot.span-legend-orange { background: #f97316; }
.span-legend-dot.span-legend-red { background: var(--brand-red-500); }

/* Optimization Potential Section */
.span-optimization-potential {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-indigo-100) 100%);
    border: 1px solid var(--brand-indigo-200);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.span-opt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.span-opt-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-800);
    font-size: var(--text-body);
}

.span-opt-title svg {
    stroke: var(--brand-indigo-600);
}

.span-preview-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: white;
    border: 1px solid var(--brand-indigo-300);
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--brand-indigo-700);
    cursor: pointer;
    transition: all 0.15s ease;
}

.span-preview-btn:hover {
    background: var(--brand-indigo-50);
    border-color: var(--brand-indigo-400);
}

.span-preview-btn.active {
    background: var(--brand-indigo-600);
    color: white;
    border-color: var(--brand-indigo-600);
}

.span-preview-btn.active svg {
    stroke: white;
}

.span-opt-stats {
    display: flex;
    gap: 1.5rem;
}

.span-opt-stat {
    display: flex;
    flex-direction: column;
}

.span-opt-stat-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--brand-indigo-700);
}

.span-opt-stat-label {
    font-size: var(--text-xs);
    color: var(--brand-indigo-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.span-opt-stat-savings .span-opt-stat-value {
    color: var(--brand-green-600);
}

/* Department Section */
.span-dept-section {
    margin-top: 0.5rem;
}

.span-dept-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.span-dept-section-header h5 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin: 0;
}

.span-dept-warning-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--text-xs);
    color: var(--brand-amber-700);
    background: var(--brand-amber-100);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.span-dept-warning-badge svg {
    stroke: var(--brand-amber-600);
}

.span-dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.5rem;
}

.span-dept-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.span-dept-card:hover {
    background: white;
    border-color: var(--brand-indigo-300);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.span-dept-card-content {
    flex: 1;
    min-width: 0;
}

.span-dept-card-name {
    font-weight: var(--font-medium);
    color: var(--gray-900);
    font-size: var(--text-body);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.span-dept-card-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.span-dept-opp-badge {
    background: var(--brand-green-100);
    color: var(--brand-green-700);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

.span-dept-card-chevron {
    stroke: var(--gray-400);
    flex-shrink: 0;
}

.span-dept-card:hover .span-dept-card-chevron {
    stroke: var(--brand-indigo-500);
}

@media (max-width: 640px) {
    .span-dept-grid {
        grid-template-columns: 1fr;
    }

    .span-opt-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .span-mini-dist-legend {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Span Density Row - inside distribution L2 */
.span-density-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.span-density-stat {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.75rem;
    text-align: center;
}

.span-density-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-900);
}

.span-density-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Category Range Inline */
.span-category-range-inline {
    font-size: var(--text-xs);
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

@media (max-width: 640px) {
    .span-density-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Simulate All Row - sits under L1 metrics */
.span-simulate-all-row {
    background: linear-gradient(135deg, var(--brand-amber-50) 0%, var(--brand-amber-100) 100%);
    border: 1px solid var(--brand-amber-200);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.span-simulate-all-row .span-master-toggle-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-start;
}

.span-simulate-all-row .span-master-toggle-text {
    font-weight: var(--font-semibold);
    color: var(--brand-amber-800);
}

.span-simulate-count {
    font-size: var(--text-sm);
    color: var(--gray-500);
    background: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-left: auto;
}

.span-simulate-all-row .span-master-impact-panel {
    margin-top: 1rem;
    background: var(--white);
    border-radius: 6px;
    padding: 0.75rem;
}

.span-control-body {
    padding: 1.5rem;
}

.span-mapping-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: var(--warning-light);
    border: 1px solid var(--brand-amber-500);
    border-radius: 6px;
    font-size: var(--text-body);
    color: var(--brand-amber-800);
}

.span-mapping-warning svg {
    flex-shrink: 0;
    stroke: var(--brand-amber-600);
    margin-top: 1px;
}

.span-mapping-warning a {
    color: var(--brand-amber-700);
    font-weight: var(--font-semibold);
    text-decoration: underline;
}

.span-mapping-warning a:hover {
    color: var(--brand-amber-800);
}

/* Manager Density Card */
.manager-density-card {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.manager-density-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.manager-density-header svg {
    stroke: var(--gray-500);
}

.manager-density-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.manager-density-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.manager-density-metric.manager-density-primary {
    border: 1px solid var(--brand-indigo-500);
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--primary-light) 100%);
}

.manager-density-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    line-height: 1.2;
}

.manager-density-primary .manager-density-value {
    color: var(--brand-indigo-800);
}

.manager-density-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.manager-density-status {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-top: 0.35rem;
}

.manager-density-status.manager-density-lean {
    background: var(--primary-light);
    color: var(--brand-indigo-800);
}

.manager-density-status.manager-density-optimal {
    background: var(--success-light);
    color: var(--brand-green-800);
}

.manager-density-status.manager-density-heavy {
    background: var(--danger-light);
    color: var(--brand-red-800);
}

.manager-density-benchmark {
    text-align: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #cbd5e1;
}

.manager-density-benchmark-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

@media (max-width: 768px) {
    .manager-density-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

.span-control-summary {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Span Distribution Summary */
.span-distribution-summary {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.span-dist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.span-dist-header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.span-dist-title {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.span-dist-subtitle {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.span-dist-subtitle .sim-highlight {
    color: var(--brand-indigo-600);
    font-weight: var(--font-semibold);
}

/* Master Toggle Box */
.span-master-toggle-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.span-master-toggle-box.active {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-purple-50) 100%);
    border-color: var(--brand-indigo-300);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.span-master-toggle-text {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.span-master-toggle-box.active .span-master-toggle-text {
    color: var(--brand-indigo-700);
}

/* Master Toggle Switch */
.span-master-toggle-label {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    cursor: pointer;
}

.span-master-toggle {
    opacity: 0;
    width: 0;
    height: 0;
}

.span-master-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-300);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.span-master-toggle-slider::before {
    content: '';
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.span-master-toggle:checked + .span-master-toggle-slider {
    background: linear-gradient(135deg, var(--brand-indigo-500) 0%, var(--brand-purple-500) 100%);
}

.span-master-toggle:checked + .span-master-toggle-slider::before {
    transform: translateX(16px);
}

/* Master Impact Panel */
.span-master-impact-panel {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-purple-50) 100%);
    border: 1px solid var(--brand-indigo-200);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    animation: impact-slide-in 0.3s ease;
}

@keyframes impact-slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.span-impact-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--brand-indigo-700);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.span-impact-header svg {
    stroke: var(--brand-indigo-500);
}

.span-impact-scenarios {
    margin-left: auto;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.2rem 0.5rem;
    background: var(--brand-indigo-100);
    color: var(--brand-indigo-700);
    border-radius: 4px;
}

.span-impact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

@media (max-width: 700px) {
    .span-impact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.span-impact-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--brand-indigo-100);
}

.span-impact-stat-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.35rem;
}

.span-impact-stat-values {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
}

.span-impact-before {
    color: var(--gray-500);
}

.span-impact-arrow {
    color: var(--gray-400);
    font-size: var(--text-sm);
}

.span-impact-after {
    color: var(--brand-indigo-700);
}

.span-impact-positive {
    color: var(--brand-green-600) !important;
}

.span-impact-savings {
    background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--brand-emerald-50) 100%);
    border-color: var(--brand-green-200);
}

.span-impact-savings .span-impact-stat-label {
    color: var(--brand-green-700);
}

/* Simulation Highlight Styles */
.sim-highlight {
    color: var(--brand-indigo-600) !important;
    font-weight: var(--font-bold);
}

.sim-removed {
    color: var(--brand-red-500);
    font-size: 0.75em;
    font-weight: var(--font-semibold);
}

.sim-original {
    color: var(--gray-400);
    font-size: 0.75em;
    font-weight: var(--font-normal);
}

.sim-improvement {
    color: var(--brand-green-600);
    font-size: 0.75em;
    font-weight: var(--font-semibold);
}

/* L1 Metric card simulation active state */
.card-metric.sim-active {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-violet-50) 100%);
    border: 1px solid var(--brand-indigo-200);
}

/* L3 card simulation active state */
.card-l3-mgr-card.sim-active {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-violet-50) 100%);
    border-color: var(--brand-indigo-200);
}

/* Master Control Message in Popup */
.span-simulator-summary.sim-master-active {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-purple-50) 100%);
    border: 1px solid var(--brand-indigo-200);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.sim-master-msg {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--brand-indigo-700);
}

.sim-master-msg svg {
    stroke: var(--brand-indigo-500);
    flex-shrink: 0;
}

/* Disabled Toggle in Master Mode */
.sim-toggle-label.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sim-toggle-label.disabled .sim-toggle-slider {
    background: var(--brand-indigo-400) !important;
}

.span-reassign-card.master-controlled {
    opacity: 0.85;
    border-color: var(--brand-indigo-200);
    background: linear-gradient(135deg, rgba(238, 242, 255, 0.5) 0%, rgba(245, 243, 255, 0.5) 100%);
}

.span-dist-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

@media (max-width: 600px) {
    .span-dist-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.span-dist-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    border-radius: 6px;
    background: white;
    border: 1px solid var(--gray-200);
}

.span-dist-item.span-dist-healthy {
    background: var(--brand-green-50);
    border-color: var(--brand-green-200);
}

.span-dist-item.span-dist-warning {
    background: var(--brand-amber-50);
    border-color: var(--brand-amber-200);
}

.span-dist-item.span-dist-critical {
    background: var(--brand-red-50);
    border-color: var(--brand-red-200);
}

.span-dist-item.span-dist-zero {
    opacity: 0.5;
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.span-dist-icon {
    font-size: var(--text-base);
    margin-bottom: 0.25rem;
}

.span-dist-healthy .span-dist-icon { color: var(--brand-green-600); }
.span-dist-warning .span-dist-icon { color: var(--brand-amber-600); }
.span-dist-critical .span-dist-icon { color: var(--brand-red-600); }
.span-dist-zero .span-dist-icon { color: var(--gray-400); }

.span-dist-count {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    line-height: 1.1;
}

.span-dist-healthy .span-dist-count { color: var(--brand-green-700); }
.span-dist-warning .span-dist-count { color: var(--brand-amber-700); }
.span-dist-critical .span-dist-count { color: var(--brand-red-700); }
.span-dist-zero .span-dist-count { color: var(--gray-400); }

.span-dist-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    text-align: center;
    margin-top: 0.25rem;
}

.span-dist-hint {
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-style: italic;
}

/* Span of Control — Org Chart Popup */
/* Variance Panel */
.org-variance-panel {
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    border: 1.5px solid var(--gray-200);
    background: var(--gray-50);
}

.org-variance-panel.var-low {
    background: var(--brand-green-50);
    border-color: var(--brand-green-200);
}

.org-variance-panel.var-moderate {
    background: var(--warning-lighter);
    border-color: var(--brand-amber-200);
}

.org-variance-panel.var-high {
    background: var(--danger-lighter);
    border-color: var(--brand-red-300);
}

.org-variance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.org-variance-title {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.org-variance-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.org-variance-badge.var-low {
    background: var(--brand-green-600);
    color: white;
}

.org-variance-badge.var-moderate {
    background: var(--brand-amber-600);
    color: white;
}

.org-variance-badge.var-high {
    background: var(--danger);
    color: white;
}

.org-variance-stats {
    display: flex;
    gap: 1rem;
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-bottom: 0.6rem;
}

.org-variance-stats strong {
    color: var(--gray-700);
}

.org-variance-chart {
    position: relative;
    width: 100%;
    padding: 0.25rem 0.25rem;
    margin-top: 0.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.org-variance-chart svg {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.org-variance-connector {
    stroke: var(--gray-300);
    stroke-width: 1;
    fill: none;
}

.org-variance-dot {
    stroke: white;
    stroke-width: 2;
}

/* Hover-enabled dots */
.org-variance-dot-hover {
    cursor: pointer;
    transition: r 0.15s ease, opacity 0.15s ease;
}

.org-variance-dot-hover:hover {
    r: 10;
    opacity: 0.9;
}

/* Span dot tooltip */
.span-dot-tooltip {
    display: none;
    position: absolute;
    background: var(--gray-900);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: var(--text-sm);
    line-height: 1.4;
    white-space: nowrap;
    z-index: 100;
    transform: translate(-50%, -100%);
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.span-dot-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--gray-900);
}

.span-dot-tooltip strong {
    display: block;
    font-weight: var(--font-semibold);
    margin-bottom: 2px;
}

.org-variance-label-name {
    font-size: 6px;
    font-weight: var(--font-semibold);
    fill: #374151;
}

.org-variance-label-span {
    font-size: 6px;
    font-weight: var(--font-bold);
    fill: #6b7280;
}

/* New Manager Styles (Expansion Simulation) */
.org-variance-connector-new {
    stroke: #059669;
    stroke-dasharray: 3,2;
}

.org-variance-dot-new {
    animation: variance-dot-pulse 1.5s ease-in-out infinite;
}

@keyframes variance-dot-pulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

.org-variance-label-new {
    fill: #059669 !important;
    font-weight: var(--font-bold);
}

.org-variance-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--gray-400);
    padding: 0 0.5rem;
}

/* Variance Panel Simulation State */
.org-variance-panel.sim-active {
    border-color: var(--brand-indigo-400);
    background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.org-variance-panel.sim-active .org-variance-title {
    color: var(--brand-indigo-700);
}

.org-variance-panel.sim-active .org-variance-badge {
    background: var(--brand-indigo-600);
    color: white;
}

.org-variance-panel.sim-active .org-variance-badge .sim-label {
    font-weight: var(--font-medium);
    opacity: 0.85;
}

.org-variance-panel.sim-active .org-variance-stats {
    color: var(--brand-indigo-600);
}

.org-variance-panel.sim-active .org-variance-stats strong {
    color: var(--brand-indigo-800);
}

.org-variance-panel.sim-active .sim-stats {
    background: rgba(99, 102, 241, 0.1);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.org-variance-panel.sim-active .sim-managers-count {
    font-size: var(--text-xs);
    font-style: italic;
    color: var(--brand-indigo-500);
}

/* Outlier highlight */
.org-manager-node.org-outlier {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25), 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
}

.org-manager-node.org-outlier::before {
    content: 'OUTLIER';
    position: absolute;
    top: -9px;
    left: 12px;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: var(--danger);
    background: white;
    padding: 0 0.35rem;
    letter-spacing: 0.06em;
    border-radius: 3px;
    border: 1px solid #fca5a5;
}

/* Span Optimization Panel */
.span-optimization-panel {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, #f0f4ff 100%);
    border: 1px solid var(--brand-indigo-200);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.span-opt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.span-opt-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-800);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.span-opt-title svg {
    stroke: var(--brand-indigo-600);
}

.span-opt-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.span-opt-badge.opt-good {
    background: var(--success-light);
    color: var(--success-dark);
}

.span-opt-badge.opt-moderate {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.span-opt-badge.opt-poor {
    background: var(--danger-light);
    color: var(--danger);
}

.span-opt-stats {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.span-opt-stat {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border-radius: 6px;
    background: white;
    border: 1px solid var(--gray-200);
}

.span-opt-stat-value {
    display: block;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
}

.span-opt-stat-label {
    display: block;
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.15rem;
}

.opt-stat-optimal .span-opt-stat-value { color: var(--success); }
.opt-stat-under .span-opt-stat-value { color: var(--warning-dark); }
.opt-stat-over .span-opt-stat-value { color: var(--danger); }

.span-opt-range-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
}

.span-opt-range-label {
    font-weight: var(--font-medium);
}

.span-opt-range-value {
    font-weight: var(--font-bold);
    color: var(--success);
}

.span-opt-range-cat {
    color: var(--gray-400);
    font-size: var(--text-xs);
}

/* Span Collapsible Panels */
.span-collapsible-panel {
    margin-top: 0.75rem;
}

.span-collapsible-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 10px 10px 0 0;
    user-select: none;
    transition: all 0.2s ease;
}

.span-collapsible-header.collapsed {
    border-radius: 10px;
}

.span-collapsible-header:hover {
    filter: brightness(0.97);
}

.span-collapse-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.4rem;
    transition: transform 0.2s ease;
}

.span-collapsible-header.collapsed .span-collapse-icon {
    transform: rotate(-90deg);
}

.span-collapsible-body {
    padding: 0 1rem 1rem 1rem;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.span-collapsible-body.collapsed {
    display: none;
}

/* Consolidation Panel */
.span-consolidation-panel {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #fde047;
    border-radius: 10px;
}

.span-consolidation-panel .span-collapsible-header {
    background: transparent;
}

.span-consolidation-panel .span-collapsible-body {
    background: transparent;
}

.span-consolidation-panel .span-collapse-icon svg {
    stroke: #ca8a04;
}

.span-consol-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.span-consol-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: #854d0e;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.span-consol-title svg {
    stroke: #ca8a04;
}

.span-consol-count {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: #fef08a;
    color: #854d0e;
    width: fit-content;
}

/* Department Simulation Toggle */
.span-dept-toggle-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.span-dept-toggle-box.active {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-purple-50) 100%);
    border-color: var(--brand-indigo-300);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.span-dept-toggle-box.master-controlled {
    background: linear-gradient(135deg, var(--brand-indigo-100) 0%, var(--brand-purple-100) 100%);
    border-color: var(--brand-indigo-400);
}

.span-dept-toggle-box.master-controlled .span-dept-toggle-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-700);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.span-dept-toggle-text {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.span-dept-toggle-box.active .span-dept-toggle-text {
    color: var(--brand-indigo-700);
}

.span-dept-toggle-label-wrap {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    cursor: pointer;
}

.span-dept-toggle {
    opacity: 0;
    width: 0;
    height: 0;
}

.span-dept-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-300);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.span-dept-toggle-slider::before {
    content: '';
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.span-dept-toggle:checked + .span-dept-toggle-slider {
    background: linear-gradient(135deg, var(--brand-indigo-500) 0%, var(--brand-purple-500) 100%);
}

.span-dept-toggle:checked + .span-dept-toggle-slider::before {
    transform: translateX(16px);
}

/* Department Simulation Panel */
.span-dept-sim-panel {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-purple-50) 100%);
    border: 1px solid var(--brand-indigo-200);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.75rem;
    animation: impact-slide-in 0.3s ease;
}

.span-dept-sim-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-700);
    margin-bottom: 0.5rem;
}

.span-dept-sim-header svg {
    stroke: var(--brand-indigo-500);
}

.span-dept-sim-stats {
    display: flex;
    gap: 1rem;
}

.span-dept-sim-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.span-dept-sim-stat .stat-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
}

.span-dept-sim-stat .stat-value {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-700);
}

.span-dept-sim-stat .stat-positive {
    color: var(--brand-green-600);
}

.span-dept-sim-stat .stat-investment {
    color: #f59e0b;
}

.span-dept-sim-stat .stat-negative {
    color: #dc2626;
}

.span-consol-savings {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-sm);
    color: #166534;
    padding: 0.5rem 0.75rem;
    background: #dcfce7;
    border-radius: 6px;
    border: 1px solid #86efac;
    margin-bottom: 0.75rem;
}

.span-consol-savings svg {
    stroke: #16a34a;
}

.span-consol-savings-note {
    font-size: var(--text-xs);
    color: #4ade80;
    margin-left: 0.25rem;
}

.span-consol-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.span-consol-item {
    background: white;
    border-radius: 8px;
    padding: 0.85rem;
    border: 1px solid var(--gray-200);
}

.span-consol-item.conf-high {
    border-left: 3px solid var(--success);
}

.span-consol-item.conf-medium {
    border-left: 3px solid var(--warning-dark);
}

.span-consol-item.conf-low {
    border-left: 3px solid var(--gray-400);
}

.span-consol-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.span-consol-item-type {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.span-consol-item-conf {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.span-consol-item-conf.conf-high {
    background: var(--success-light);
    color: var(--success-dark);
}

.span-consol-item-conf.conf-medium {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.span-consol-item-conf.conf-low {
    background: var(--gray-100);
    color: var(--gray-600);
}

.span-consol-comparison {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.span-consol-manager {
    flex: 1;
    padding: 0.6rem;
    border-radius: 6px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
}

.span-consol-retain {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
}

.span-consol-reassign {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fca5a5;
}

.span-consol-manager-badge {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    margin-bottom: 0.35rem;
}

.span-consol-manager-badge.retain {
    background: #16a34a;
    color: white;
}

.span-consol-manager-badge.reassign {
    background: #dc2626;
    color: white;
}

.span-consol-manager-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.span-consol-manager-meta {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.15rem;
}

.span-consol-manager-stats {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.35rem;
    font-size: var(--text-xs);
    color: var(--gray-600);
}

.span-consol-manager-cost {
    font-size: var(--text-xs);
    color: var(--success-dark);
    margin-top: 0.25rem;
    font-weight: var(--font-medium);
}

.span-consol-manager-score {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin: 0.35rem 0;
}

.span-consol-manager-score .score-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}

.span-consol-retain .span-consol-manager-score .score-value {
    color: var(--success-dark);
}

.span-consol-reassign .span-consol-manager-score .score-value {
    color: var(--gray-500);
}

.span-consol-manager-score .score-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.span-consol-arrow {
    flex-shrink: 0;
}

.span-consol-arrow svg {
    stroke: var(--gray-400);
}

.span-consol-reason {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: var(--text-xs);
    color: var(--gray-600);
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--gray-100);
    line-height: 1.4;
}

.span-consol-reason svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
    stroke: var(--brand-indigo-400);
}

/* Grouped Consolidation Layout */
.span-consol-section {
    margin-top: 0.75rem;
}

.span-consol-section-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--gray-200);
}

.span-consol-retain-section .span-consol-section-header {
    color: var(--success-dark);
}

.span-consol-retain-section .span-consol-section-header svg {
    stroke: var(--success-dark);
}

.span-consol-reassign-section .span-consol-section-header {
    color: var(--brand-amber-700);
}

.span-consol-reassign-section .span-consol-section-header svg {
    stroke: var(--brand-amber-600);
}

.span-consol-retain-list,
.span-consol-reassign-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* Retain Manager Card */
.span-retain-card {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 6px;
}

.span-retain-info {
    min-width: 0;
}

.span-retain-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.span-retain-position {
    font-size: var(--text-xs);
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.span-retain-score {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
}

.span-retain-score .score-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--success-dark);
}

.span-retain-score .score-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
}

.span-retain-span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}

.span-retain-span .span-current {
    color: var(--gray-500);
}

.span-retain-span .span-arrow {
    color: var(--gray-400);
    font-size: var(--text-xs);
}

.span-retain-span .span-new {
    color: var(--success-dark);
}

.span-retain-absorbs {
    grid-column: 1 / -1;
    font-size: var(--text-xs);
    color: var(--gray-600);
    padding-top: 0.3rem;
    border-top: 1px dashed var(--gray-200);
}

/* Reassign Manager Card */
.span-reassign-card {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto auto auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    transition: all 0.15s ease;
}

.span-reassign-card.sim-selected {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fca5a5;
}

.span-reassign-card.sim-conflict {
    opacity: 0.4;
    pointer-events: none;
    position: relative;
}

.span-reassign-card.sim-conflict::after {
    content: 'Conflicts with selected';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    white-space: nowrap;
    z-index: 10;
}

.span-reassign-info {
    min-width: 0;
}

.span-reassign-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.span-reassign-position {
    font-size: var(--text-xs);
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.span-reassign-score {
    display: flex;
    align-items: baseline;
    gap: 0.15rem;
}

.span-reassign-score .score-value {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--gray-500);
}

.span-reassign-score .score-label {
    font-size: var(--text-2xs);
    font-weight: var(--font-semibold);
    color: var(--gray-400);
    text-transform: uppercase;
}

.span-reassign-team {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    white-space: nowrap;
}

.span-reassign-dest {
    font-size: var(--text-xs);
    color: var(--brand-indigo-600);
    font-weight: var(--font-medium);
    white-space: nowrap;
}

.span-reassign-savings {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--success-dark);
    white-space: nowrap;
}

.span-reassign-conf {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    white-space: nowrap;
}

.span-reassign-conf.conf-high {
    background: var(--success-light);
    color: var(--success-dark);
}

.span-reassign-conf.conf-medium {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.span-reassign-conf.conf-low {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Span Consolidation Item Header with Toggle */
.span-consol-item-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Simulator Toggle Switch */
.sim-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    user-select: none;
}

.sim-toggle {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.sim-toggle-slider {
    position: relative;
    width: 32px;
    height: 18px;
    background: var(--gray-300);
    border-radius: 18px;
    transition: all 0.2s ease;
}

.sim-toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.sim-toggle:checked + .sim-toggle-slider {
    background: var(--brand-indigo-500);
}

.sim-toggle:checked + .sim-toggle-slider::before {
    transform: translateX(14px);
}

.sim-toggle-text {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sim-toggle:checked ~ .sim-toggle-text {
    color: var(--brand-indigo-600);
}

/* Simulator Summary Panel */
.span-simulator-summary {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, #e8f0ff 100%);
    border: 2px dashed var(--brand-indigo-200);
    border-radius: 8px;
    padding: 0.75rem;
    margin: 0.75rem 0;
    transition: all 0.3s ease;
}

.span-simulator-summary.sim-inactive {
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.sim-inactive-msg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: var(--text-sm);
    color: var(--gray-500);
    font-style: italic;
}

.sim-inactive-msg svg {
    stroke: var(--gray-400);
}

.sim-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.sim-summary-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--brand-indigo-700);
}

.sim-summary-title svg {
    stroke: var(--brand-indigo-500);
}

.sim-selected-count {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-600);
    background: var(--brand-indigo-100);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.sim-comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.sim-comparison-item {
    background: white;
    border: 1px solid var(--brand-indigo-100);
    border-radius: 6px;
    padding: 0.5rem;
    text-align: center;
}

.sim-comparison-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.3rem;
}

.sim-comparison-values {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-size: var(--text-body);
    font-weight: var(--font-bold);
}

.sim-current {
    color: var(--gray-500);
}

.sim-arrow {
    color: var(--gray-400);
    font-size: var(--text-sm);
}

.sim-projected {
    color: var(--gray-800);
}

.sim-projected.sim-positive {
    color: var(--success-dark);
}

.sim-projected.sim-negative {
    color: var(--danger-dark);
}

.sim-change {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
}

.sim-change.sim-positive {
    color: var(--success-dark);
}

.sim-change.sim-negative {
    color: var(--danger-dark);
}

.sim-savings-item {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
}

.sim-reset-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: var(--text-xs);
    padding: 0.35rem 0.6rem;
}

/* Selected Consolidation Item */
.span-consol-item.sim-selected {
    border-color: var(--brand-indigo-400);
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    box-shadow: 0 0 0 2px var(--brand-indigo-100);
}

/* Conflict State */
.span-consol-item.sim-conflict {
    opacity: 0.5;
    pointer-events: none;
}

.span-consol-item.sim-conflict::after {
    content: 'Conflicts with selected scenario';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: var(--text-xs);
    white-space: nowrap;
}

.span-consol-item {
    position: relative;
}

/* Simulated Span Change on Manager Badge */
.org-manager-badge.sim-span-changed {
    background: var(--brand-indigo-500) !important;
    animation: pulse-badge 1.5s ease-in-out infinite;
}

.org-manager-badge.sim-span-changed strong {
    color: #fef08a;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Simulated Reassigned Manager - Grey Out */
.org-tree.sim-reassigned {
    opacity: 0.35;
    position: relative;
    filter: grayscale(80%);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.org-tree.sim-reassigned::before {
    content: 'REASSIGNED';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--gray-500);
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    z-index: 10;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.org-tree.sim-reassigned .org-connector,
.org-tree.sim-reassigned .org-reports-grid {
    opacity: 0.5;
}

/* ============================================
   Span Division Inline Cards (Phase 1 Redesign)
   ============================================ */

.span-division-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.span-division-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    overflow: hidden;
}

.span-division-card:hover:not(.expanded) {
    background: white;
    border-color: var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.span-division-card.expanded {
    background: white;
    border-color: var(--gray-300);
    box-shadow: var(--shadow-md);
}

.span-division-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
}

.span-division-card.expanded .span-division-card-header {
    border-bottom-color: var(--gray-300);
}

.span-division-chevron {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    stroke: var(--gray-500);
    transition: transform 0.2s ease;
}

.span-division-card.expanded .span-division-chevron {
    transform: rotate(90deg);
}

.span-division-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;
    min-width: 0;
}

.span-division-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
}

.span-division-meta {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.span-division-status {
    flex-shrink: 0;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.span-div-in-range {
    color: var(--success);
}

.span-div-outside {
    color: var(--warning-dark);
}

.span-division-managers-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem;
    padding: 0 1rem 1rem 1rem;
    border-top: 1px solid var(--gray-200);
    margin-top: 0;
    padding-top: 0.75rem;
}

.span-division-card.expanded .span-division-managers-grid {
    display: grid;
}

/* Compact Manager Cards */
.span-mgr-compact-card {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    cursor: pointer;
    min-height: 56px;
    position: relative;
    transition: all 0.15s ease;
}

/* Status indicators - left border */
.span-mgr-compact-card.status-over {
    border-left: 3px solid var(--danger);
}
.span-mgr-compact-card.status-under {
    border-left: 3px solid var(--warning-dark);
}
.span-mgr-compact-card.status-optimal {
    border-left: 3px solid var(--success);
}
.span-mgr-compact-card.status-critical {
    border-left: 3px solid #b91c1c;
}

.span-mgr-compact-card:hover {
    background: white;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.span-mgr-compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.span-mgr-compact-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.span-mgr-compact-span {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--gray-600);
    flex-shrink: 0;
}

.span-mgr-compact-meta {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Manager Org Chart Header */
.span-mgr-org-header {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.span-mgr-org-title {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}

.span-mgr-org-subtitle {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.span-mgr-org-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.span-mgr-org-stat {
    font-size: var(--text-body);
    color: var(--gray-600);
}

.span-mgr-org-stat strong {
    font-weight: var(--font-bold);
}

.span-label-span-healthy {
    color: var(--success);
}

.span-label-span-narrow {
    color: var(--warning-dark);
}

.span-label-span-overloaded {
    color: var(--danger);
}

.span-label-span-critical {
    color: #b91c1c;
}

/* ============================================
   Span Department Modal - Phase 2 Redesign
   ============================================ */

/* Expanded modal sizing */
.span-dept-modal .modal-content {
    width: 94vw;
    max-width: 1600px;
    height: 90vh;
    max-height: none;
    display: flex;
    flex-direction: column;
}

.span-dept-modal .modal-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.span-dept-modal .modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.span-dept-modal .modal-body {
    flex: 1;
    overflow: hidden;
    padding: 1rem 1.5rem;
}

/* Two-column layout */
.span-modal-two-col-layout {
    display: flex;
    gap: 1.5rem;
    height: 100%;
    overflow: hidden;
}

.span-modal-left-col {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.span-modal-right-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Summary panel in left column */
.span-modal-summary-panel {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
}

.span-modal-summary-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.span-modal-summary-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.span-modal-stat-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.span-modal-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.span-modal-stat-dot.status-optimal { background: var(--success); }
.span-modal-stat-dot.status-under { background: var(--warning-dark); }
.span-modal-stat-dot.status-over { background: var(--danger); }

.span-modal-stat-label {
    flex: 1;
    font-size: var(--text-body);
    color: var(--gray-600);
}

.span-modal-stat-value {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.span-modal-range-info {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.span-modal-range-info strong {
    color: var(--gray-800);
}

/* Optimization toggles in left column */
.span-modal-toggles-panel {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border: 1px solid #a78bfa;
    border-radius: 8px;
    padding: 1rem;
}

.span-modal-toggles-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: #5b21b6;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.span-modal-toggle-item {
    background: white;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.span-modal-toggle-item:last-child {
    margin-bottom: 0;
}

.span-modal-toggle-item.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.span-modal-toggle-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.span-modal-toggle-label {
    flex: 1;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.span-modal-toggle-desc {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.span-modal-toggle-impact {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--success-dark);
    margin-top: 0.5rem;
}

/* Grade range pills */
.span-grade-range-selector {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Impact summary in left column */
.span-modal-impact-panel {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 1rem;
}

.span-modal-impact-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: #166534;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.span-modal-impact-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-body);
    margin-bottom: 0.5rem;
}

.span-modal-impact-row:last-child {
    margin-bottom: 0;
}

.span-modal-impact-label {
    color: #166534;
}

.span-modal-impact-value {
    font-weight: var(--font-bold);
    color: #166534;
}

.span-modal-impact-change {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

/* Manager grid in right column */
.span-modal-manager-grid-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.span-modal-manager-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.span-modal-manager-grid-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.span-modal-selection-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.span-selection-count {
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.span-selection-clear {
    font-size: var(--text-xs);
    color: var(--brand-indigo-600);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.span-selection-clear:hover {
    text-decoration: underline;
}

.span-modal-manager-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    overflow-y: auto;
    padding-right: 0.5rem;
    align-content: start;
}

@media (max-width: 1200px) {
    .span-modal-manager-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1000px) {
    .span-modal-manager-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Manager grid sections */
.span-mgr-grid-section {
    grid-column: 1 / -1;
}

.span-mgr-grid-section-header {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.span-mgr-grid-section-header .reassigned-icon {
    margin-right: 0.25rem;
}

.span-mgr-grid-section.reassigned-section .span-mgr-grid-section-header {
    color: var(--danger);
}

.span-mgr-grid-section-content {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

@media (max-width: 1200px) {
    .span-mgr-grid-section-content { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1000px) {
    .span-mgr-grid-section-content { grid-template-columns: repeat(3, 1fr); }
}

/* Selected state for compact manager card */
.span-mgr-compact-card.selected {
    border-color: var(--brand-indigo-500);
    border-width: 2px;
    background: var(--brand-indigo-50);
}

/* Reassigned state for compact manager card */
.span-mgr-compact-card.reassigned {
    opacity: 0.5;
    pointer-events: none;
    background: repeating-linear-gradient(
        -45deg,
        var(--gray-100),
        var(--gray-100) 4px,
        var(--gray-200) 4px,
        var(--gray-200) 8px
    );
}

.span-mgr-reassigned-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: var(--text-xs);
    padding: 2px 6px;
    background: var(--danger-light);
    color: var(--danger-dark);
    border-radius: 4px;
    font-weight: var(--font-semibold);
    text-transform: uppercase;
}

.span-mgr-reassigned-target {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 2px;
}

/* Detail panel below manager grid */
.span-modal-detail-panel {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.span-modal-detail-empty {
    text-align: center;
    color: var(--gray-500);
    font-size: var(--text-body);
    padding: 2rem;
}

.span-detail-org-trees {
    max-height: 300px;
    overflow-y: auto;
}

.span-detail-org-trees .org-tree {
    margin-bottom: 1rem;
}

.span-detail-org-trees .org-tree:last-child {
    margin-bottom: 0;
}

/* Reset button styling */
.span-modal-reset-btn {
    font-size: var(--text-sm);
    padding: 0.4rem 0.75rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.15s ease;
}

.span-modal-reset-btn:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

/* Comparison table for multi-select */
.span-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
}

.span-comparison-table th,
.span-comparison-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.span-comparison-table th {
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    background: var(--gray-50);
}

.span-comparison-table td {
    color: var(--gray-800);
}

.span-comparison-table tr:last-child td {
    border-bottom: none;
}

.span-comparison-total {
    margin-top: 0.75rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.span-comparison-container {
    padding: 0;
}

/* ============================================
   Level 2 Grade-Based Simulation Panel
   ============================================ */

.span-level2-panel {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #7dd3fc;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.75rem;
    transition: opacity 0.2s ease;
}

.span-level2-panel.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.span-level2-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.span-level2-toggle-wrap {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.span-level2-toggle {
    opacity: 0;
    width: 0;
    height: 0;
}

.span-level2-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-300);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.span-level2-toggle-slider::before {
    content: '';
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.span-level2-toggle:checked + .span-level2-toggle-slider {
    background: #0ea5e9;
}

.span-level2-toggle:checked + .span-level2-toggle-slider::before {
    transform: translateX(16px);
}

.span-level2-label {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.span-level2-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: #0369a1;
}

.span-level2-desc {
    font-size: var(--text-xs);
    color: #0284c7;
}

.span-level2-body {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #bae6fd;
}

.span-level2-body.hidden {
    display: none;
}

.span-grade-range-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.span-grade-range-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: #0369a1;
}

.span-level2-summary {
    margin-top: 0.5rem;
    font-size: var(--text-sm);
    color: #0369a1;
}

.span-level2-count {
    font-weight: var(--font-semibold);
}

.span-level2-savings {
    font-weight: var(--font-bold);
    color: #059669;
}

/* Transferred Reports - Visually indicate reports moved from another manager */
.org-report-node.sim-transferred {
    background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
    border: 1px dashed var(--brand-indigo-400);
    position: relative;
    animation: transfer-pulse 0.5s ease-out;
}

.org-report-node.sim-transferred::before {
    content: '↳ transferred';
    position: absolute;
    top: -0.5rem;
    right: 0.25rem;
    background: var(--brand-indigo-500);
    color: white;
    font-size: var(--text-2xs);
    font-weight: var(--font-semibold);
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

@keyframes transfer-pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Span Simulation Toggle Panel */
.span-simulation-toggle-panel {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border: 1px solid #a78bfa;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.span-sim-toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.span-sim-toggle-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: #5b21b6;
}

.span-sim-toggle-title svg {
    stroke: #7c3aed;
}

.span-sim-toggle-desc {
    font-size: var(--text-xs);
    color: #6b21a8;
    line-height: 1.4;
}

.span-sim-toggle-desc strong {
    color: #5b21b6;
}

/* Span Redistribution Panel */
.span-redistribution-panel {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border: 1px solid #fbbf24;
    border-radius: 8px;
}

.span-redistribution-panel .span-collapsible-header {
    background: transparent;
}

.span-redistribution-panel .span-collapsible-body {
    background: transparent;
}

.span-redistribution-panel .span-collapse-icon svg {
    stroke: #b45309;
}

.span-redist-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.span-redist-title {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: #92400e;
}

.span-redist-title svg {
    stroke: #b45309;
}

.span-redist-count {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    background: #fbbf24;
    color: #78350f;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
}

.span-redist-desc {
    font-size: var(--text-xs);
    color: #92400e;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.span-redist-moves {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.span-redist-move {
    background: white;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    padding: 0.5rem;
}

.span-redist-move-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.25rem;
}

.span-redist-from,
.span-redist-to {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: #1f2937;
}

.span-redist-arrow {
    font-size: var(--text-xs);
    color: #b45309;
    font-weight: var(--font-bold);
}

.span-redist-move-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.span-redist-count-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    background: #fef3c7;
    color: #92400e;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

.span-redist-spans {
    font-size: var(--text-xs);
    color: #6b7280;
}

.span-redist-spans .span-change {
    font-weight: var(--font-medium);
    color: #374151;
}

.span-redist-reports {
    font-size: var(--text-xs);
    color: #6b7280;
    font-style: italic;
    line-height: 1.3;
}

/* Position group for redistribution */
.span-redist-position-group {
    margin-bottom: 0.5rem;
}

.span-redist-position-group:last-child {
    margin-bottom: 0;
}

.span-redist-position-label {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: #92400e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px dashed #fcd34d;
}

/* Redistributed report styling */
.org-report-node.sim-redistributed {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px dashed #f59e0b;
    position: relative;
    animation: redist-pulse 0.5s ease-out;
}

.org-report-node.sim-redistributed::before {
    content: '↻ rebalanced';
    position: absolute;
    top: -0.5rem;
    right: 0.25rem;
    background: #f59e0b;
    color: white;
    font-size: var(--text-2xs);
    font-weight: var(--font-semibold);
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

@keyframes redist-pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Expansion Panel Styles */
.span-expansion-panel {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.span-expansion-panel .span-collapsible-header {
    background: transparent;
}

.span-expansion-panel .span-collapsible-body {
    background: transparent;
}

.span-expansion-panel .span-collapse-icon svg {
    stroke: #059669;
}

.span-expansion-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.span-expansion-title {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: #065f46;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.span-expansion-title svg {
    stroke: #059669;
}

.span-expansion-count {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    background: #059669;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
}

.span-expansion-cost {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-xs);
    color: #065f46;
    background: rgba(5, 150, 105, 0.1);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.span-expansion-cost svg {
    stroke: #059669;
}

.span-expansion-card {
    background: white;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.6rem;
}

.span-expansion-card:last-child {
    margin-bottom: 0;
}

.span-expansion-card.readiness-ready {
    border-left: 4px solid #059669;
}

.span-expansion-card.readiness-develop {
    border-left: 4px solid #f59e0b;
}

.span-expansion-card.readiness-external {
    border-left: 4px solid #dc2626;
}

.span-expansion-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.span-expansion-role {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: #065f46;
}

.span-expansion-role svg {
    stroke: #059669;
}

.span-expansion-readiness {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
}

.span-expansion-readiness.readiness-ready {
    background: #d1fae5;
    color: #065f46;
}

.span-expansion-readiness.readiness-develop {
    background: #fef3c7;
    color: #92400e;
}

.span-expansion-readiness.readiness-external {
    background: #fee2e2;
    color: #991b1b;
}

.span-expansion-impact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f3f4f6;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    margin-bottom: 0.6rem;
}

.span-expansion-impact-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.span-expansion-impact .impact-label {
    font-size: var(--text-xs);
    color: #6b7280;
    font-weight: var(--font-semibold);
    text-transform: uppercase;
}

.span-expansion-impact .impact-value {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: #374151;
}

.span-expansion-impact .impact-arrow {
    color: #9ca3af;
    font-size: var(--text-body);
    padding: 0 0.25rem;
}

.span-expansion-candidate {
    margin-bottom: 0.6rem;
}

.span-candidate-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: #1e40af;
    margin-bottom: 0.4rem;
}

.span-candidate-header svg {
    stroke: #3b82f6;
    fill: #fbbf24;
}

.span-candidate-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: 6px;
    padding: 0.6rem;
}

.span-candidate-main {
    flex: 1;
}

.span-candidate-name {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: #1e40af;
    margin-bottom: 0.15rem;
}

.span-candidate-current {
    font-size: var(--text-xs);
    color: #3b82f6;
}

.span-candidate-from {
    font-size: var(--text-xs);
    color: #6b7280;
    margin-top: 0.15rem;
}

.span-candidate-metrics {
    display: flex;
    gap: 0.6rem;
}

.span-candidate-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0.4rem;
    background: white;
    border-radius: 4px;
    min-width: 50px;
}

.span-candidate-metric .metric-icon {
    font-size: var(--text-sm);
}

.span-candidate-metric .metric-value {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: #1e40af;
}

.span-candidate-metric .metric-label {
    font-size: var(--text-xs);
    color: #6b7280;
    text-transform: uppercase;
}

.span-candidate-runners {
    background: #f9fafb;
    border-radius: 4px;
    padding: 0.4rem 0.5rem;
    margin-top: 0.5rem;
}

.span-runners-header {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: #6b7280;
    margin-bottom: 0.3rem;
}

.span-runners-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.span-runner-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-xs);
    padding: 0.2rem 0;
    border-bottom: 1px solid #e5e7eb;
}

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

.span-runner-item .runner-name {
    font-weight: var(--font-semibold);
    color: #374151;
    flex: 1;
}

.span-runner-item .runner-score {
    font-weight: var(--font-semibold);
    color: #4b5563;
}

.span-runner-item .runner-details {
    color: #9ca3af;
    font-size: var(--text-xs);
}

.span-expansion-external {
    margin-bottom: 0.6rem;
}

.span-external-message {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    font-size: var(--text-xs);
    color: #991b1b;
}

.span-external-message svg {
    stroke: #dc2626;
    flex-shrink: 0;
}

.span-expansion-team {
    margin-bottom: 0.6rem;
}

.span-team-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: #374151;
    margin-bottom: 0.35rem;
}

.span-team-header svg {
    stroke: #6b7280;
}

.span-team-list {
    background: #f9fafb;
    border-radius: 4px;
    padding: 0.4rem 0.5rem;
}

.span-team-from-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    font-size: var(--text-xs);
    padding: 0.2rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.span-team-from-group:last-child {
    border-bottom: none;
}

.span-team-from-group .team-from-label {
    font-weight: var(--font-semibold);
    color: #4b5563;
}

.span-team-from-group .team-from-names {
    color: #6b7280;
}

.span-expansion-cost-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #6ee7b7;
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
}

.span-expansion-cost-detail .span-cost-icon svg {
    stroke: #059669;
}

.span-expansion-cost-detail .span-cost-info {
    flex: 1;
}

.span-expansion-cost-detail .span-cost-amount {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: #065f46;
}

.span-expansion-cost-detail .span-cost-desc {
    font-size: var(--text-xs);
    color: #059669;
}

/* Simulated Manager States */
.org-tree.sim-absorbing .org-manager-node {
    border: 2px solid var(--brand-indigo-500) !important;
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.org-tree.sim-absorbing .org-manager-badge {
    background: var(--brand-indigo-600) !important;
}

.org-tree.sim-absorbing .org-manager-icon svg {
    stroke: var(--brand-indigo-600);
}

.org-tree.sim-absorbing .org-span-label {
    color: var(--brand-indigo-600) !important;
    font-weight: var(--font-bold);
}

.org-tree.sim-absorbing::after {
    content: '↙ ABSORBING';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--brand-indigo-600);
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

/* Manager gaining reports from redistribution */
.org-tree.sim-gaining .org-manager-node {
    border: 2px solid #059669 !important;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.org-tree.sim-gaining .org-manager-badge {
    background: #059669 !important;
}

.org-tree.sim-gaining .org-manager-icon svg {
    stroke: #059669;
}

.org-tree.sim-gaining .org-span-label {
    color: #059669 !important;
    font-weight: var(--font-bold);
}

/* Manager losing reports from redistribution */
.org-tree.sim-losing .org-manager-node {
    border: 2px solid #f59e0b !important;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.org-tree.sim-losing .org-manager-badge {
    background: #f59e0b !important;
}

.org-tree.sim-losing .org-manager-icon svg {
    stroke: #f59e0b;
}

.org-tree.sim-losing .org-span-label {
    color: #f59e0b !important;
    font-weight: var(--font-bold);
}

/* Simulated span status changes */
.org-tree.sim-status-optimal .org-manager-node {
    border-color: #059669 !important;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
}

.org-tree.sim-status-optimal .org-manager-badge {
    background: #059669 !important;
}

.org-tree.sim-status-optimal .org-span-label {
    color: #059669 !important;
}

.org-tree.sim-status-under .org-manager-node {
    border-color: #f59e0b !important;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
}

.org-tree.sim-status-under .org-manager-badge {
    background: #f59e0b !important;
}

.org-tree.sim-status-under .org-span-label {
    color: #f59e0b !important;
}

.org-tree.sim-status-over .org-manager-node {
    border-color: #dc2626 !important;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
}

.org-tree.sim-status-over .org-manager-badge {
    background: #dc2626 !important;
}

.org-tree.sim-status-over .org-span-label {
    color: #dc2626 !important;
}

/* Simulated span label update */
.org-span-label.sim-updated {
    font-weight: var(--font-bold);
    animation: label-pulse 1.5s ease-in-out infinite;
}

@keyframes label-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Expansion Manager Node (New Position Placeholder) */
.org-tree.expansion-node {
    position: relative;
    animation: expansion-node-appear 0.3s ease-out;
}

@keyframes expansion-node-appear {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.expansion-manager-node {
    position: relative;
}

.expansion-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
    animation: expansion-badge-pulse 2s ease-in-out infinite;
}

@keyframes expansion-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.expansion-reports {
    border: 2px dashed var(--gray-300);
    border-radius: 8px;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 5px,
        rgba(0, 0, 0, 0.02) 5px,
        rgba(0, 0, 0, 0.02) 10px
    );
    min-height: 40px;
}

.sim-expansion-report {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
    border: 1px dashed #86efac !important;
    animation: expansion-report-move 0.4s ease-out;
}

@keyframes expansion-report-move {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sim-expansion-report .org-report-name {
    color: #059669 !important;
}

/* Marker for employees that have been moved to expansion manager */
.sim-expansion-moved {
    /* Visual indicator that this employee was moved */
}

.expansion-node-cost {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.4rem;
    margin-top: 0.5rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
}

/* Managers Section Header */
.span-managers-section {
    margin-top: 0.5rem;
}

.span-managers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 0.5rem;
}

.span-managers-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

/* Manager status indicators */
.org-tree.status-optimal .org-manager-node {
    border-left: 3px solid var(--success);
}

.org-tree.status-under .org-manager-node {
    border-left: 3px solid var(--warning-dark);
}

.org-tree.status-over .org-manager-node {
    border-left: 3px solid var(--danger);
}

.org-chart-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 0.5rem 0;
}

.org-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.org-manager-node {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.2rem;
    border-radius: 12px;
    border: 2px solid var(--gray-300);
    background: var(--gray-50);
    position: relative;
    min-width: 260px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.org-manager-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.org-manager-info {
    flex: 1;
    min-width: 0;
}

.org-manager-name {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    line-height: 1.2;
}

.org-manager-title {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.org-manager-dept {
    font-size: var(--text-xs);
    color: var(--gray-400);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.org-manager-badge {
    flex-shrink: 0;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: white;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    white-space: nowrap;
}

.org-span-label {
    position: absolute;
    bottom: -8px;
    right: 12px;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: white;
    padding: 0 0.3rem;
}

.org-connector {
    display: flex;
    justify-content: center;
    height: 24px;
}

.org-connector-line {
    width: 2px;
    height: 100%;
    background: var(--gray-300);
    position: relative;
}

.org-connector-line::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--gray-300);
}

.org-reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.4rem;
    width: 100%;
    max-width: 700px;
    position: relative;
}

/* Horizontal connector bar above grid */
.org-reports-grid::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--gray-200);
    border-radius: 1px;
}

.org-report-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.55rem 0.4rem;
    border-radius: 8px;
    border: 1.5px solid var(--gray-200);
    background: white;
    transition: all 0.15s;
}

.org-report-node:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-color: var(--brand-indigo-200);
}

.org-report-name {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    line-height: 1.2;
    margin-bottom: 0.15rem;
}

.org-report-position {
    font-size: var(--text-xs);
    color: var(--gray-500);
    line-height: 1.2;
}

.org-report-grade {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--brand-pink-500);
    background: var(--brand-pink-50);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-top: 0.2rem;
}

@media (max-width: 768px) {
    .org-manager-node {
        min-width: 200px;
        padding: 0.7rem 0.9rem;
    }
    .org-reports-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
    .org-report-node {
        padding: 0.4rem 0.3rem;
    }
    .org-report-name { font-size: var(--text-xs); }
    .org-report-position { font-size: var(--text-xs); }
}

/* ============================================
   Org Chart Popup — Wide Card Layout
   ============================================ */

.oc-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 0.5rem 0 1rem;
}

/* --- Level wrappers --- */
.oc-level {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* --- Wide Manager Cards --- */
.oc-wide-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1.5px solid var(--gray-300);
    background: var(--gray-50);
    width: 100%;
    max-width: 520px;
    position: relative;
}
.oc-wide-card-boss {
    opacity: 0.7;
    max-width: 440px;
}
.oc-wide-card-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.oc-wide-card-info {
    flex: 1;
    min-width: 0;
}
.oc-wide-card-name {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    line-height: 1.3;
}
.oc-wide-card-title {
    font-size: var(--text-xs);
    color: var(--gray-500);
    line-height: 1.3;
}
.oc-wide-card-dept {
    font-size: var(--text-xs);
    color: var(--gray-400);
    font-style: italic;
    line-height: 1.3;
}
.oc-wide-card-badge {
    flex-shrink: 0;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    white-space: nowrap;
}
.oc-wide-card-status {
    position: absolute;
    bottom: -7px;
    right: 10px;
    font-size: 0.65rem;
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: white;
    padding: 0 0.25rem;
}

/* --- Connector --- */
.oc-connector {
    display: flex;
    justify-content: center;
    height: 20px;
}
.oc-connector-line {
    width: 2px;
    height: 100%;
    background: var(--gray-300);
}

/* --- Legend --- */
.oc-legend {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    margin: 0.25rem 0 0.5rem;
    font-size: var(--text-xs);
    color: var(--gray-500);
}
.oc-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* --- Two-column reports layout --- */
.oc-reports-columns {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 600px;
}
.oc-reports-col {
    flex: 1;
    min-width: 0;
}
.oc-col-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0 0 0.35rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--gray-200);
}

/* --- Report rows --- */
.oc-report-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: background 0.1s;
}
.oc-report-row:hover {
    background: var(--gray-50);
}
.oc-report-row-name {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 80px;
    max-width: 140px;
}
.oc-report-row-title {
    font-size: var(--text-xs);
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.oc-report-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand-indigo-400);
    flex-shrink: 0;
}
.oc-dot-cross {
    background: var(--warning-color);
}
.oc-report-cross-dept {
    background: #fffbeb;
    border-left: 2px solid var(--warning-color);
    border-radius: 0 4px 4px 0;
}

/* --- Sub-managers section --- */
.oc-sub-managers-section {
    width: 100%;
    max-width: 600px;
    margin-top: 0.75rem;
}
.oc-sub-managers-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0 0 0.35rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--gray-200);
}

/* --- Sub-manager expandable --- */
.oc-sub-manager {
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    margin-bottom: 0.35rem;
    overflow: hidden;
}
.oc-sub-manager.oc-sub-cross-dept {
    border-left: 2px solid var(--warning-color);
    background: #fffbeb;
}
.oc-sub-manager-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    transition: background 0.1s;
}
.oc-sub-manager-header:hover {
    background: var(--gray-50);
}
.oc-sub-chevron {
    flex-shrink: 0;
    transition: transform 0.2s;
}
.oc-sub-manager.expanded .oc-sub-chevron {
    transform: rotate(180deg);
}
.oc-sub-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.oc-sub-name {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}
.oc-sub-title {
    font-size: var(--text-xs);
    color: var(--gray-500);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.oc-sub-badge {
    font-size: 0.65rem;
    font-weight: var(--font-bold);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    flex-shrink: 0;
}
.oc-sub-manager-body {
    display: none;
    padding: 0 0.6rem 0.4rem 1.8rem;
}
.oc-sub-manager.expanded .oc-sub-manager-body {
    display: block;
}

/* --- Tree card report list (expandable inside department modal) --- */
.span-org-reports-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 0.2rem 0;
    font-size: 0.65rem;
    color: var(--brand-indigo-500);
    font-weight: var(--font-semibold);
    transition: color 0.1s;
    width: 100%;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.span-org-reports-toggle:hover {
    color: var(--brand-indigo-700);
}
.span-org-reports-chevron {
    transition: transform 0.2s;
    flex-shrink: 0;
}
.span-org-reports-toggle.expanded .span-org-reports-chevron {
    transform: rotate(180deg);
}
.span-org-cross-dept-count {
    color: var(--warning-color);
    font-weight: var(--font-normal);
    font-size: 0.6rem;
}
.span-org-reports-list {
    display: none;
    position: fixed;
    width: 240px;
    max-height: 220px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 0.35rem;
    z-index: 99999;
}
.span-org-reports-list.expanded {
    display: block;
}
.span-org-reports-legend {
    display: flex;
    gap: 0.75rem;
    padding: 0 0.2rem 0.25rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.6rem;
    color: var(--gray-400);
}
.span-org-reports-list .oc-report-row {
    padding: 0.15rem 0.3rem;
}
.span-org-reports-list .oc-report-row-name {
    min-width: 50px;
    max-width: 90px;
    font-size: 0.65rem;
}
.span-org-reports-list .oc-report-row-title {
    font-size: 0.6rem;
}
.span-org-reports-list .oc-report-dot {
    width: 6px;
    height: 6px;
}
.span-org-reports-count {
    white-space: nowrap;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .oc-reports-columns {
        flex-direction: column;
    }
    .oc-wide-card {
        max-width: 100%;
    }
    .oc-report-row-name {
        max-width: 100px;
    }
}

/* ============================================
   Organizational Layers Card
   ============================================ */

.org-layers-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    overflow: hidden;
}

.org-layers-header {
    background: transparent;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-wrap: wrap;
    gap: 0.75rem;
    cursor: pointer;
    border-bottom: 2px solid var(--brand-amber-300);
}

.org-layers-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.org-layers-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.org-layers-header h4 svg {
    stroke: var(--gray-600);
    flex-shrink: 0;
}

.org-layers-body {
    padding: 1.5rem;
}

.org-layers-metrics-row .card-metric {
    min-height: 90px;
}

/* Layer Distribution Bar */
.org-layers-bar-wrapper {
    margin: 1rem 0;
}

.org-layers-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.org-layers-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.org-layers-bar-label {
    width: 70px;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    text-align: right;
    flex-shrink: 0;
}

.org-layers-bar-track {
    flex: 1;
    height: 24px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}

.org-layers-bar-fill {
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
    min-width: 30px;
    transition: width 0.3s ease;
}

.org-layers-bar-count {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: white;
}

/* Centered Funnel Visualization */
.org-funnel-wrapper {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.org-funnel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.org-funnel-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    flex: 1;
}

.org-funnel-header .card-subsection-rec-btn {
    margin-left: auto;
}

.org-funnel-shape-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    margin-bottom: 0.75rem;
}

.org-funnel-shape-indicator.shape-inverted {
    background: #fef3c7;
    color: #92400e;
}

.org-funnel-shape-indicator.shape-inverted svg {
    stroke: #f59e0b;
}

.org-funnel-shape-indicator.shape-healthy {
    background: #dcfce7;
    color: #166534;
}

.org-funnel-shape-indicator.shape-healthy svg {
    stroke: #22c55e;
}

.org-funnel {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.org-funnel-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.org-funnel-label {
    width: 60px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-align: right;
    flex-shrink: 0;
}

.org-funnel-bar-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.org-funnel-bar {
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    transition: width 0.3s ease;
}

.org-funnel-count {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: white;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Division cards with chevron */
.card-l3-mgr-card .card-l3-chevron {
    margin-left: auto;
    stroke: var(--gray-400);
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.card-l3-mgr-card--clickable:hover .card-l3-chevron {
    stroke: var(--gray-600);
    transform: translateX(2px);
}

/* Division Layers Modal */
.division-layers-modal {
    padding: 0.5rem 0;
}

.division-layers-metrics {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.division-layers-metrics .card-metric {
    min-width: 80px;
    text-align: center;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.division-layers-metrics .card-metric-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
}

.division-layers-metrics .card-metric-label {
    /* Inherits canonical L1 typography. Card-specific overrides removed
       per L1 lock 2026-06-22 (no uppercase, sentence case, single line). */
}

.division-comparison {
    text-align: center;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    margin-bottom: 1rem;
}

.division-comparison.comparison-deeper {
    background: #fef3c7;
    color: #92400e;
}

.division-comparison.comparison-shallower {
    background: #dcfce7;
    color: #166534;
}

.division-comparison.comparison-aligned {
    background: var(--gray-100);
    color: var(--gray-600);
}

.division-funnel {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: var(--radius-md);
}

/* Division Cards List (Horizontal row with mini funnels) */
.division-cards-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: stretch;
}

.division-layer-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 0.6rem;
    cursor: pointer;
    transition: all 0.15s ease;
    flex: 1;
    min-width: 140px;
    max-width: 200px;
    display: flex;
    flex-direction: column;
}

.division-layer-card:hover {
    border-color: var(--gray-300);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.division-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.division-card-header .card-l3-mgr-dot {
    margin-top: 2px;
}

.division-card-title {
    flex: 1;
    min-width: 0;
}

.division-card-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.division-shape-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: inline-block;
    margin-top: 0.15rem;
}

.division-shape-badge.shape-top-heavy {
    background: #fef3c7;
    color: #92400e;
}

.division-shape-badge.shape-healthy {
    background: #dcfce7;
    color: #166534;
}

.division-card-header .card-l3-chevron {
    display: none;
}

.division-card-meta {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.division-card-preview {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 0.4rem;
    margin-top: auto;
}

/* Mini Funnel (centered bars for division card preview) */
.mini-funnel {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mini-funnel-row {
    display: flex;
    justify-content: center;
}

.mini-funnel-bar {
    height: 12px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    transition: width 0.3s ease;
}

.mini-funnel-count {
    font-size: var(--text-2xs);
    font-weight: var(--font-semibold);
    color: white;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

.mini-funnel-empty {
    height: 12px;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .org-funnel-label {
        width: 45px;
        font-size: var(--text-xs);
    }

    .org-funnel-bar {
        min-width: 50px;
        height: 24px;
    }

    .org-funnel-count {
        font-size: var(--text-xs);
    }

    .division-layers-metrics {
        flex-wrap: wrap;
    }

    .division-layers-metrics .card-metric {
        flex: 1;
        min-width: 70px;
    }

    .division-cards-list {
        flex-wrap: wrap;
    }

    .division-layer-card {
        min-width: 120px;
        max-width: none;
        flex: 1 1 calc(50% - 0.25rem);
    }

    .mini-funnel-bar {
        height: 10px;
        min-width: 16px;
    }

    .mini-funnel-count {
        font-size: var(--text-2xs);
    }

    .mini-funnel-empty {
        height: 10px;
    }
}

/* ============================================
   Grade Pyramid Health Card
   ============================================ */

.grade-pyramid-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    overflow: hidden;
}

.grade-pyramid-header {
    background: transparent;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-wrap: wrap;
    gap: 0.75rem;
    cursor: pointer;
    border-bottom: 2px solid var(--brand-amber-300);
}

.grade-pyramid-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.grade-pyramid-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grade-pyramid-header h4 svg {
    stroke: var(--gray-600);
    flex-shrink: 0;
}

.grade-pyramid-body {
    padding: 1.5rem;
}

.grade-pyramid-metrics-row .card-metric {
    min-height: 90px;
}

/* Pyramid Visualization */
.grade-pyramid-viz {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 8px;
}

.pyramid-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.pyramid-tier {
    display: grid;
    grid-template-columns: 70px 1fr 40px 50px;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.pyramid-tier-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    text-align: right;
}

.pyramid-tier-bar-wrapper {
    height: 28px;
    background: var(--gray-100);
    border-radius: 4px;
    position: relative;
    margin: 0 auto;
}

.pyramid-tier-bar {
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease;
}

.pyramid-tier-pct {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: white;
}

.pyramid-tier-target {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-500);
}

.pyramid-tier-target::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -3px;
    width: 8px;
    height: 8px;
    background: var(--gray-500);
    border-radius: 50%;
}

.pyramid-tier-count {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    text-align: center;
}

.pyramid-tier-dev {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-align: center;
}

.pyramid-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

.pyramid-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.pyramid-legend-bar {
    width: 16px;
    height: 10px;
    background: var(--brand-indigo-400);
    border-radius: 2px;
}

.pyramid-legend-target {
    width: 8px;
    height: 8px;
    background: var(--gray-500);
    border-radius: 50%;
}

/* Grade Distribution Bar Chart */
.grade-dist-chart {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem 0;
}

.grade-dist-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.grade-dist-label {
    width: 80px;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    text-align: right;
    flex-shrink: 0;
}

.grade-dist-bar-track {
    flex: 1;
    height: 26px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: visible;
    display: flex;
    align-items: center;
    position: relative;
}

.grade-dist-bar-fill {
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
    min-width: 8px;
    transition: width 0.3s ease;
}

.grade-dist-bar-count {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: white;
}

.grade-dist-bar-count-outside {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    margin-left: 0.5rem;
}

.grade-dist-pct {
    width: 40px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-500);
    text-align: right;
    flex-shrink: 0;
}

.grade-dist-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

.grade-dist-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.grade-dist-legend-senior {
    width: 14px;
    height: 10px;
    background: hsl(210, 60%, 45%);
    border-radius: 2px;
}

.grade-dist-legend-arrow {
    font-size: var(--text-sm);
    color: var(--gray-400);
}

.grade-dist-legend-junior {
    width: 14px;
    height: 10px;
    background: hsl(210, 60%, 75%);
    border-radius: 2px;
}

@media (max-width: 640px) {
    .grade-dist-label {
        width: 60px;
        font-size: var(--text-xs);
    }
    .grade-dist-pct {
        width: 35px;
        font-size: var(--text-xs);
    }
}

/* Grade Distribution Vertical Bar Chart (New Design) */
.grade-dist-filter-container {
    margin: 1rem 0;
}

.grade-dist-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.grade-dist-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.grade-dist-filter-row .grade-dist-filter-pills {
    margin-bottom: 0;
}

.grade-dist-dept-pills {
    padding-left: 1rem;
    border-left: 2px solid var(--gray-200);
}

.grade-dist-vertical-chart {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    min-height: 250px;
}

.grade-dist-bars-wrapper {
    position: relative;
}

.grade-dist-trendline-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    display: none;
    z-index: 10;
}

.grade-dist-bars-container {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    min-height: 200px;
    padding-bottom: 1.5rem;
}

.grade-dist-bars-flat {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    justify-content: space-evenly;
    height: 180px;
    width: 100%;
    padding-top: 20px; /* Space for trendline above tallest bar */
    box-sizing: content-box;
}

.grade-dist-bars-flat .grade-dist-bar-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 0;
    min-width: 20px;
    max-width: 60px;
    height: 100%;
}

.grade-dist-bars-flat .grade-dist-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: calc(100% - 18px);
}

.grade-dist-bars-flat .grade-dist-vertical-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 2px;
}

.grade-dist-bars-flat .grade-dist-bar-value {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.grade-dist-bars-flat .grade-dist-bar-label {
    height: 18px;
    line-height: 18px;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    flex-shrink: 0;
}

.grade-dist-category-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 80px;
}

.grade-dist-category-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-500);
    text-align: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.grade-dist-category-bars {
    display: flex;
    gap: 4px;
    align-items: stretch;
    justify-content: center;
    height: 160px;
}

.grade-dist-category-group.empty .grade-dist-category-bars {
    align-items: center;
}

.grade-dist-empty-category {
    font-size: var(--text-sm);
    color: var(--gray-400);
    font-style: italic;
}

.grade-dist-bar-column {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 28px;
    max-width: 50px;
    flex: 1;
    padding-bottom: 18px; /* Fixed space for label */
}

.grade-dist-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    width: 100%;
}

.grade-dist-bar-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 16px;
    line-height: 16px;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grade-dist-vertical-bar {
    width: 100%;
    min-height: 4px;
    border-radius: 3px 3px 0 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    transition: opacity 0.15s ease;
}

.grade-dist-vertical-bar:hover {
    opacity: 0.85;
}

.grade-dist-bar-value {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: white;
    padding-bottom: 2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.grade-dist-bar-value-outside {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    margin-bottom: 2px;
}

/* Category Legend */
.grade-dist-category-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
}

.grade-dist-legend-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.grade-dist-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Direction Indicator */
.grade-dist-direction {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

.grade-dist-direction-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.grade-dist-direction-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--gray-300), var(--gray-200));
    max-width: 200px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .grade-dist-bars-container {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .grade-dist-category-group {
        flex-basis: calc(50% - 0.5rem);
    }

    .grade-dist-category-bars {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .grade-dist-category-group {
        flex-basis: 100%;
    }

    .grade-dist-bar-column {
        min-width: 24px;
    }

    .grade-dist-category-legend {
        gap: 0.5rem;
    }

    .grade-dist-legend-item {
        font-size: var(--text-xs);
    }
}

/* ============================================
   Workforce Segmentation Card
   ============================================ */

.workforce-segmentation-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    overflow: hidden;
}

.workforce-segmentation-header {
    background: transparent;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-wrap: wrap;
    gap: 0.75rem;
    cursor: pointer;
    border-bottom: 2px solid var(--brand-amber-300);
}

.workforce-segmentation-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.workforce-segmentation-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.workforce-segmentation-header h4 svg {
    stroke: var(--gray-600);
    flex-shrink: 0;
}

/* ============================================
   4-Screen Span Modal Navigation & Layout
   ============================================ */

/* Navigation dots bar */
.span-modal-nav {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.span-nav-dots {
    display: flex;
    align-items: center;
    gap: 0;
}

.span-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.span-nav-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gray-300);
    border: 2px solid var(--gray-300);
    transition: all 0.2s ease;
}

.span-nav-item.active .span-nav-dot {
    background: var(--primary);
    border-color: var(--primary);
}

.span-nav-item:hover:not(.active) .span-nav-dot {
    background: var(--gray-400);
    border-color: var(--gray-400);
}

.span-nav-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--gray-500);
    white-space: nowrap;
}

.span-nav-item.active .span-nav-label {
    color: var(--primary);
    font-weight: var(--font-semibold);
}

.span-nav-line {
    width: 60px;
    height: 2px;
    background: var(--gray-300);
    margin: 0 0.25rem;
    position: relative;
    top: -0.5rem;
}

/* Screen container */
.span-screens-container {
    height: 100%;
    overflow: hidden;
}

.span-screen {
    display: none;
    height: 100%;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.span-screen.active {
    display: block;
}

/* Simulation dropdown */
/* Simulation Pill Group */
.span-sim-pill-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.span-sim-pill {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1.5px solid var(--primary);
    border-radius: 20px;
    background: white;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.span-sim-pill:hover {
    background: #eef2ff;
}

.span-sim-pill.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 4px rgba(79, 70, 229, 0.3);
}

.span-sim-pill.active:hover {
    background: #4338ca;
    border-color: #4338ca;
}

.span-sim-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    transition: background 0.2s ease;
}

.span-sim-pill.active .span-sim-pill-dot {
    background: white;
    animation: sim-pulse 2s infinite;
}

@keyframes sim-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.span-sim-pill-l2 {
    padding: 0.35rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-color: var(--gray-300);
    color: var(--gray-500);
}

.span-sim-pill-l2:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #eef2ff;
}

.span-sim-pill-l2.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 1px 4px rgba(79, 70, 229, 0.3);
}

.span-sim-pill-view,
.span-sim-pill-reset {
    padding: 0.35rem;
    border-color: var(--gray-300);
    color: var(--gray-500);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    justify-content: center;
}

.span-sim-pill-view:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #eef2ff;
}

.span-sim-pill-view.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.span-sim-pill-reset:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: #fef2f2;
}

.span-sim-pill.hidden {
    display: none;
}

/* ============================================
   Screen 1: Analysis
   ============================================ */

/* New Optimise screen layout */
.span-optimise-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.span-optimise-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.span-optimise-stats .span-summary-stat {
    padding: 0.35rem 0.6rem;
}

.span-optimise-stats .span-stat-value {
    font-size: var(--text-base);
}

.span-summary-divider {
    width: 1px;
    height: 24px;
    background: var(--gray-300);
    margin: 0 0.25rem;
}

.span-summary-metrics-inline {
    display: flex;
    gap: 0.75rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.span-summary-metrics-inline strong {
    color: var(--gray-800);
}

.span-distribution-inline {
    width: 80%;
    min-width: 200px;
}

/* Top row with stats and impact card */
.span-optimise-top-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 1rem;
    flex-wrap: wrap;
}

.span-impact-wrapper {
    display: flex;
    justify-content: center;
    min-width: 140px;
}

.span-impact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    min-width: 120px;
}

.span-impact-card.impact-positive {
    background: #dcfce7;
    border-color: #86efac;
}

.span-impact-card.impact-negative {
    background: #fee2e2;
    border-color: #fca5a5;
}

.span-impact-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    margin-bottom: 0.15rem;
}

.span-impact-card.impact-positive .span-impact-label {
    color: #166534;
}

.span-impact-card.impact-negative .span-impact-label {
    color: #991b1b;
}

.span-impact-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}

.span-impact-card.impact-positive .span-impact-value {
    color: #166534;
}

.span-impact-card.impact-negative .span-impact-value {
    color: #991b1b;
}

.span-impact-mode {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.15rem;
}

.span-optimise-tree {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
}

/* Actions screen two-column layout */
.span-actions-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1rem;
    height: 100%;
}

.span-actions-left {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.span-actions-left-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.span-actions-left-header h4 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin: 0;
}

.span-actions-left-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.span-actions-right {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.span-actions-right .span-actions-summary {
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.span-actions-right .span-actions-steps {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.span-actions-right .span-actions-export {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Legacy analysis grid (keep for compatibility) */
.span-analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.span-analysis-summary,
.span-analysis-distribution {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
}

.span-analysis-summary h4,
.span-analysis-distribution h4,
.span-analysis-managers h4 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin: 0 0 0.75rem 0;
}

.span-summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.span-summary-stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-radius: 6px;
}

.span-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.span-summary-stat.status-ok .span-stat-dot { background: #22c55e; }
.span-summary-stat.status-under .span-stat-dot { background: #f59e0b; }
.span-summary-stat.status-over .span-stat-dot { background: #ef4444; }

.span-stat-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}

.span-stat-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.span-summary-range {
    font-size: var(--text-body);
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.span-range-cat {
    color: var(--gray-400);
    font-size: var(--text-sm);
}

.span-summary-metrics {
    display: flex;
    gap: 1rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.span-summary-metrics strong {
    color: var(--gray-800);
}

/* Distribution chart - Modern design with stacked dots */
.span-distribution-chart {
    padding: 0.5rem 0;
}

.span-dist-chart-modern {
    padding: 0.5rem;
    position: relative;
}

.span-dist-chart-modern.simulated {
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
}

.span-dist-sim-badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    padding: 0.15rem 0.4rem;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
}

.span-dist-bar-wrap {
    position: relative;
    padding-bottom: 1.5rem;
}

.span-dist-bar {
    position: relative;
    height: 20px;
    background: linear-gradient(to right, var(--gray-100), var(--gray-50));
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    overflow: visible;
}

.span-dist-range {
    position: absolute;
    top: -1px;
    bottom: -1px;
    background: var(--zone-target-fill);
    border-left: 2px dashed #22c55e;
    border-right: 2px dashed #22c55e;
    border-radius: 0;
}

.span-dist-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 1;
    transform: translateX(-50%);
}

.span-dist-dot:hover {
    transform: translateX(-50%) scale(1.3);
    z-index: 10;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.span-dist-dot.span-healthy { background: #22c55e; }
.span-dist-dot.span-narrow { background: #f59e0b; }
.span-dist-dot.span-critical { background: #f59e0b; }
.span-dist-dot.span-overloaded { background: #ef4444; }

/* Overflow indicator for stacked dots */
.span-dist-overflow {
    position: absolute;
    transform: translateX(-50%);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: white;
    background: var(--gray-500);
    padding: 1px 4px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 5;
    white-space: nowrap;
    transition: transform 0.15s ease;
}

.span-dist-overflow:hover {
    transform: translateX(-50%) scale(1.1);
    z-index: 10;
}

.span-dist-overflow.span-healthy { background: #16a34a; }
.span-dist-overflow.span-narrow { background: #d97706; }
.span-dist-overflow.span-critical { background: #d97706; }
.span-dist-overflow.span-overloaded { background: #dc2626; }

/* Multi-manager tooltip */
.span-dist-tooltip-multi {
    max-width: 200px;
    text-align: left;
}

.span-dist-tooltip-header {
    font-weight: var(--font-semibold);
    margin-bottom: 0.35rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.span-dist-tooltip-list {
    max-height: 150px;
    overflow-y: auto;
}

.span-dist-tooltip-item {
    padding: 0.15rem 0;
    font-size: var(--text-xs);
}

.span-dist-axis {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1.25rem;
}

.span-axis-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-weight: var(--font-medium);
}

.span-dist-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-100);
}

.span-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-xs);
    color: var(--gray-600);
}

.span-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.span-legend-dot.status-ok { background: #22c55e; }
.span-legend-dot.status-under { background: #f59e0b; }
.span-legend-dot.status-over { background: #ef4444; }

/* Bar area - clickable for toggle */
.span-dist-bar-area {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.25rem;
    margin: -0.25rem;
    border-radius: 6px;
    transition: background 0.15s;
}

.span-dist-bar-area:hover {
    background: var(--gray-50);
}

.span-dist-bar-area .span-dist-bar-wrap {
    flex: 1;
}

/* Toggle chevron */
.span-dist-toggle-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--gray-400);
    transition: transform 0.25s ease, color 0.15s;
    flex-shrink: 0;
    margin-top: 0.5rem;
}

.span-dist-toggle-chevron:hover {
    color: var(--gray-600);
}

/* Sticky bar wrapper */
.span-dist-sticky-bar {
    position: relative;
    background: white;
    transition: box-shadow 0.2s ease;
}

.span-dist-sticky-bar.fixed-sticky {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 0;
}

/* Placeholder to prevent content jump when bar becomes fixed */
.sticky-placeholder {
    flex-shrink: 0;
}

/* Collapsed state */
.span-dist-chart-modern.legend-collapsed .span-dist-legend {
    display: none;
}

.span-dist-chart-modern.legend-collapsed .span-dist-toggle-chevron {
    transform: rotate(-180deg);
}

/* Distribution dot tooltip */
.span-dist-tooltip {
    position: fixed;
    z-index: 10000;
    background: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: var(--text-sm);
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: tooltip-fade 0.15s ease-out;
    text-align: center;
}

/* Manager tiles grid */
.span-analysis-managers {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
}

.span-mgr-sort-hint {
    font-size: var(--text-xs);
    font-weight: var(--font-normal);
    color: var(--gray-400);
}

.span-mgr-tiles-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.span-mgr-tile {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    background: var(--gray-50);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.span-mgr-tile:hover {
    background: var(--gray-100);
}

.span-mgr-tile.status-ok { border-color: #22c55e; }
.span-mgr-tile.status-under { border-color: #f59e0b; }
.span-mgr-tile.status-over { border-color: #ef4444; }
.span-mgr-tile.status-critical { border-color: #dc2626; }

.span-mgr-initials {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--gray-700);
}

.span-mgr-span-num {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
}

/* ============================================
   Screen 2: Org View
   ============================================ */

.span-orgview-container {
    height: 100%;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Blocked Consolidations Banner */
.span-blocked-banner {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.span-blocked-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.span-blocked-icon {
    font-size: var(--text-base);
}

.span-blocked-title {
    font-weight: var(--font-semibold);
    color: #92400e;
    font-size: var(--text-body);
}

.span-blocked-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.blocked-consolidation-item {
    background: white;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #fcd34d;
}

.blocked-mgr-name {
    font-weight: var(--font-semibold);
    color: #1f2937;
    font-size: var(--text-body);
}

.blocked-mgr-grade {
    font-weight: var(--font-medium);
    color: #6b7280;
    font-size: var(--text-xs);
}

.blocked-reason {
    color: #92400e;
    font-size: var(--text-sm);
    margin-top: 0.15rem;
}

.blocked-employees {
    color: #6b7280;
    font-size: var(--text-xs);
    margin-top: 0.25rem;
}

.blocked-emp {
    background: #f3f4f6;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: var(--text-xs);
}

.blocked-employees-list {
    margin-top: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.blocked-emp-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.5rem;
    align-items: center;
    font-size: var(--text-xs);
    padding: 0.25rem 0.35rem;
    background: #fefce8;
    border-radius: 4px;
}

.blocked-emp-name {
    font-weight: var(--font-medium);
    color: #374151;
}

.blocked-emp-grade {
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 3px;
    color: #6b7280;
    font-size: var(--text-xs);
}

.blocked-emp-reason {
    color: #92400e;
    font-size: var(--text-xs);
    font-style: italic;
}

.span-blocked-suggestion {
    font-size: var(--text-sm);
    color: #78716c;
    font-style: italic;
    padding-top: 0.5rem;
    border-top: 1px dashed #fcd34d;
}

.span-org-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.5rem;
}

.span-org-grid.centered {
    justify-content: center;
}

.span-org-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    width: 160px;
    min-height: 80px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: visible;
}

.span-org-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.span-org-card.status-ok { border-color: #22c55e; }
.span-org-card.status-under { border-color: #f59e0b; }
.span-org-card.status-over { border-color: #ef4444; }
.span-org-card.status-critical { border-color: #dc2626; }

.span-org-card.reassigned {
    opacity: 0.6;
    background: var(--gray-100);
    border-color: var(--gray-300);
    pointer-events: none;
}

.span-org-card.reassigned .span-org-initials {
    background: var(--gray-300);
    color: var(--gray-500);
    filter: grayscale(100%);
}

.span-org-card.reassigned .span-org-card-content,
.span-org-card.reassigned .span-org-info,
.span-org-card.reassigned .span-org-card-name,
.span-org-card.reassigned .span-org-card-position {
    color: var(--gray-400);
    filter: grayscale(100%);
}

.span-org-card.reassigned .span-org-dots {
    opacity: 0.4;
    filter: grayscale(100%);
}

.span-org-card.reassigned .span-org-span-badge {
    filter: grayscale(100%);
}

/* Keep score colored on reassigned managers */
.span-org-card.reassigned .span-org-score {
    filter: none;
}

/* Division Manager Section */
/* Division Lead card - vertical format with indigo styling */
.span-org-card.span-org-card-vertical.span-org-card-division-lead {
    border-color: #4f46e5;
    border-width: 2px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    width: 270px;
}

.span-org-card.span-org-card-vertical.span-org-card-division-lead .span-org-card-firstname {
    color: #4338ca;
    font-weight: var(--font-bold);
}

.span-org-card.span-org-card-vertical.span-org-card-division-lead .span-org-card-lastname {
    color: #4f46e5;
}

.span-org-card.span-org-card-vertical.span-org-card-division-lead .span-org-card-dept {
    color: #6366f1;
}

.span-org-card.span-org-card-vertical.span-org-card-division-lead .span-org-card-title {
    color: #4338ca;
    font-weight: var(--font-semibold);
}

.span-org-card.span-org-card-vertical.span-org-card-division-lead .span-org-span-badge {
    background: #4f46e5;
    color: white;
}

.span-org-card.span-org-card-vertical.span-org-card-division-lead.not-assigned {
    border-style: dashed;
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.span-org-card.span-org-card-vertical.span-org-card-division-lead.not-assigned .span-org-card-firstname,
.span-org-card.span-org-card-vertical.span-org-card-division-lead.not-assigned .span-org-card-lastname {
    color: var(--gray-400);
    font-style: italic;
}

.span-org-card.span-org-card-vertical.span-org-card-division-lead.not-assigned .span-org-card-dept,
.span-org-card.span-org-card-vertical.span-org-card-division-lead.not-assigned .span-org-card-title {
    color: var(--gray-400);
}

/* Reporting Tree Structure */
.span-tree-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    gap: 0;
    position: relative;
    overflow-x: auto;
    min-width: min-content;
}

/* Template legend card */
.span-tree-template-card {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 150px;
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: 6px;
    padding: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 10;
}

.span-template-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    font-size: var(--text-2xs);
    color: var(--gray-500);
    font-style: italic;
}

.span-template-cell {
    padding: 0.15rem 0.3rem;
    line-height: 1.3;
}

.span-template-row {
    font-size: var(--text-2xs);
    color: var(--gray-500);
    font-style: italic;
    line-height: 1.3;
}

.span-template-metrics {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 2px 0;
}

.span-template-score {
    font-size: var(--text-2xs);
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 1px 4px;
    border-radius: 2px;
}

.span-template-span {
    font-size: var(--text-2xs);
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 1px 4px;
    border-radius: 2px;
}

.span-template-dots {
    font-size: var(--text-2xs);
    color: var(--gray-400);
}

.span-template-hint {
    font-size: var(--text-2xs);
    color: var(--gray-400);
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed var(--gray-200);
    width: 100%;
}

/* Template card row hover effect */
.span-template-row {
    cursor: help;
    padding: 1px 2px;
    border-radius: 2px;
    transition: background 0.15s;
}

.span-template-row:hover {
    background: var(--gray-100);
}

.span-template-score,
.span-template-span {
    cursor: help;
    transition: background 0.15s;
}

.span-template-score:hover,
.span-template-span:hover {
    background: var(--gray-300);
}

/* Row-based tree layout */
.span-tree-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.5rem 0;
    position: relative;
}

.span-tree-row.span-tree-header-row {
    padding: 0.75rem 0;
}

.span-tree-row-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
}

.span-tree-card-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.span-tree-cards-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.span-tree-cards-wrap.single-card {
    justify-content: center;
}

/* Group connectors hidden - using CSS pseudo-elements instead */
.span-tree-group-connector {
    display: none;
}

.span-tree-orphan-caption {
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-style: italic;
    text-align: center;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    border-top: 1px dashed var(--gray-300);
}

/* Header cards for GM and N-1 */
.span-tree-header-card {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    text-align: center;
    min-width: 120px;
}

.span-header-card-name {
    font-weight: var(--font-semibold);
    font-size: var(--text-body);
    color: var(--gray-800);
}

.span-header-card-title {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.span-tree-n1-card {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-indigo-100) 100%);
    border-color: var(--brand-indigo-200);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.span-n1-arrow {
    font-size: var(--text-body);
    color: var(--brand-indigo-400);
}

.span-n1-label {
    font-size: var(--text-xs);
    color: var(--brand-indigo-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.span-n1-name {
    font-weight: var(--font-semibold);
    font-size: var(--text-body);
    color: var(--brand-indigo-700);
}

.span-n1-position {
    font-size: var(--text-xs);
    color: var(--brand-indigo-600);
}

.span-n1-dept,
.span-n1-division {
    font-size: var(--text-xs);
    color: var(--brand-indigo-400);
}

/* GM card — subtle gray gradient */
.span-org-card-gm {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border-color: var(--gray-300);
}

.span-org-card-gm .span-org-card-firstname {
    color: var(--gray-800);
}

.span-org-card-gm .span-org-card-lastname {
    color: var(--gray-600);
}

.span-org-card-gm .span-org-card-title {
    color: var(--gray-500);
}

/* N-1 Division Lead card — indigo accent */
.span-org-card-n1 {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-color: #a5b4fc;
}

.span-org-card-n1 .span-org-card-firstname {
    color: #4338ca;
}

.span-org-card-n1 .span-org-card-lastname {
    color: #4f46e5;
}

.span-org-card-n1 .span-org-card-title {
    color: #6366f1;
}

.span-org-card-n1 .span-org-card-dept {
    color: #818cf8;
}

.span-tree-level {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: nowrap;
    flex: 1;
}

.span-tree-level-division {
    margin-bottom: 0;
}

.span-tree-level-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: max-content;
    gap: 1rem;
    position: relative;
    padding: 1rem 0;
}

.span-tree-level-label {
    position: absolute;
    right: 0.5rem;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.35rem 0.5rem;
    background: var(--gray-100);
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
}

/* Vertical lines above and below the N label */
.span-tree-level-label::before,
.span-tree-level-label::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background: var(--gray-300);
}

.span-tree-level-label::before {
    bottom: 100%;
    height: 1rem;
}

.span-tree-level-label::after {
    top: 100%;
    height: 1rem;
}

.span-tree-level-sublabel {
    font-size: var(--text-xs);
    font-weight: var(--font-normal);
    color: var(--gray-400);
    text-transform: none;
}

.span-tree-level-wrapper .span-tree-level,
.span-tree-level-wrapper .span-tree-children {
    flex: 1;
}

.span-tree-card-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.span-tree-card-wrapper.reports-open {
    z-index: 9998;
}

/* Connector lines - using SVG overlay instead of CSS pseudo-elements */
.span-tree-card-wrapper::before,
.span-tree-card-wrapper::after {
    display: none;
}

/* External reporting badge - shows when manager reports outside department */
.span-external-report-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #4f46e5;
    color: white;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: var(--text-xs);
    line-height: 1.3;
    text-align: center;
    min-width: 80px;
    max-width: 110px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.span-external-arrow {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    margin-bottom: 2px;
}

.span-external-label {
    font-size: var(--text-xs);
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.span-external-name {
    font-weight: var(--font-semibold);
    font-size: var(--text-xs);
    word-break: break-word;
    margin-top: 2px;
}

.span-external-dept {
    font-size: var(--text-xs);
    opacity: 0.9;
    font-style: italic;
}

.span-external-connector {
    width: 0;
    height: 10px;
    border-left: 2px dashed #4f46e5;
}

/* Different division badge for division leads */
.span-diff-division-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f59e0b;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    margin-bottom: 6px;
    white-space: nowrap;
}

.span-diff-division-icon {
    font-size: var(--text-xs);
}

.span-diff-division-text {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Adjust card wrapper when has external report */
.span-tree-card-wrapper.has-external-report::before {
    display: none; /* Hide normal connector line */
}

.span-tree-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 20px;
    position: relative;
}

/* Nested branch structure */
.span-tree-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.span-tree-level-top {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: nowrap;
}

.span-tree-children-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 20px;
    position: relative;
}

.span-tree-children-connector .span-tree-line-vertical {
    width: 2px;
    height: 20px;
    background: var(--gray-400);
}

.span-tree-children-connector .span-tree-line-horizontal {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 2px;
    background: var(--gray-400);
    min-width: 100%;
}

.span-tree-children {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: nowrap;
    position: relative;
}

/* Child branch connectors */
.span-tree-children > .span-tree-branch {
    position: relative;
    flex: 1;
}

.span-tree-children > .span-tree-branch::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 50%;
    width: 2px;
    height: 16px;
    background: var(--gray-400);
}

/* Horizontal line connecting siblings */
.span-tree-children > .span-tree-branch:not(:first-child):not(:last-child)::after {
    content: '';
    position: absolute;
    top: -16px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gray-400);
}

.span-tree-children > .span-tree-branch:first-child:not(:last-child)::after {
    content: '';
    position: absolute;
    top: -16px;
    left: 50%;
    right: 0;
    height: 2px;
    background: var(--gray-400);
}

.span-tree-children > .span-tree-branch:last-child:not(:first-child)::after {
    content: '';
    position: absolute;
    top: -16px;
    left: 0;
    right: 50%;
    height: 2px;
    background: var(--gray-400);
}

/* Single child - no horizontal line */
.span-tree-children > .span-tree-branch:only-child::after {
    display: none;
}

.span-tree-line-vertical {
    width: 2px;
    height: 20px;
    background: var(--gray-400);
}

.span-tree-line-horizontal {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: var(--gray-400);
    width: calc(100% - 80px);
    max-width: 600px;
    min-width: 80px;
}

.span-tree-caption {
    font-size: var(--text-sm);
    color: var(--gray-500);
    text-align: center;
    padding: 0.5rem 1rem;
    background: var(--gray-50);
    border-radius: 4px;
    margin: 0.5rem 0;
}

.span-tree-summary {
    font-size: var(--text-xs);
    color: var(--gray-400);
    text-align: center;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.span-tree-separator {
    width: 100%;
    height: 1px;
    background: var(--gray-200);
    margin: 1.5rem 0;
}

/* Placeholder card for unknown managers */
.span-org-card.span-org-card-placeholder {
    border: 2px dashed var(--gray-300);
    background: var(--gray-50);
}

.span-org-card.span-org-card-placeholder .span-org-initials {
    background: var(--gray-300);
    color: var(--gray-500);
}

.span-org-card.span-org-card-placeholder .span-org-card-name {
    color: var(--gray-400);
    font-style: italic;
}

.span-org-card.span-org-card-placeholder .span-org-card-meta {
    color: var(--gray-400);
    font-size: var(--text-xs);
}

.span-tree-level-placeholder {
    display: flex;
    justify-content: center;
}

/* Tree cards match original card dimensions */
.span-tree-card-wrapper .span-org-card {
    height: auto;
    width: 270px;
    flex: 0 0 auto;
}

/* Wide grid card layout */
.span-org-card.span-org-card-vertical {
    width: 270px;
    height: auto;
    min-height: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.span-org-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    width: 100%;
}

.span-org-card-cell {
    padding: 0.2rem 0.5rem;
    min-width: 0;
    overflow: hidden;
}

/* Row 1: Name (full width) */
.span-org-card-name {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.3rem;
    align-items: baseline;
}

.span-org-card-name .span-org-card-firstname {
    font-size: 0.8rem;
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.span-org-card-name .span-org-card-lastname {
    font-size: 0.75rem;
    font-weight: var(--font-medium);
    color: var(--gray-600);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Row 2: Title + Department (full width) */
.span-org-card-role-row {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.span-org-card-role-row .span-org-card-title {
    font-size: 0.7rem;
    font-weight: var(--font-medium);
    color: var(--gray-700);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.span-org-card-role-row .span-org-card-dept {
    font-size: 0.65rem;
    color: var(--gray-400);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Row 3 left: Reports count */
.span-org-card-reports-cell {
    display: flex;
    align-items: center;
    gap: 4px;
}

.span-org-card-reports-label {
    font-size: 0.65rem;
    color: var(--gray-500);
}

/* Row 3 right: Score + Grade */
.span-org-card-meta-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.span-org-card-score-inline {
    display: flex;
    align-items: center;
}

.span-org-card-grade {
    font-size: 0.65rem;
    font-weight: var(--font-medium);
    color: var(--gray-500);
}

.span-org-card-vertical .span-org-score {
    font-size: var(--text-xs);
    padding: 0.1rem 0.25rem;
}

.span-org-card-vertical .span-org-span-badge {
    font-size: var(--text-xs);
    padding: 0.1rem 0.25rem;
}

/* Expansion cards section below tree */
.span-optimize-expansions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.span-optimize-expansions::before {
    content: 'Proposed New Managers';
    display: block;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-400);
    margin-bottom: 0.75rem;
    text-align: center;
}

.span-org-card-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.span-org-initials {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    flex-shrink: 0;
}

.span-org-info {
    flex: 1;
    min-width: 0;
}

.span-org-card-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.span-org-card-meta {
    font-size: var(--text-xs);
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.span-org-card-position {
    font-size: var(--text-xs);
    color: var(--gray-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    margin-top: 2px;
    padding: 0 2px;
    font-weight: var(--font-medium);
}

.span-org-grade {
    font-weight: var(--font-medium);
    color: var(--gray-600);
}

.span-org-span-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    background: var(--gray-100);
    color: var(--gray-700);
    flex-shrink: 0;
}

.span-org-span-badge.status-ok { background: #dcfce7; color: #166534; }
.span-org-span-badge.status-under { background: #fef3c7; color: #92400e; }
.span-org-span-badge.status-over { background: #fee2e2; color: #991b1b; }
.span-org-span-badge.status-critical { background: #fee2e2; color: #7f1d1d; }

/* Manager score badge (shown during simulation) */
.span-org-score {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    margin-right: 0.25rem;
    position: relative;
    cursor: help;
    flex-shrink: 0;
}

.span-org-score.score-high {
    background: #dcfce7;
    color: #166534;
}

.span-org-score.score-mid {
    background: #fef3c7;
    color: #92400e;
}

.span-org-score.score-low {
    background: #fee2e2;
    color: #991b1b;
}

/* Manager score tooltip */
.span-score-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 6px;
    background: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: var(--text-xs);
    font-weight: var(--font-normal);
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
}

.span-score-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #1f2937;
}

.span-org-score:hover .span-score-tooltip {
    display: block;
}

.span-score-tooltip-title {
    font-weight: var(--font-semibold);
    margin-bottom: 0.4rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.span-score-tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.15rem 0;
    font-size: var(--text-xs);
}

.span-score-tooltip-row span:first-child {
    color: #9ca3af;
}

.span-score-tooltip-row span:last-child {
    font-weight: var(--font-medium);
}

.span-org-status-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.15rem;
}

.span-org-dots-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 0.2rem;
    overflow: hidden;
    max-height: 14px;
}

/* Employee cards (for <5 managers) */
.span-org-employees {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.span-emp-card {
    display: flex;
    flex-direction: column;
    padding: 0.4rem 0.5rem;
    background: var(--gray-50);
    border-radius: 4px;
    border-left: 3px solid var(--gray-300);
    transition: all 0.2s ease;
}

.span-emp-card.transferred {
    background: #eff6ff;
    border-left-color: var(--primary);
    animation: emp-transfer 0.4s ease-out;
}

.span-emp-name {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-700);
}

.span-emp-position {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

@keyframes emp-transfer {
    0% {
        opacity: 0;
        transform: translateX(-20px);
        background: #dbeafe;
    }
    100% {
        opacity: 1;
        transform: translateX(0);
        background: #eff6ff;
    }
}

/* Employee dots */
.span-org-dots-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 0.35rem;
    flex: 1;
    align-content: flex-start;
    overflow: hidden;
    position: relative;
}

.span-emp-dot {
    font-size: var(--text-xs);
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
}

.span-emp-dot:hover {
    color: var(--primary);
    transform: scale(1.3);
}

.span-emp-dot.transferred {
    color: var(--primary);
}

.span-emp-dot.animate-transfer {
    animation: dot-arrive 0.3s ease-out;
}

.span-dots-more {
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-weight: var(--font-medium);
    margin-left: 4px;
}

/* Dynamic dot sizing based on team size */
.dots-large .span-emp-dot {
    font-size: var(--text-xs);
}

.dots-medium .span-emp-dot {
    font-size: var(--text-2xs);
}

.dots-small .span-emp-dot {
    font-size: var(--text-2xs);
}

.dots-tiny .span-emp-dot {
    font-size: var(--text-2xs);
}

/* Adjust spacing for smaller dots */
.dots-medium {
    gap: 1px;
}

.dots-small {
    gap: 0;
}

.dots-tiny {
    gap: 0;
    letter-spacing: -1px;
}

/* Smaller overflow text for smaller dots */
.dots-small .span-dots-more,
.dots-tiny .span-dots-more {
    font-size: var(--text-2xs);
}

@keyframes dot-arrive {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        transform: scale(1.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Employee tooltip */
.span-emp-tooltip {
    position: fixed;
    z-index: 10000;
    background: #1f2937;
    color: white;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-size: var(--text-sm);
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: tooltip-fade 0.15s ease-out;
}

.span-emp-tooltip-name {
    font-weight: var(--font-semibold);
}

.span-emp-tooltip-pos {
    font-size: var(--text-xs);
    color: #9ca3af;
    margin-top: 2px;
}

@keyframes tooltip-fade {
    0% { opacity: 0; transform: translateX(-50%) translateY(-90%); }
    100% { opacity: 1; transform: translateX(-50%) translateY(-100%); }
}

/* ============================================
   Screen 3: Optimize
   ============================================ */

/* Override parent overflow for optimize screen */
.span-screen:has(.span-optimize-layout) {
    overflow: hidden;
}

.span-optimize-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.span-optimize-controls,
.span-optimize-preview {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0; /* Allow flex children to shrink */
}

.span-optimize-content-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.span-optimize-controls h4,
.span-optimize-preview h4 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin: 0 0 0.75rem 0;
    flex-shrink: 0;
}

.span-optimize-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.span-optimize-header h4 {
    margin: 0;
}

.span-optimize-mode {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    padding: 0.2rem 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
}

.span-blocked-summary {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.span-blocked-count {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: #92400e;
}

.span-blocked-hint {
    font-size: var(--text-xs);
    color: #78716c;
}

.span-consol-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Consolidation header row */
.span-consol-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.span-consol-header-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.span-consol-help-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: var(--text-xs);
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.15s ease;
}

.span-consol-help-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

.span-consol-help-btn svg {
    stroke: currentColor;
}

/* Manager score display */
.span-consol-mgr-score {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    margin: 0.25rem 0;
}

.span-consol-manager.retain .span-consol-mgr-score {
    color: #059669;
}

.span-consol-manager.reassign .span-consol-mgr-score {
    color: #dc2626;
}

/* Manager scoring help popup */
.manager-scoring-help {
    font-size: var(--text-body);
    line-height: 1.5;
}

.manager-scoring-help > p {
    margin-bottom: 1rem;
    color: var(--gray-600);
}

.scoring-factors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.scoring-factor {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.scoring-factor-weight {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--brand-indigo-600);
    background: var(--brand-indigo-100);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    min-width: 60px;
}

.scoring-factor-name {
    font-weight: var(--font-semibold);
    font-size: var(--text-body);
    color: var(--gray-800);
}

.scoring-factor p {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin: 0;
    line-height: 1.4;
}

.scoring-note {
    background: var(--brand-indigo-50);
    border-left: 3px solid var(--brand-indigo-500);
    padding: 0.75rem;
    border-radius: 0 6px 6px 0;
    font-size: var(--text-body);
    color: var(--gray-700);
}

.scoring-note strong {
    color: var(--gray-800);
}

.span-consol-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.75rem;
}

.span-consol-card.blocked {
    opacity: 0.6;
    background: #fef3c7;
    border-color: #f59e0b;
}

.span-consol-blocked-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.15rem 0.4rem;
    background: #f59e0b;
    color: white;
    border-radius: 3px;
    margin-left: 0.5rem;
}

.span-consol-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.span-consol-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.2rem 0.5rem;
    background: var(--gray-100);
    border-radius: 4px;
    color: var(--gray-600);
}

.span-consol-savings {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: #059669;
}

.span-consol-comparison {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.span-consol-manager {
    flex: 1;
    padding: 0.5rem;
    border-radius: 6px;
}

.span-consol-manager.retain {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
}

.span-consol-manager.reassign {
    background: #fef2f2;
    border: 1px solid #fca5a5;
}

.span-consol-mgr-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.span-consol-manager.retain .span-consol-mgr-label { color: #059669; }
.span-consol-manager.reassign .span-consol-mgr-label { color: #dc2626; }

.span-consol-mgr-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 0.15rem;
}

.span-consol-mgr-score {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-bottom: 0.15rem;
}

.span-consol-mgr-span {
    font-size: var(--text-xs);
    color: var(--gray-600);
}

.span-consol-arrow {
    font-size: var(--text-lg);
    color: var(--gray-400);
}

.span-consol-mgr-meta {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-bottom: 0.15rem;
}

/* Expansion Section */
.span-expansion-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--gray-300);
}

.span-expansion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.span-expansion-header h4 {
    margin: 0;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.span-expansion-count {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.2rem 0.5rem;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 4px;
}

.span-expansion-hint {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

.span-expansion-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.span-expansion-card {
    background: white;
    border: 2px dashed #60a5fa;
    border-radius: 8px;
    padding: 0.75rem;
}

.span-expansion-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.span-expansion-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.span-expansion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 50%;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
}

.span-expansion-cost {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: #dc2626;
}

.span-expansion-projected {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.span-expansion-candidate {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.span-expansion-candidate.external {
    background: #fef3c7;
    border-color: #fcd34d;
}

.span-expansion-candidate-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    color: #059669;
    margin-bottom: 0.15rem;
}

.span-expansion-candidate.external .span-expansion-candidate-label {
    color: #d97706;
}

.span-expansion-candidate-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.span-expansion-candidate-meta {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.span-expansion-readiness {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.span-expansion-readiness.ready {
    background: #dcfce7;
    color: #166534;
}

.span-expansion-readiness.develop {
    background: #fef3c7;
    color: #92400e;
}

.span-expansion-readiness.external {
    background: #fee2e2;
    color: #991b1b;
}

.span-expansion-runners {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.span-expansion-reassign {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-100);
}

.span-expansion-reassign-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.span-expansion-emp-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.span-expansion-emp-dot {
    color: #60a5fa;
    font-size: var(--text-2xs);
}

.span-expansion-emp-more {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-left: 0.25rem;
}

/* Preview expansion cards */
.span-preview-card.expansion-card {
    border: 2px dashed #60a5fa;
    background: #f0f9ff;
}

.span-preview-initials.expansion-initials {
    background: #dbeafe;
    color: #1d4ed8;
}

.span-preview-label.expansion-label {
    color: #1d4ed8;
    font-style: italic;
}

.span-emp-dot.expansion-dot {
    color: #60a5fa;
}

/* Preview panel */
.span-preview-container {
    flex: 1;
    overflow: auto;
    min-height: 0;
    display: block;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 8px;
    transition: opacity 0.15s ease;
}

.span-preview-container.refreshing {
    opacity: 0.5;
}

.span-preview-card {
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.6rem;
    min-width: 160px;
    max-width: 220px;
    flex: 1 1 180px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.span-preview-card.status-ok { border-color: #22c55e; }
.span-preview-card.status-under { border-color: #f59e0b; }
.span-preview-card.status-over { border-color: #ef4444; }
.span-preview-card.status-critical { border-color: #dc2626; }

.span-preview-card.reassigned {
    opacity: 0.6;
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.span-preview-card.reassigned .span-preview-initials {
    background: var(--gray-300);
    color: var(--gray-500);
    filter: grayscale(100%);
}

.span-preview-card.reassigned .span-preview-name,
.span-preview-card.reassigned .span-preview-meta {
    color: var(--gray-400);
    filter: grayscale(100%);
}

.span-preview-card.reassigned .span-preview-span {
    filter: grayscale(100%);
}

.span-preview-card.reassigned .span-preview-dots-wrap {
    filter: grayscale(100%);
}

.span-preview-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
}

.span-preview-initials {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    flex-shrink: 0;
}

.span-preview-info {
    flex: 1;
    min-width: 0;
}

.span-preview-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.span-preview-meta {
    font-size: var(--text-xs);
    color: var(--gray-500);
    display: block;
}

.span-preview-span {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: var(--gray-100);
}

.span-preview-span.status-ok { background: #dcfce7; color: #166534; }
.span-preview-span.status-under { background: #fef3c7; color: #92400e; }
.span-preview-span.status-over { background: #fee2e2; color: #991b1b; }
.span-preview-span.status-critical { background: #fee2e2; color: #7f1d1d; }

.span-preview-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

/* Preview employee cards (for <5 managers) */
.span-preview-employees {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 120px;
    overflow-y: auto;
}

.span-emp-mini {
    padding: 0.25rem 0.4rem;
    background: var(--gray-50);
    border-radius: 3px;
    border-left: 2px solid var(--gray-300);
    transition: all 0.2s ease;
}

.span-emp-mini.transferred {
    background: #eff6ff;
    border-left-color: var(--primary);
}

.span-emp-mini.animate-transfer {
    animation: emp-mini-transfer 0.4s ease-out;
}

@keyframes emp-mini-transfer {
    0% {
        opacity: 0;
        transform: translateX(-15px);
        background: #dbeafe;
    }
    100% {
        opacity: 1;
        transform: translateX(0);
        background: #eff6ff;
    }
}

.span-emp-mini-name {
    font-size: var(--text-xs);
    color: var(--gray-700);
}

/* Preview employee dots (for ≥5 managers) */
.span-preview-dots-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

/* ============================================
   Screen 4: Actions
   ============================================ */

.span-actions-container {
    padding: 0.5rem;
}

.span-optimize-inactive {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    color: var(--gray-500);
    text-align: center;
}

.span-optimize-inactive svg {
    stroke: var(--gray-400);
}

.span-optimize-inactive p {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    margin: 0;
    color: var(--gray-600);
}

.span-optimize-inactive span {
    font-size: var(--text-body);
    color: var(--gray-500);
}

.span-actions-summary {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.span-actions-summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: var(--text-body);
    color: var(--gray-600);
}

.span-actions-summary-stats strong {
    color: var(--gray-800);
}

.span-savings-value {
    color: #059669 !important;
}

.span-actions-steps {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.span-action-step {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
}

.span-action-step h5 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin: 0 0 0.75rem 0;
}

.span-action-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.span-action-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.span-action-primary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    color: var(--gray-800);
    margin-bottom: 0.35rem;
}

.span-action-icon {
    font-size: var(--text-body);
    width: 1.25rem;
    text-align: center;
}

.span-action-transfers {
    padding-left: 1.75rem;
}

.span-action-transfer {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
    padding: 0.15rem 0;
}

.span-transfer-line {
    color: var(--gray-400);
    font-family: monospace;
    font-size: var(--text-xs);
}

.span-action-detail {
    font-size: var(--text-sm);
    color: var(--gray-500);
    padding-left: 1.75rem;
}

.span-actions-export {
    display: flex;
    justify-content: center;
}

.span-actions-export .btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Responsive */
@media (max-width: 900px) {
    .span-analysis-grid {
        grid-template-columns: 1fr;
    }
    .span-optimize-layout {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Interactive Org Chart (Insights Tab)
   ============================================ */

/* Container */
.interactive-orgchart {
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: 12px;
    min-height: 500px;
}

/* Toolbar */
.orgchart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    flex-wrap: wrap;
}

.orgchart-toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.orgchart-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.orgchart-property-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.orgchart-property-name {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.orgchart-property-meta {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

/* Overlay Toggle */
.orgchart-overlay-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.orgchart-overlay-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-500);
}

/* Deprecated 2026-06-11: .orgchart-overlay-select replaced by .form-group-sm select. */

/* Expand/Collapse Controls */
.orgchart-expand-controls {
    display: flex;
    gap: 0.5rem;
}

.orgchart-expand-btn {
    padding: 0.4rem 0.75rem;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.orgchart-expand-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

/* Legend */
.orgchart-legend {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.orgchart-legend-title {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.orgchart-legend-items {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.orgchart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-xs);
    color: var(--gray-600);
}

.orgchart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.orgchart-legend-dot.legend-red { background: var(--danger); }
.orgchart-legend-dot.legend-amber { background: var(--brand-amber-600); }
.orgchart-legend-dot.legend-green { background: var(--brand-green-600); }
.orgchart-legend-dot.legend-blue { background: var(--primary); }

/* Tree Canvas */
.orgchart-canvas {
    background: white;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    overflow-x: auto;
    overflow-y: visible;
    min-height: 400px;
}

.orgchart-tree {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

/* Node Card */
.orgchart-node {
    position: relative;
    margin-bottom: 0.5rem;
}

.orgchart-node-card {
    display: flex;
    align-items: stretch;
    min-width: 220px;
    max-width: 280px;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.orgchart-node-card:hover {
    border-color: var(--gray-300);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.orgchart-node-card.selected {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Department color stripe */
.orgchart-node-stripe {
    width: 6px;
    flex-shrink: 0;
}

.orgchart-node-main {
    flex: 1;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.orgchart-node-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.orgchart-node-info {
    flex: 1;
    min-width: 0;
}

.orgchart-node-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    line-height: 1.3;
    margin-bottom: 0.1rem;
}

.orgchart-node-jobtitle {
    font-size: var(--text-xs);
    color: var(--gray-500);
    line-height: 1.3;
}

.orgchart-node-dept-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
}

/* Metrics row */
.orgchart-node-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.orgchart-metric {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--text-xs);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: var(--font-medium);
}

.orgchart-metric-label {
    color: var(--gray-500);
}

.orgchart-metric-value {
    font-weight: var(--font-semibold);
}

/* Metric colors */
.orgchart-metric.metric-red {
    background: var(--danger-lighter);
    color: var(--danger);
}

.orgchart-metric.metric-amber {
    background: var(--warning-lighter);
    color: var(--brand-amber-600);
}

.orgchart-metric.metric-green {
    background: var(--brand-green-50);
    color: var(--brand-green-600);
}

.orgchart-metric.metric-blue {
    background: var(--primary-lighter);
    color: var(--primary);
}

.orgchart-metric.metric-neutral {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Expand button */
.orgchart-node-expand {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--brand-indigo-500);
    border: 2px solid white;
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    z-index: 10;
}

.orgchart-node-expand:hover {
    background: var(--primary);
    transform: translateX(-50%) scale(1.1);
}

.orgchart-node-expand.expanded {
    background: var(--gray-400);
}

/* Children container */
.orgchart-node-children {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    margin-left: 2rem;
    padding-left: 1.5rem;
    padding-top: 1rem;
    border-left: 2px solid var(--gray-200);
    position: relative;
}

.orgchart-node-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    width: 1.5rem;
    height: 2px;
    background: var(--gray-200);
}

.orgchart-node-children.collapsed {
    display: none;
}

/* Tree connectors for each child */
.orgchart-node-children > .orgchart-node {
    position: relative;
}

.orgchart-node-children > .orgchart-node::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 1.25rem;
    width: 1.5rem;
    height: 2px;
    background: var(--gray-200);
}

/* Department color classes */
.dept-executive .orgchart-node-stripe { background: #e8c547; }
.dept-executive .orgchart-node-card.selected { border-color: #e8c547; }
.dept-executive .orgchart-node-dept-badge { background: #fef9e7; color: var(--brand-amber-800); }

.dept-rooms .orgchart-node-stripe { background: #4ea8de; }
.dept-rooms .orgchart-node-card.selected { border-color: #4ea8de; }
.dept-rooms .orgchart-node-dept-badge { background: #e8f4fc; color: var(--brand-indigo-700); }

.dept-fnb .orgchart-node-stripe { background: #b07cd8; }
.dept-fnb .orgchart-node-card.selected { border-color: #b07cd8; }
.dept-fnb .orgchart-node-dept-badge { background: #f5eefa; color: var(--brand-pink-600); }

.dept-finance .orgchart-node-stripe { background: #5cb85c; }
.dept-finance .orgchart-node-card.selected { border-color: #5cb85c; }
.dept-finance .orgchart-node-dept-badge { background: #e8f5e8; color: var(--brand-green-800); }

.dept-hr .orgchart-node-stripe { background: #e88a4e; }
.dept-hr .orgchart-node-card.selected { border-color: #e88a4e; }
.dept-hr .orgchart-node-dept-badge { background: #fef0e8; color: #c2410c; }

.dept-tech .orgchart-node-stripe { background: #4ecdc4; }
.dept-tech .orgchart-node-card.selected { border-color: #4ecdc4; }
.dept-tech .orgchart-node-dept-badge { background: #e8faf9; color: #0f766e; }

.dept-sales .orgchart-node-stripe { background: #e84e6a; }
.dept-sales .orgchart-node-card.selected { border-color: #e84e6a; }
.dept-sales .orgchart-node-dept-badge { background: #fce8ec; color: #be123c; }

.dept-operations .orgchart-node-stripe { background: var(--brand-indigo-500); }
.dept-operations .orgchart-node-card.selected { border-color: var(--brand-indigo-500); }
.dept-operations .orgchart-node-dept-badge { background: var(--brand-indigo-50); color: var(--brand-indigo-700); }

.dept-engineering .orgchart-node-stripe { background: #78716c; }
.dept-engineering .orgchart-node-card.selected { border-color: #78716c; }
.dept-engineering .orgchart-node-dept-badge { background: #f5f5f4; color: #44403c; }

.dept-security .orgchart-node-stripe { background: #71717a; }
.dept-security .orgchart-node-card.selected { border-color: #71717a; }
.dept-security .orgchart-node-dept-badge { background: #f4f4f5; color: #3f3f46; }

.dept-other .orgchart-node-stripe { background: var(--gray-400); }
.dept-other .orgchart-node-card.selected { border-color: var(--gray-400); }
.dept-other .orgchart-node-dept-badge { background: var(--gray-100); color: var(--gray-600); }

/* Slide-out Modal */
.modal-slideout {
    justify-content: flex-end;
}

.modal-slideout .modal-slideout-content {
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    animation: slideInRight 0.25s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.orgchart-modal-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--brand-indigo-500) 0%, var(--primary) 100%);
    border-bottom: none;
}

.orgchart-modal-title h3 {
    color: white;
    font-size: var(--text-lg);
    margin: 0 0 0.25rem 0;
}

.orgchart-node-subtitle {
    color: rgba(255,255,255,0.8);
    font-size: var(--text-body);
}

.orgchart-modal-header .modal-close {
    color: white;
    opacity: 0.8;
}

.orgchart-modal-header .modal-close:hover {
    opacity: 1;
}

.orgchart-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Node detail sections */
.orgchart-detail-section {
    margin-bottom: 1.5rem;
}

.orgchart-detail-section-title {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.orgchart-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.orgchart-detail-item {
    background: var(--gray-50);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.orgchart-detail-item.full-width {
    grid-column: span 2;
}

.orgchart-detail-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.orgchart-detail-value {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.orgchart-detail-value.value-red { color: var(--danger); }
.orgchart-detail-value.value-amber { color: var(--brand-amber-600); }
.orgchart-detail-value.value-green { color: var(--brand-green-600); }
.orgchart-detail-value.value-blue { color: var(--primary); }

/* Direct reports list */
.orgchart-reports-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.orgchart-report-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    background: var(--gray-50);
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.15s ease;
}

.orgchart-report-item:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.orgchart-report-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.orgchart-report-name {
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-800);
}

.orgchart-report-title {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.orgchart-report-metric {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .interactive-orgchart {
        padding: 1rem;
    }

    .orgchart-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .orgchart-toolbar-left,
    .orgchart-toolbar-right {
        flex-wrap: wrap;
    }

    .orgchart-node-card {
        min-width: 180px;
        max-width: 240px;
    }

    .orgchart-node-children {
        margin-left: 1rem;
        padding-left: 1rem;
    }

    .modal-slideout .modal-slideout-content {
        width: 100%;
        max-width: 100vw;
    }

    .orgchart-detail-grid {
        grid-template-columns: 1fr;
    }

    .orgchart-detail-item.full-width {
        grid-column: span 1;
    }
}

/* ========================================
   D3 Traditional Org Chart
   ======================================== */

.d3-orgchart-container {
    background: var(--gray-50);
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.d3-orgchart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: white;
    border-bottom: 1px solid var(--gray-200);
}

.d3-orgchart-title h3 {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.d3-orgchart-stats {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-top: 0.15rem;
}

.d3-orgchart-controls {
    display: flex;
    gap: 0.5rem;
}

.d3-orgchart-controls .btn {
    padding: 0.4rem 0.6rem;
}

.d3-orgchart-legend {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border-bottom: 1px solid var(--gray-100);
    flex-wrap: wrap;
}

.d3-orgchart-legend-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.d3-orgchart-legend-items {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.d3-orgchart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.d3-orgchart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.d3-orgchart-wrapper {
    flex: 1;
    min-height: 500px;
    height: 500px;
    overflow: hidden;
    cursor: grab;
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    position: relative;
}

.d3-orgchart-wrapper:active {
    cursor: grabbing;
}

#d3-orgchart-svg {
    width: 100%;
    height: 100%;
    min-height: 500px;
    display: block;
}

/* D3 Org Chart Links */
.d3-org-link {
    fill: none;
    stroke: var(--gray-300);
    stroke-width: 2px;
}

/* D3 Org Chart Nodes */
.d3-org-node {
    cursor: pointer;
    transition: transform 0.15s ease;
}

.d3-org-node:hover {
    filter: brightness(0.97);
}

.d3-org-node.has-children:hover {
    transform: scale(1.02);
}

.d3-org-node-bg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
    transition: all 0.15s ease;
}

.d3-org-node:hover .d3-org-node-bg {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.12));
}

.d3-org-node-bar {
    /* Color set dynamically */
}

.d3-org-node-name {
    font-size: 11px;
    font-weight: var(--font-semibold);
    fill: var(--gray-800);
}

.d3-org-node-title {
    font-size: 9px;
    fill: var(--gray-500);
}

.d3-org-node-badge rect {
    /* Color set dynamically */
}

.d3-org-node-toggle {
    cursor: pointer;
    transition: fill 0.15s ease;
}

.d3-org-node:hover .d3-org-node-toggle {
    fill: var(--primary) !important;
}

.d3-org-node-toggle-text {
    pointer-events: none;
}

/* Org Node Details Modal */
.org-dept-details {
    padding: 0;
}

.org-dept-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1rem;
}

.org-dept-header h3 {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.org-dept-count {
    font-size: var(--text-body);
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
}

.org-dept-table-wrapper {
    max-height: 350px;
    overflow-y: auto;
}

.org-dept-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
}

.org-dept-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    background: var(--gray-50);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
}

.org-dept-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.org-dept-table tr:hover td {
    background: var(--gray-50);
}

/* Mobile Responsive - D3 Org Chart */
@media (max-width: 768px) {
    .d3-orgchart-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .d3-orgchart-controls {
        width: 100%;
        justify-content: flex-start;
    }

    .d3-orgchart-legend {
        padding: 0.5rem 1rem;
    }

    .d3-orgchart-wrapper {
        min-height: 350px;
    }
}

/* Position Duration Card */
.position-duration-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    overflow: hidden;
}

.position-duration-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s ease;
}

.position-duration-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.position-duration-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.position-duration-body {
    padding: 1.25rem;
}

.duration-summary {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.duration-main-stat {
    text-align: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--brand-green-100) 100%);
    border-radius: var(--radius-lg);
    border: 2px solid #6ee7b7;
}

.duration-value {
    display: block;
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--brand-green-600);
    line-height: 1.2;
}

.duration-label {
    display: block;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--brand-green-800);
    margin-top: 0.25rem;
}

.duration-detail {
    display: block;
    font-size: var(--text-body);
    color: var(--brand-green-500);
    margin-top: 0.25rem;
}

/* Duration Card Section */
.duration-chart-section {
    margin-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
}

/* Insight Diagram — two-column pros/cons */
.duration-insight-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.duration-insight-box {
    border-radius: var(--radius);
    padding: 1rem;
    border: 1.5px solid;
}

.duration-insight-below {
    background: var(--brand-indigo-50);
    border-color: var(--brand-indigo-300);
}

.duration-insight-above {
    background: #faf5ff;
    border-color: var(--brand-indigo-200);
}

.duration-insight-title {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    margin-bottom: 0.6rem;
}

.duration-insight-item {
    font-size: var(--text-sm);
    line-height: 1.5;
    padding: 0.1rem 0;
}

.duration-insight-positive {
    color: var(--brand-green-600);
}

.duration-insight-negative {
    color: var(--danger);
}

/* Duration Zones L3 Layout */
.duration-zones {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Split Two-Column Layout */
.duration-split-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    align-items: stretch;
}

.duration-split-col {
    display: flex;
    flex-direction: column;
    padding: 0 0.75rem;
}

.duration-split-label {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
}

.duration-split-left .duration-split-label {
    color: var(--brand-indigo-500);
}

.duration-split-right .duration-split-label {
    color: var(--brand-indigo-500);
}

.duration-split-empty {
    text-align: center;
    font-size: var(--text-body);
    color: var(--gray-400);
    padding: 1.5rem 0.5rem;
}

/* Divider */
.duration-split-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 48px;
    padding: 0 4px;
}

.duration-split-divider-line {
    flex: 1;
    width: 2px;
    background: var(--gray-300);
}

.duration-split-divider-label {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: var(--gray-500);
    text-align: center;
    line-height: 1.3;
    padding: 0.4rem 0;
    white-space: nowrap;
}

/* Department Card Grid */
.duration-dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.6rem;
    flex: 1;
}

.duration-dept-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--gray-200);
    cursor: pointer;
    transition: all 0.15s;
}

.duration-dept-cell:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.duration-dept-cell:active {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Below average — indigo tint */
.duration-dept-cell.duration-below-side {
    background: var(--brand-indigo-50);
    border-color: var(--brand-indigo-300);
}

.duration-dept-cell.duration-below-side .duration-dept-cell-score {
    color: var(--primary);
}

/* Above average — purple tint */
.duration-dept-cell.duration-above-side {
    background: #faf5ff;
    border-color: var(--brand-indigo-200);
}

.duration-dept-cell.duration-above-side .duration-dept-cell-score {
    color: var(--brand-pink-600);
}

.duration-dept-cell-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    margin-bottom: 0.35rem;
}

.duration-dept-cell-score {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    line-height: 1.2;
}

.duration-dept-cell-meta {
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-top: 0.15rem;
}

.no-duration-data {
    text-align: center;
    padding: 1.5rem;
    color: var(--gray-500);
    font-size: var(--text-body);
}

/* Top 10 shortest / longest panels */
.duration-top-lists {
    margin-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.duration-top-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-700);
    transition: all 0.2s;
}

.duration-top-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.duration-top-chevron {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.duration-top-btn.expanded .duration-top-chevron {
    transform: rotate(180deg);
}

.duration-top-badge {
    margin-left: auto;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
}

.duration-top-badge-short {
    background: var(--danger-lighter);
    color: var(--danger);
}

.duration-top-badge-long {
    background: var(--brand-green-50);
    color: var(--brand-green-600);
}

.duration-top-content {
    margin-top: 0.5rem;
}

.duration-top-content.hidden {
    display: none;
}

.duration-top-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.duration-top-table thead th {
    background: var(--gray-50);
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--gray-200);
}

.duration-top-table tbody tr {
    border-bottom: 1px solid var(--gray-100);
}

.duration-top-table tbody tr:last-child {
    border-bottom: none;
}

.duration-top-table tbody tr:hover {
    background: var(--gray-50);
}

.duration-top-table td {
    padding: 0.5rem 0.75rem;
    color: var(--gray-600);
}

.duration-top-name {
    font-weight: var(--font-medium);
    color: var(--gray-800);
}

.duration-top-val {
    font-weight: var(--font-semibold);
    text-align: center;
    white-space: nowrap;
}

.duration-top-val-short {
    color: var(--danger);
}

.duration-top-val-long {
    color: var(--brand-green-600);
}

/* Duration popup chart (Time in Position detail) */
.duration-popup-chart {
    padding: 0.5rem 0;
}

.duration-popup-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.duration-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.duration-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.duration-popup-svg-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 420px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: #fff;
}

.duration-popup-svg-wrap svg {
    display: block;
}

.duration-popup-svg-wrap text {
    font-family: inherit;
}

.duration-popup-summary {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: var(--text-body);
    color: var(--gray-600);
}

.duration-popup-summary strong {
    color: var(--gray-800);
    font-weight: var(--font-semibold);
}

@media (max-width: 768px) {
    .duration-insight-row {
        grid-template-columns: 1fr;
    }

    .duration-split-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .duration-split-divider {
        flex-direction: row;
        width: 100%;
        height: auto;
        padding: 0.5rem 0;
    }

    .duration-split-divider-line {
        flex: 1;
        width: auto;
        height: 2px;
    }

    .duration-split-divider-label {
        padding: 0 0.75rem;
    }

    .duration-dept-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .duration-top-table {
        font-size: var(--text-sm);
    }

    .duration-top-table thead th,
    .duration-top-table td {
        padding: 0.4rem 0.5rem;
    }
}

/* ===== Nationality Diversity Card — Traffic Light Grid ===== */

.diversity-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1.25rem;
}

.diversity-card-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 150ms ease;
}

.diversity-card-header.collapsed {
    border-radius: var(--radius-lg);
}

.diversity-card-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.diversity-flag-count {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    background: white;
    color: var(--danger);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Diversity card header hover effect */
.diversity-card-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

/* Diversity metrics row consistent height */
.diversity-metrics-row .card-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}

/* Diversity legend compact style for L2 subsections */
.diversity-legend-compact {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    margin-bottom: 0.75rem;
    font-size: var(--text-sm);
    flex-wrap: wrap;
}

.diversity-legend-compact .legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Nationalization metrics row consistent height and stacking */
.nationalization-metrics-row .card-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    text-align: center;
}

.nationalization-metrics-row .card-metric-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    line-height: 1.2;
}

.nationalization-metrics-row .card-metric-label {
    /* Inherits canonical L1 typography. Card-specific overrides removed
       per L1 lock 2026-06-22 (no uppercase, sentence case). */
}

.nationalization-metrics-row .card-metric-subtext {
    /* Inherits canonical L1 typography. */
}

.diversity-card-body {
    padding: 1.25rem;
}

.diversity-legend {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.legend-dot.diversity-low { background: var(--brand-red-500); }
.legend-dot.diversity-moderate { background: var(--warning); }
.legend-dot.diversity-good { background: var(--brand-green-500); }
.legend-dot.diversity-high { background: var(--brand-green-600); }

/* Traffic light grid */
.diversity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.6rem;
}

.diversity-cell {
    position: relative;
    border-radius: var(--radius);
    padding: 0.85rem 0.75rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
    transition: transform 0.15s, box-shadow 0.15s;
    border: 2px solid transparent;
}

.diversity-cell:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.diversity-cell.active {
    border-color: #312e81;
    box-shadow: 0 0 0 2px rgba(49, 46, 129, 0.2);
}

/* Traffic light colours */
.diversity-cell.diversity-low {
    background: var(--danger-lighter);
    border-color: var(--brand-red-300);
}

.diversity-cell.diversity-moderate {
    background: var(--warning-lighter);
    border-color: var(--brand-amber-200);
}

.diversity-cell.diversity-good {
    background: var(--brand-green-50);
    border-color: var(--brand-green-200);
}

.diversity-cell.diversity-high {
    background: var(--brand-green-50);
    border-color: var(--brand-green-300);
}

.diversity-cell.active.diversity-low { border-color: var(--danger); }
.diversity-cell.active.diversity-moderate { border-color: var(--brand-amber-600); }
.diversity-cell.active.diversity-good { border-color: var(--brand-green-600); }
.diversity-cell.active.diversity-high { border-color: var(--brand-green-700); }

.diversity-cell-flagged::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
}

.diversity-cell-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.diversity-cell-score {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    line-height: 1;
}

.diversity-cell.diversity-low .diversity-cell-score { color: var(--danger); }
.diversity-cell.diversity-moderate .diversity-cell-score { color: var(--brand-amber-600); }
.diversity-cell.diversity-good .diversity-cell-score { color: var(--brand-green-600); }
.diversity-cell.diversity-high .diversity-cell-score { color: var(--brand-green-700); }

.diversity-cell-meta {
    font-size: var(--text-xs);
    color: var(--gray-400);
    white-space: nowrap;
}

.diversity-cell-warn {
    display: none; /* replaced by the red dot via ::after */
}

/* Detail panel below grid */
.diversity-detail-panel {
    margin-top: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    animation: diversitySlideIn 0.2s ease;
}

.diversity-detail-panel.hidden {
    display: none;
}

@keyframes diversitySlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.diversity-detail-header {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    position: relative;
}

.diversity-detail-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.diversity-detail-title strong {
    font-size: var(--text-body);
    color: var(--gray-800);
}

.diversity-detail-sub {
    font-size: var(--text-sm);
    color: var(--gray-400);
}

.diversity-detail-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: var(--text-lg);
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.2rem;
    line-height: 1;
}

.diversity-detail-close:hover {
    color: var(--gray-700);
}

/* Stacked bar in detail panel */
.diversity-detail-bar {
    display: flex;
    height: 10px;
    margin: 0.75rem 1rem 0;
    border-radius: 5px;
    overflow: hidden;
}

.diversity-bar-seg {
    height: 100%;
    transition: width 0.3s ease;
    min-width: 2px;
}

.diversity-bar-seg:first-child { border-radius: 5px 0 0 5px; }
.diversity-bar-seg:last-child { border-radius: 0 5px 5px 0; }
.diversity-bar-seg:only-child { border-radius: 5px; }

/* Shared detail styles */
.diversity-dept-index {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
}

.diversity-dept-index small {
    font-weight: var(--font-medium);
    font-size: var(--text-xs);
    opacity: 0.8;
    margin-left: 0.15rem;
}

.diversity-dept-index.diversity-low { background: var(--danger-lighter); color: var(--danger); }
.diversity-dept-index.diversity-moderate { background: var(--warning-lighter); color: var(--brand-amber-600); }
.diversity-dept-index.diversity-good { background: var(--brand-green-50); color: var(--brand-green-600); }
.diversity-dept-index.diversity-high { background: var(--brand-green-50); color: var(--brand-green-700); }

/* Nationality detail table */
.diversity-nat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
}

.diversity-nat-table th {
    text-align: left;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.diversity-nat-table td {
    padding: 0.4rem 0.75rem;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-50);
}

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

.diversity-nat-table tbody tr:hover {
    background: var(--gray-50);
}

.diversity-nat-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.diversity-row-flagged td {
    background: var(--danger-lighter);
}

.diversity-caveat {
    font-size: var(--text-sm);
    color: var(--gray-400);
    font-style: italic;
    text-align: center;
    margin-bottom: 0.75rem;
}

.diversity-warn-icon {
    color: var(--danger);
    font-size: var(--text-body);
}

/* Diversity popup (modal) styles */
.diversity-popup-content {
    padding: 0.25rem 0;
}

.diversity-popup-warning {
    background: var(--danger-lighter);
    border: 1px solid var(--brand-red-200);
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    font-size: var(--text-body);
    color: var(--danger);
    font-weight: var(--font-medium);
}

.diversity-popup-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.diversity-popup-stat {
    flex: 1;
    min-width: 100px;
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    text-align: center;
}

.diversity-popup-stat-val {
    display: block;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    margin-bottom: 0.15rem;
}

.diversity-popup-stat-lbl {
    display: block;
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.diversity-popup-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.diversity-popup-donut {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.diversity-popup-donut svg {
    display: block;
}

.diversity-popup-bars {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: 350px;
    overflow-y: auto;
}

.diversity-popup-bar-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.diversity-popup-bar-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 130px;
    flex-shrink: 0;
}

.diversity-popup-bar-name {
    font-size: var(--text-body);
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.diversity-popup-bar-track {
    flex: 1;
    height: 20px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}

.diversity-popup-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    min-width: 2px;
}

.diversity-popup-bar-value {
    width: 90px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: var(--text-body);
    color: var(--gray-800);
}

.diversity-popup-bar-pct {
    color: var(--gray-500);
    font-size: var(--text-sm);
}

@media (max-width: 768px) {
    .diversity-popup-layout {
        flex-direction: column;
        align-items: center;
    }

    .diversity-popup-bar-label {
        width: 100px;
    }

    .diversity-popup-stats {
        gap: 0.5rem;
    }

    .diversity-popup-stat {
        min-width: 70px;
        padding: 0.5rem;
    }
}

@media (max-width: 768px) {
    .diversity-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.4rem;
    }

    .diversity-cell {
        padding: 0.65rem 0.5rem;
    }

    .diversity-cell-name {
        font-size: var(--text-xs);
    }

    .diversity-cell-score {
        font-size: var(--text-body);
    }
}

/* ============================================
   Nationalization Section (within Diversity Card)
   ============================================ */

.nationalization-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.nationalization-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.nationalization-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin: 0;
}

.nationalization-header h4 svg {
    color: var(--brand-indigo-600);
}

.nationalization-section .target-badge {
    background: var(--brand-indigo-50);
    color: var(--brand-indigo-700);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}

.nationalization-overview {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

/* Top-nationalities chart. Width is container-driven — the wrapper carries only a
   row-count height, since horizontal bars need a fixed vertical slot each. */
.diversity-topnat-chart {
    width: 100%;
}

.nationalization-gauge {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* The gauge SVG carries a viewBox, so it can scale. `flex-shrink: 0` above keeps it
   at its natural 180px whenever there's room; this lets it shrink instead of forcing
   an overflow once the container gets tight. */
.nationalization-gauge > svg {
    max-width: 100%;
    height: auto;
}
@media (max-width: 520px) {
    .nationalization-gauge { flex-shrink: 1; min-width: 0; }
}

.nationalization-ring {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
}

.nationalization-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    flex: 1;
}

.nationalization-stats .stat-item {
    text-align: center;
    min-width: 80px;
}

.nationalization-stats .stat-value {
    display: block;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-900);
}

.nationalization-stats .stat-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.15rem;
}

.nationalization-stats .status-green .stat-value { color: var(--brand-green-600); }
.nationalization-stats .status-amber .stat-value { color: var(--brand-amber-500); }
.nationalization-stats .status-red .stat-value { color: var(--danger); }

.nationalization-departments h5 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin: 0 0 0.75rem 0;
}

.nationalization-dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.nationalization-dept-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem;
}

.nationalization-dept-card .dept-name {
    font-weight: var(--font-semibold);
    font-size: var(--text-body);
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nationalization-dept-card .dept-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.nationalization-dept-card .dept-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
    min-width: 2px;
}

.nationalization-dept-card .dept-stats {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.35rem;
}

@media (max-width: 768px) {
    .nationalization-overview {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .nationalization-stats {
        justify-content: center;
        gap: 1rem;
    }

    .nationalization-dept-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* Career Growth Card */
.career-growth-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    overflow: hidden;
}
.career-growth-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 150ms ease;
}

.career-growth-header.collapsed {
    border-radius: 0;
}

.career-growth-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

/* Performance Card L1/L2/L3 */
.performance-card-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.performance-metrics-row .card-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}

.perf-watchlist-panel {
    margin-bottom: 0.5rem;
}

.perf-watchlist-panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s;
}

.perf-watchlist-panel-header:hover {
    background: var(--gray-100);
}

.perf-watchlist-panel-title {
    flex: 1;
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-700);
}

.perf-watchlist-panel-count {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    background: var(--gray-200);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.perf-watchlist-panel-chevron {
    width: 16px;
    height: 16px;
    color: var(--gray-400);
    transition: transform 0.2s;
}

.perf-watchlist-panel.expanded .perf-watchlist-panel-chevron {
    transform: rotate(180deg);
}

.perf-watchlist-panel-body {
    display: none;
    padding: 0.75rem 0;
}

.perf-watchlist-panel.expanded .perf-watchlist-panel-body {
    display: block;
}

/* Performance Watchlist Section Headers */
.perf-watchlist-section {
    margin-bottom: 1rem;
}

.perf-watchlist-section:last-child {
    margin-bottom: 0;
}

.perf-watchlist-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin: 0 0 0.5rem 0;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 3px solid var(--gray-400);
}

.perf-watchlist-section-header svg {
    flex-shrink: 0;
    color: var(--gray-500);
}

.perf-watchlist-section-count {
    margin-left: auto;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    background: var(--gray-200);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

/* Performance Department Cards with Tiles */
.perf-dept-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

@media (max-width: 1200px) {
    .perf-dept-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .perf-dept-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .perf-dept-cards-grid {
        grid-template-columns: 1fr;
    }
}

.perf-dept-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.perf-dept-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: white;
}

.perf-dept-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.perf-dept-card-info {
    flex: 1;
    min-width: 0;
}

.perf-dept-card-name {
    display: block;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.perf-dept-card-meta {
    display: block;
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.perf-dept-card-score {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--gray-700);
}

.perf-dept-card-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.perf-dept-tile {
    width: 9px;
    height: 9px;
    border-radius: 2px;
}

.perf-dept-tile-initials {
    display: none;
}

/* Performance by Gender cards */
.perf-gender-cards-row {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
}

.perf-gender-card {
    flex: 1;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.perf-gender-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: white;
}

.perf-gender-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.perf-gender-card-name {
    flex: 1;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.perf-gender-card-score {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-700);
}

.perf-gender-card-meta {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

/* Performance by Gender/Nationality detail popup */
.perf-gender-detail-popup,
.perf-nationality-detail-popup {
    padding: 0.5rem;
}

.perf-gender-detail-header,
.perf-nationality-detail-header {
    margin-bottom: 1rem;
}

.perf-gender-stats,
.perf-nationality-stats {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.perf-gender-stat,
.perf-nationality-stat {
    text-align: center;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    min-width: 70px;
}

.perf-gender-stat-value,
.perf-nationality-stat-value {
    display: block;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}

.perf-gender-stat-label,
.perf-nationality-stat-label {
    display: block;
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
}

.perf-gender-stat.perf-high .perf-gender-stat-value,
.perf-nationality-stat.perf-high .perf-nationality-stat-value {
    color: var(--success-color);
}

.perf-gender-stat.perf-solid .perf-gender-stat-value,
.perf-nationality-stat.perf-solid .perf-nationality-stat-value {
    color: var(--warning-color);
}

.perf-gender-stat.perf-low .perf-gender-stat-value,
.perf-nationality-stat.perf-low .perf-nationality-stat-value {
    color: var(--danger-color);
}

.perf-emp-list {
    margin-top: 1rem;
}

.perf-emp-list-header {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.perf-emp-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.perf-emp-name {
    flex: 1;
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-800);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.perf-emp-position {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--gray-500);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.perf-emp-rating {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.perf-emp-rating.perf-high {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success-color);
}

.perf-emp-rating.perf-solid {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning-color);
}

.perf-emp-rating.perf-low {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
}

.perf-emp-more {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--gray-500);
    padding: 0.5rem 0;
}

/* Career Growth L1 Metrics Row */
.career-growth-metrics-row .card-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}

/* Career Growth L2/L3 Elements */
.card-l3-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cg-movement-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

.cg-breakdown-item {
    font-size: var(--text-body);
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.career-growth-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-800);
    flex: 1;
    min-width: 0;
}
.career-growth-total {
    font-size: var(--text-sm);
    color: var(--white);
    background: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-weight: var(--font-semibold);
    white-space: nowrap;
}
.career-growth-body {
    padding: 1.25rem;
}
.career-growth-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.career-growth-metrics.cg-metrics-full {
    grid-template-columns: repeat(4, 1fr);
}

/* View Timeline Card */
.cg-view-timeline-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--primary-light) 100%);
    border: 1px solid #93c5fd;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1.25rem;
}

.cg-view-timeline-card:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--brand-indigo-200) 100%);
    border-color: #60a5fa;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.cg-view-timeline-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.cg-view-timeline-icon svg {
    stroke: var(--primary);
}

.cg-view-timeline-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.cg-view-timeline-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-800);
}

.cg-view-timeline-subtitle {
    font-size: var(--text-body);
    color: var(--brand-indigo-500);
}

.cg-view-timeline-arrow {
    flex-shrink: 0;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.cg-view-timeline-arrow svg {
    stroke: var(--primary);
}

.cg-view-timeline-card:hover .cg-view-timeline-arrow {
    opacity: 1;
    transform: translateX(3px);
}
.career-growth-metric {
    text-align: center;
    padding: 0.85rem 0.75rem;
    background: var(--primary-lighter);
    border-radius: var(--radius);
    border: 1.5px solid #bfdbfe;
    cursor: default;
    transition: all 0.15s;
}
.career-growth-metric:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.career-growth-metric-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--primary);
    line-height: 1;
}
.career-growth-metric-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    margin-top: 0.35rem;
    line-height: 1.2;
}
.career-growth-recent {
    margin-bottom: 1rem;
}
.career-growth-table-header {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 1.5fr 1.2fr 0.7fr;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-400);
    font-weight: var(--font-semibold);
    border-bottom: 2px solid var(--gray-200);
}
.career-growth-table-row {
    display: grid;
    grid-template-columns: 1.5fr 1.5fr 1.5fr 1.2fr 0.7fr;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    font-size: var(--text-body);
    border-bottom: 1px solid var(--gray-100);
    align-items: center;
    color: var(--gray-700);
}
.career-growth-table-row:hover {
    background: var(--gray-50);
}
.career-growth-cross-dept {
    border-left: 3px solid var(--primary);
}
.cg-col-name strong {
    display: block;
    font-size: var(--text-body);
}
.cg-col-name small {
    color: var(--gray-400);
    font-size: var(--text-xs);
}
.career-growth-view-all {
    display: block;
    width: 100%;
    padding: 0.6rem;
    margin-top: 0.5rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: var(--text-body);
    color: var(--primary);
    font-weight: var(--font-medium);
    text-align: center;
    transition: background 0.15s;
}
.career-growth-view-all:hover {
    background: var(--gray-100);
}
/* Career Growth Department Grid (gender-cell style) */
.cg-dept-section {
    margin-top: 1rem;
    border-top: 1px solid var(--gray-100);
    padding-top: 0.75rem;
}
.cg-dept-section-title {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0 0 0.75rem 0;
}
.cg-dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}
.cg-dept-cell {
    position: relative;
    border-radius: var(--radius);
    padding: 0.85rem 0.75rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1.5px solid var(--gray-200);
    background: white;
    transition: all 0.15s;
}
.cg-dept-cell:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* High activity — blue */
.cg-dept-cell.cg-dept-high {
    background: var(--primary-lighter);
    border-color: var(--brand-indigo-200);
}
.cg-dept-cell.cg-dept-high .cg-dept-cell-score { color: var(--primary); }

/* Moderate activity — amber */
.cg-dept-cell.cg-dept-moderate {
    background: var(--warning-lighter);
    border-color: var(--brand-amber-200);
}
.cg-dept-cell.cg-dept-moderate .cg-dept-cell-score { color: var(--brand-amber-600); }

/* Low activity — green */
.cg-dept-cell.cg-dept-low {
    background: var(--brand-green-50);
    border-color: var(--brand-green-200);
}
.cg-dept-cell.cg-dept-low .cg-dept-cell-score { color: var(--brand-green-600); }

.cg-dept-cell-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.cg-dept-cell-score {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    line-height: 1;
    margin-top: 0.25rem;
}
.cg-dept-cell-meta {
    font-size: var(--text-xs);
    color: var(--gray-400);
    white-space: nowrap;
    margin-top: 0.1rem;
}

/* Position Duration Section within Career Growth */
.cg-position-duration-section {
    margin-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
}
.cg-position-duration-section .cg-dept-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cg-position-duration-section .cg-dept-section-title svg {
    stroke: var(--gray-500);
}
.duration-summary-compact {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}
.duration-main-stat-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, var(--brand-violet-50) 0%, var(--brand-indigo-50) 100%);
    border: 1px solid var(--brand-violet-200);
    border-radius: var(--radius);
    padding: 0.75rem 1.5rem;
}
.duration-main-stat-compact .duration-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--brand-violet-600);
}
.duration-main-stat-compact .duration-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.duration-main-stat-compact .duration-detail {
    font-size: var(--text-xs);
    color: var(--gray-500);
}
.career-growth-note {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: var(--text-body);
    color: var(--gray-500);
}
.career-growth-note svg {
    flex-shrink: 0;
    color: var(--gray-400);
}
.cg-move-badge {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: var(--gray-100);
    color: var(--gray-600);
    white-space: nowrap;
}

/* Promotion Velocity Section */
.cg-promotion-velocity-section {
    margin-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
}
.cg-promotion-velocity-section .cg-dept-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cg-promotion-velocity-section .cg-dept-section-title svg {
    stroke: var(--gray-500);
}
/* Velocity category cards */
.velocity-category-cards {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.velocity-category-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid;
    min-width: 0;
    overflow: hidden;
}
.velocity-category-card.clickable {
    cursor: pointer;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}
.velocity-category-card.clickable:hover {
    filter: brightness(0.97);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.velocity-category-avg {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-violet-50) 100%);
    border-color: var(--brand-indigo-200);
}
.velocity-category-fast {
    background: var(--brand-green-50);
    border-color: var(--brand-green-200);
}
.velocity-category-ontrack {
    background: var(--gray-50);
    border-color: var(--gray-200);
}
.velocity-category-slow {
    background: var(--brand-red-50);
    border-color: var(--brand-red-200);
}
.velocity-category-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    border-radius: 50%;
    flex-shrink: 0;
}
.velocity-category-fast .velocity-category-icon {
    background: var(--brand-green-100);
    color: var(--brand-green-600);
}
.velocity-category-ontrack .velocity-category-icon {
    background: var(--gray-100);
    color: var(--gray-600);
}
.velocity-category-slow .velocity-category-icon {
    background: var(--brand-red-100);
    color: var(--brand-red-600);
}
.velocity-category-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
}
.velocity-category-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.velocity-category-avg .velocity-category-value { color: var(--brand-indigo-700); }
.velocity-category-fast .velocity-category-value { color: var(--brand-green-700); }
.velocity-category-ontrack .velocity-category-value { color: var(--gray-700); }
.velocity-category-slow .velocity-category-value { color: var(--brand-red-700); }
.velocity-category-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.velocity-category-avg .velocity-category-label { color: var(--brand-indigo-600); }
.velocity-category-fast .velocity-category-label { color: var(--brand-green-600); }
.velocity-category-ontrack .velocity-category-label { color: var(--gray-600); }
.velocity-category-slow .velocity-category-label { color: var(--brand-red-600); }
.velocity-category-range {
    font-size: var(--text-xs);
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.velocity-summary-compact {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}
.velocity-main-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--brand-emerald-50) 100%);
    border: 1px solid var(--brand-green-200);
    border-radius: var(--radius);
    padding: 0.75rem 1.5rem;
}
.velocity-main-stat .velocity-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--brand-green-600);
}
.velocity-main-stat .velocity-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.velocity-main-stat .velocity-detail {
    font-size: var(--text-xs);
    color: var(--gray-500);
}
.velocity-dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.6rem;
}
.velocity-dept-cell {
    position: relative;
    border-radius: var(--radius);
    padding: 0.75rem 0.6rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1.5px solid var(--gray-200);
    background: white;
    transition: all 0.15s;
}
.velocity-dept-cell:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.velocity-dept-cell.velocity-fast {
    background: var(--brand-green-50);
    border-color: var(--brand-green-200);
}
.velocity-dept-cell.velocity-fast .velocity-dept-value { color: var(--brand-green-600); }
.velocity-dept-cell.velocity-average {
    background: var(--brand-blue-50);
    border-color: var(--brand-blue-200);
}
.velocity-dept-cell.velocity-average .velocity-dept-value { color: var(--brand-blue-600); }
.velocity-dept-cell.velocity-slow {
    background: var(--brand-amber-50);
    border-color: var(--brand-amber-200);
}
.velocity-dept-cell.velocity-slow .velocity-dept-value { color: var(--brand-amber-600); }
.velocity-dept-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.velocity-dept-value {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    line-height: 1;
    margin-top: 0.2rem;
}
.velocity-dept-meta {
    font-size: var(--text-xs);
    color: var(--gray-400);
    white-space: nowrap;
    margin-top: 0.1rem;
}

/* Velocity Modal */
.velocity-modal-summary {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: var(--text-body);
    color: var(--gray-600);
}
.velocity-modal-header,
.velocity-modal-row {
    grid-template-columns: 1.5fr 1fr 0.8fr 1fr 0.8fr;
}

/* Velocity Direction Indicators */
.velocity-direction {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    border-radius: 50%;
    flex-shrink: 0;
}
.velocity-fast {
    background: var(--brand-green-100);
    color: var(--brand-green-600);
}
.velocity-ontrack {
    background: var(--gray-100);
    color: var(--gray-600);
}
.velocity-slow {
    background: var(--brand-red-100);
    color: var(--brand-red-600);
}
.velocity-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.velocity-subsection .card-subsection-header {
    padding-left: 1rem;
}

/* Velocity Methodology Visualization */
.velocity-methodology {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}
.velocity-methodology h4 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    margin: 0 0 0.5rem 0;
    color: var(--gray-800);
}
.velocity-methodology p {
    font-size: var(--text-body);
    color: var(--gray-600);
    margin: 0 0 1rem 0;
}
.velocity-scale {
    display: flex;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 0.75rem;
}
.velocity-zone {
    flex: 1;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
}
.velocity-zone-fast {
    background: var(--brand-green-100);
}
.velocity-zone-ontrack {
    background: var(--gray-100);
}
.velocity-zone-slow {
    background: var(--brand-red-100);
}
.velocity-zone-icon {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
}
.velocity-zone-fast .velocity-zone-icon { color: var(--brand-green-600); }
.velocity-zone-ontrack .velocity-zone-icon { color: var(--gray-600); }
.velocity-zone-slow .velocity-zone-icon { color: var(--brand-red-600); }
.velocity-zone-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.velocity-zone-fast .velocity-zone-label { color: var(--brand-green-700); }
.velocity-zone-ontrack .velocity-zone-label { color: var(--gray-700); }
.velocity-zone-slow .velocity-zone-label { color: var(--brand-red-700); }
.velocity-zone-range {
    font-size: var(--text-body);
    font-weight: var(--font-medium);
}
.velocity-zone-fast .velocity-zone-range { color: var(--brand-green-600); }
.velocity-zone-ontrack .velocity-zone-range { color: var(--gray-600); }
.velocity-zone-slow .velocity-zone-range { color: var(--brand-red-600); }
.velocity-zone-desc {
    font-size: var(--text-xs);
    color: var(--gray-500);
}
.velocity-methodology-note {
    font-size: var(--text-sm) !important;
    font-style: italic;
    margin: 0 !important;
}

/* Velocity Modal */
.velocity-modal-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}
.velocity-modal-stats {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-body);
    color: var(--gray-600);
}
.velocity-modal-thresholds {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.velocity-threshold {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}
.velocity-threshold.velocity-fast {
    background: var(--brand-green-100);
    color: var(--brand-green-700);
}
.velocity-threshold.velocity-ontrack {
    background: var(--gray-100);
    color: var(--gray-600);
}
.velocity-threshold.velocity-slow {
    background: var(--brand-red-100);
    color: var(--brand-red-700);
}
.velocity-modal-sections {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Promotion Intervals Section */
.cg-promotion-intervals-section {
    margin-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
}
.cg-promotion-intervals-section .cg-dept-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cg-promotion-intervals-section .cg-dept-section-title svg {
    stroke: var(--gray-500);
}
.intervals-summary {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}
.intervals-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
}
.intervals-stat .intervals-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--brand-indigo-600);
}
.intervals-stat .intervals-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-align: center;
}
.intervals-employees-list {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 0.5rem;
    margin-bottom: 1rem;
}
.intervals-list-header {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr 1fr 1fr;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--gray-200);
}
.intervals-list-row {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr 1fr 1fr;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    font-size: var(--text-body);
    border-bottom: 1px solid var(--gray-100);
}
.intervals-list-row:last-child {
    border-bottom: none;
}
.intervals-emp-name {
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.intervals-emp-count {
    font-weight: var(--font-bold);
    color: var(--brand-indigo-600);
    text-align: center;
}
.intervals-emp-interval {
    color: var(--gray-600);
    text-align: center;
}
.intervals-emp-momentum {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-align: center;
}
.intervals-momentum-accelerating {
    color: var(--brand-green-600);
}
.intervals-momentum-stable {
    color: var(--gray-500);
}
.intervals-momentum-decelerating {
    color: var(--brand-amber-600);
}
.intervals-show-more {
    text-align: center;
    padding: 0.5rem;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--primary);
    cursor: pointer;
}
.intervals-show-more:hover {
    text-decoration: underline;
}

/* Employees Due for Promotion */
.intervals-due-section {
    background: linear-gradient(135deg, var(--brand-amber-50) 0%, var(--warning-lighter) 100%);
    border: 1px solid var(--brand-amber-200);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}
.intervals-due-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--brand-amber-700);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0 0 0.75rem 0;
}
.intervals-due-title svg {
    stroke: var(--brand-amber-600);
}
.intervals-due-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.intervals-due-item {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.5fr;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: var(--radius-sm);
    font-size: var(--text-body);
}
.intervals-due-name {
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.intervals-due-dept {
    color: var(--gray-500);
    font-size: var(--text-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.intervals-due-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.intervals-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}
.intervals-progress-fill {
    height: 100%;
    background: var(--brand-amber-500);
    border-radius: 3px;
}
.intervals-progress-text {
    font-size: var(--text-xs);
    color: var(--brand-amber-700);
    font-weight: var(--font-semibold);
    white-space: nowrap;
}

/* Intervals Modal */
.intervals-modal-header,
.intervals-modal-row {
    grid-template-columns: 1.5fr 1fr 0.7fr 0.8fr 1fr;
}

/* ══════════════════════════════════════════════════════════════════════════════
   RETENTION RISK CARD
   ══════════════════════════════════════════════════════════════════════════════ */

.retention-risk-analysis-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    overflow: hidden;
}

.retention-risk-card-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 150ms ease;
}

.retention-risk-card-header.collapsed {
    border-radius: var(--radius-lg);
}

.retention-risk-card-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.retention-risk-card-header h4 svg {
    width: 18px;
    height: 18px;
    stroke: var(--brand-indigo-600);
}

.retention-risk-card-header h4 .header-tooltip svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.retention-risk-card-header h4 .header-tooltip:hover svg {
    opacity: 1;
}

.retention-risk-count {
    font-size: var(--text-sm);
    color: var(--brand-indigo-600);
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: var(--font-medium);
}

.retention-risk-card-body {
    padding: 1.25rem;
}

/* Retention Risk L1/L2/L3 Styles */
.retention-risk-card-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
    cursor: pointer;
}

.retention-risk-metrics-row .card-metric {
    min-height: 90px;
}

/* Factor Grid (L2 By Risk Factor) */
/* Adapts to the CONTAINER, not the viewport — this grid renders both full-width
   in the legacy layout and inside the ~75% evidence pane of the split drill-in,
   and a viewport-keyed rule can't tell those apart. The 300px floor is chosen so
   the four factor cards land on 4-across at full width and a clean 2x2 in the
   ~75% evidence pane — a smaller floor fits 3 tracks there and orphans the fourth. */
.retention-factor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.75rem;
}

.retention-factor-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.retention-factor-card.inactive {
    opacity: 0.5;
}

/* A signal that could not be evaluated. Deliberately NOT `.inactive` — dimming it
   like a clean zero is the exact confusion this state exists to prevent. It reads
   as "we didn't look", not "we looked and found nothing". */
.retention-factor-card.blocked {
    background: var(--brand-amber-100);
    border-color: var(--brand-amber-500);
    opacity: 1;
}
.retention-factor-card.blocked .retention-factor-desc {
    color: var(--brand-amber-600);
}
.retention-factor-badge {
    display: inline-block;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
    color: var(--brand-amber-600);
    background: var(--white);
    border: 1px solid var(--brand-amber-500);
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
}

.retention-factor-icon {
    font-size: var(--text-lg);
    line-height: 1;
    flex-shrink: 0;
}

.retention-factor-content {
    flex: 1;
    min-width: 0;
}

.retention-factor-label {
    display: block;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.retention-factor-desc {
    display: block;
    font-size: var(--text-sm);
    color: var(--gray-500);
    line-height: 1.3;
}

.retention-factor-stats {
    text-align: right;
    flex-shrink: 0;
}

.retention-factor-count {
    display: block;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-900);
}

.retention-factor-weight {
    display: block;
    font-size: var(--text-xs);
    color: var(--gray-400);
    text-transform: uppercase;
}

/* Retention Sections */
.retention-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.retention-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.retention-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.retention-section-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.retention-section-title svg {
    width: 16px;
    height: 16px;
    stroke: var(--brand-indigo-600);
}

/* Summary Stats Row */
.retention-summary-stats {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.retention-summary-badge {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.retention-summary-badge.severity-critical {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.retention-summary-badge.severity-high {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.retention-summary-badge.severity-moderate {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #166534;
    border: 1px solid #86efac;
}

/* Department Breakdown */
.retention-dept-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.retention-dept-chip {
    font-size: var(--text-xs);
    padding: 0.25rem 0.6rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    color: var(--gray-700);
}

.retention-dept-chip strong {
    color: var(--gray-900);
}

/* Employee Grid */
.retention-employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.retention-employee-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    cursor: pointer;
    transition: all 0.2s;
}

.retention-employee-card:hover {
    border-color: var(--gray-300);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.retention-employee-card.severity-critical {
    border-left: 3px solid #dc2626;
}

.retention-employee-card.severity-high {
    border-left: 3px solid #f59e0b;
}

.retention-employee-card.severity-moderate {
    border-left: 3px solid #10b981;
}

.retention-employee-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.retention-employee-role {
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.retention-employee-meta {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}

.retention-meta-item {
    font-size: var(--text-xs);
    color: var(--gray-500);
    background: var(--gray-50);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.retention-meta-item.highlight {
    background: #fef2f2;
    color: #991b1b;
}

/* Pay Risk Specific */
.pay-risk-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.pay-risk-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.pay-risk-count:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pay-risk-count.critical {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
}

.pay-risk-count.high {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
}

.pay-risk-count.moderate {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
}

.pay-risk-number {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
}

.pay-risk-count.critical .pay-risk-number { color: #991b1b; }
.pay-risk-count.high .pay-risk-number { color: #92400e; }
.pay-risk-count.moderate .pay-risk-number { color: #166534; }

.pay-risk-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pay-risk-count.critical .pay-risk-label { color: #b91c1c; }
.pay-risk-count.high .pay-risk-label { color: #b45309; }
.pay-risk-count.moderate .pay-risk-label { color: #15803d; }

/* Tenure Risk Specific */
.tenure-threshold-info {
    font-size: var(--text-sm);
    color: var(--gray-600);
    background: var(--gray-50);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tenure-threshold-info svg {
    width: 14px;
    height: 14px;
    color: var(--gray-400);
}

.perf-decline-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

.perf-decline-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.perf-decline-card:hover {
    border-color: var(--gray-300);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.perf-decline-card.decline-critical {
    border-left: 3px solid #dc2626;
}

.perf-decline-card.decline-moderate {
    border-left: 3px solid #f59e0b;
}

.perf-decline-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.perf-decline-role {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.perf-decline-trend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-sm);
}

.perf-rating-box {
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: var(--font-semibold);
}

.perf-rating-box.rating-old {
    background: var(--gray-100);
    color: var(--gray-600);
}

.perf-rating-box.rating-new {
    background: #fef2f2;
    color: #991b1b;
}

.perf-trend-arrow {
    color: #dc2626;
}

.perf-drop-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: white;
    background: #dc2626;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    margin-left: auto;
}

/* Predictive Risk Section */
.predictive-tier-summary {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.predictive-tier-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    min-width: 80px;
    cursor: pointer;
    transition: all 0.2s;
}

.predictive-tier-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.predictive-tier-box.tier-critical {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
}

.predictive-tier-box.tier-high {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
}

.predictive-tier-box.tier-moderate {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
}

.predictive-tier-box.tier-low {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
}

.predictive-tier-count {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    line-height: 1;
}

.tier-critical .predictive-tier-count { color: #991b1b; }
.tier-high .predictive-tier-count { color: #92400e; }
.tier-moderate .predictive-tier-count { color: #1e40af; }
.tier-low .predictive-tier-count { color: #166534; }

.predictive-tier-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-top: 0.25rem;
}

.tier-critical .predictive-tier-label { color: #b91c1c; }
.tier-high .predictive-tier-label { color: #b45309; }
.tier-moderate .predictive-tier-label { color: #1e3a8a; }
.tier-low .predictive-tier-label { color: #15803d; }

/* Predictive Employee Table */
.predictive-employee-table {
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.predictive-table-header {
    display: grid;
    grid-template-columns: 1.5fr 1fr 0.8fr 0.6fr 1.5fr;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.predictive-table-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 0.8fr 0.6fr 1.5fr;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    align-items: center;
    cursor: pointer;
    transition: background 0.15s;
}

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

.predictive-table-row:hover {
    background: var(--gray-50);
}

.predictive-table-row.tier-critical {
    border-left: 3px solid #dc2626;
}

.predictive-table-row.tier-high {
    border-left: 3px solid #f59e0b;
}

.predictive-table-row.tier-moderate {
    border-left: 3px solid #3b82f6;
}

.predictive-table-row.tier-low {
    border-left: 3px solid #10b981;
}

.predictive-emp-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.predictive-emp-role {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.predictive-emp-dept {
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.predictive-emp-score {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
}

.tier-critical .predictive-emp-score { color: #991b1b; }
.tier-high .predictive-emp-score { color: #92400e; }
.tier-moderate .predictive-emp-score { color: #1e40af; }
.tier-low .predictive-emp-score { color: #166534; }

.predictive-emp-tier {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.predictive-emp-tier.tier-critical {
    background: #dc2626;
    color: white;
}

.predictive-emp-tier.tier-high {
    background: #f59e0b;
    color: white;
}

.predictive-emp-tier.tier-moderate {
    background: #3b82f6;
    color: white;
}

.predictive-emp-tier.tier-low {
    background: #10b981;
    color: white;
}

.predictive-emp-factors {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.factor-tag {
    font-size: var(--text-xs);
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    background: var(--gray-100);
    color: var(--gray-600);
}

.factor-tag.active {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Risk Score Bar */
.risk-score-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.35rem;
}

.risk-score-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.risk-score-fill.tier-critical { background: #dc2626; }
.risk-score-fill.tier-high { background: #f59e0b; }
.risk-score-fill.tier-moderate { background: #3b82f6; }
.risk-score-fill.tier-low { background: #10b981; }

/* Compact Retention Sections */
.retention-section-compact {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}

.retention-badge-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.retention-threshold-hint {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Retention Risk Tier Selector */
.retention-tier-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.retention-tier-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.5rem;
    border: none;
    background: var(--gray-50);
    cursor: pointer;
    transition: all 0.15s ease;
    border-right: 1px solid var(--gray-200);
}

.retention-tier-btn:last-child {
    border-right: none;
}

.retention-tier-btn:hover:not(.empty) {
    background: var(--gray-100);
}

.retention-tier-btn.empty {
    opacity: 0.4;
    cursor: not-allowed;
}

.retention-tier-btn.active {
    background: white;
    box-shadow: inset 0 -3px 0 currentColor;
}

.retention-tier-btn.tier-critical {
    color: #dc2626;
}

.retention-tier-btn.tier-critical.active {
    background: #fef2f2;
}

.retention-tier-btn.tier-high {
    color: #d97706;
}

.retention-tier-btn.tier-high.active {
    background: #fffbeb;
}

.retention-tier-btn.tier-moderate {
    color: #2563eb;
}

.retention-tier-btn.tier-moderate.active {
    background: #eff6ff;
}

.retention-tier-btn.tier-low {
    color: #059669;
}

.retention-tier-btn.tier-low.active {
    background: #ecfdf5;
}

.tier-btn-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.tier-btn-count {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    line-height: 1.2;
}

.retention-tier-btn.empty .tier-btn-count {
    color: var(--gray-400);
}

/* Predictive Employee Cards - List (legacy) */
.predictive-employee-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Predictive Employee Grid */
.predictive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.predictive-grid-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.65rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
    border-top: 3px solid var(--gray-300);
}

.predictive-grid-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.predictive-grid-card.risk-critical {
    border-top-color: #dc2626;
    background: linear-gradient(to bottom, #fef2f2 0%, white 100%);
}

.predictive-grid-card.risk-high {
    border-top-color: #f59e0b;
    background: linear-gradient(to bottom, #fffbeb 0%, white 100%);
}

.predictive-grid-card.risk-moderate {
    border-top-color: #3b82f6;
    background: linear-gradient(to bottom, #eff6ff 0%, white 100%);
}

.predictive-grid-card.risk-low {
    border-top-color: #10b981;
    background: linear-gradient(to bottom, #ecfdf5 0%, white 100%);
}

.predictive-grid-score {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.predictive-grid-card.risk-critical .predictive-grid-score {
    color: #dc2626;
}

.predictive-grid-card.risk-high .predictive-grid-score {
    color: #d97706;
}

.predictive-grid-card.risk-moderate .predictive-grid-score {
    color: #2563eb;
}

.predictive-grid-card.risk-low .predictive-grid-score {
    color: #059669;
}

.predictive-grid-name {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.15rem;
}

.predictive-grid-role {
    font-size: var(--text-xs);
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.35rem;
}

.predictive-grid-factors {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

.factor-icon {
    font-size: var(--text-sm);
    opacity: 0.8;
}

/* Responsive grid */
@media (max-width: 500px) {
    .predictive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.predictive-employee-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.15s ease;
}

.predictive-employee-card:hover {
    border-color: var(--gray-300);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.predictive-employee-card.risk-critical {
    border-left: 3px solid #dc2626;
}

.predictive-employee-card.risk-high {
    border-left: 3px solid #f59e0b;
}

.predictive-employee-card.risk-moderate {
    border-left: 3px solid #3b82f6;
}

.predictive-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.predictive-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.predictive-card-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

.predictive-card-meta {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.predictive-card-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.predictive-card-score .score-tier {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

.predictive-card-score .score-tier.risk-tier-critical {
    background: #dc2626;
    color: white;
}

.predictive-card-score .score-tier.risk-tier-high {
    background: #f59e0b;
    color: white;
}

.predictive-card-score .score-tier.risk-tier-moderate {
    background: #3b82f6;
    color: white;
}

.predictive-card-factors {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.factor-tag {
    font-size: var(--text-xs);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: var(--font-medium);
}

.factor-tag.factor-highperf {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.factor-tag.factor-pay {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.factor-tag.factor-tenure {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.factor-tag.factor-perf {
    background: #fce7f3;
    color: #9d174d;
    border: 1px solid #f9a8d4;
}

/* Factor points within tags */
.factor-points {
    font-weight: var(--font-bold);
    margin-left: 0.25rem;
    opacity: 0.85;
}

/* Score value with percentage */
.predictive-card-score .score-value {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    margin-right: 0.35rem;
}

/* Clickable employee cards */
.predictive-employee-card {
    cursor: pointer;
}

/* Retention Risk Detail Modal */
/* Retention detail modal - medium size */
.retention-detail-modal .modal-content {
    width: 60vw;
    max-width: 600px;
}

.retention-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.retention-detail-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: var(--text-base);
    color: var(--gray-900);
}

.retention-detail-info p {
    margin: 0;
    font-size: var(--text-body);
    color: var(--gray-600);
}

.retention-detail-score-section {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.retention-detail-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.retention-detail-score-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
}

.retention-detail-factors {
    margin-top: 1rem;
}

.retention-detail-factors h5 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin: 0 0 0.75rem 0;
}

.retention-factor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--gray-200);
}

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

.retention-factor-name {
    font-size: var(--text-body);
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.retention-factor-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.retention-factor-status.active {
    background: #dc2626;
}

.retention-factor-status.inactive {
    background: var(--gray-300);
}

.retention-factor-score {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
}

.retention-factor-score.active {
    color: #991b1b;
}

.retention-factor-score.inactive {
    color: var(--gray-400);
}

/* Risk Factor Items (Predictive Risk Modal) */
.risk-factor-item {
    background: var(--gray-50);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.risk-factor-item:last-child {
    margin-bottom: 0;
}

.risk-factor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.risk-factor-header strong {
    font-size: var(--text-body);
    color: var(--gray-800);
}

.risk-factor-points {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: #dc2626;
    background: #fee2e2;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.risk-factor-detail {
    font-size: var(--text-sm);
    color: var(--gray-600);
    line-height: 1.4;
}

/* Risk Detail Modal - 2x2 Grid Layout */
.risk-detail-modal-content {
    padding: 0.5rem 0;
}

.risk-detail-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.6rem;
    margin-bottom: 0.6rem;
    border-bottom: 1px solid var(--gray-200);
}

.risk-detail-employee {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.risk-detail-name {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--gray-900);
}

.risk-detail-meta {
    font-size: var(--text-body);
    color: var(--gray-500);
}

.risk-detail-score-summary {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.risk-detail-score-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-900);
}

.risk-detail-score-label {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-right: 0.5rem;
}

.risk-detail-tier {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.risk-detail-tier.risk-tier-critical {
    background: #dc2626;
    color: white;
}

.risk-detail-tier.risk-tier-high {
    background: #f59e0b;
    color: white;
}

/* 2x2 Factor Grid */
.risk-factor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.risk-factor-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--gray-300);
    border-radius: 6px;
    padding: 0.6rem;
}

.risk-factor-card.active {
    background: white;
}

.risk-factor-card.active.severity-critical {
    border-left-color: #dc2626;
    background: linear-gradient(to right, #fef2f2 0%, white 100%);
}

.risk-factor-card.active.severity-high {
    border-left-color: #f59e0b;
    background: linear-gradient(to right, #fffbeb 0%, white 100%);
}

.risk-factor-card.active.severity-moderate {
    border-left-color: #3b82f6;
    background: linear-gradient(to right, #eff6ff 0%, white 100%);
}

.risk-factor-card.inactive {
    opacity: 0.5;
    border-left-color: var(--gray-300);
}

.risk-factor-card-header {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}

.risk-factor-icon {
    font-size: var(--text-body);
}

.risk-factor-title {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-600);
    flex: 1;
}

.risk-factor-contrib {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
}

.risk-factor-contrib.active {
    background: #fee2e2;
    color: #dc2626;
}

.risk-factor-contrib.inactive {
    background: var(--gray-100);
    color: var(--gray-400);
}

/* Metric Box */
.risk-factor-metric-box {
    text-align: center;
    padding: 0.25rem 0;
    margin-bottom: 0.25rem;
}

.risk-factor-metric-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-900);
    display: block;
    line-height: 1.1;
}

.risk-factor-card.inactive .risk-factor-metric-value {
    color: var(--gray-400);
}

.risk-factor-metric-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: lowercase;
}

.risk-factor-detail-text {
    font-size: var(--text-xs);
    color: var(--gray-600);
    text-align: center;
    margin-bottom: 0.3rem;
    font-weight: var(--font-medium);
}

.risk-factor-card.inactive .risk-factor-detail-text {
    color: var(--gray-400);
}

/* Factor Description - hidden by default, shown on hover */
.risk-factor-description {
    display: none;
}

.risk-factor-card.active .risk-factor-description {
    display: none;
}

/* Explainer text */
.risk-detail-explainer {
    font-size: var(--text-sm);
    color: var(--gray-600);
    line-height: 1.4;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.risk-detail-explainer strong {
    color: var(--gray-800);
}

/* Responsive - stack on mobile */
@media (max-width: 500px) {
    .risk-factor-grid {
        grid-template-columns: 1fr;
    }

    .risk-detail-header-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

.retention-factor-detail {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-left: 1rem;
}

/* Show More Button */
.retention-show-more {
    width: 100%;
    padding: 0.6rem;
    margin-top: 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.retention-show-more:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

/* Retention Risk Mobile */
@media (max-width: 768px) {
    .retention-risk-card-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .retention-employee-grid {
        grid-template-columns: 1fr;
    }

    .predictive-tier-summary {
        justify-content: center;
    }

    .predictive-table-header,
    .predictive-table-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .predictive-table-header {
        display: none;
    }

    .predictive-table-row {
        padding: 1rem;
        background: var(--white);
        margin-bottom: 0.5rem;
        border-radius: 8px;
        border: 1px solid var(--gray-200);
    }

    .predictive-emp-factors {
        margin-top: 0.5rem;
    }

    .pay-risk-summary {
        flex-direction: column;
    }

    .pay-risk-count {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .career-growth-metrics,
    .career-growth-metrics.cg-metrics-full {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .cg-view-timeline-card {
        padding: 0.75rem 1rem;
    }
    .cg-view-timeline-icon {
        width: 40px;
        height: 40px;
    }
    .cg-view-timeline-title {
        font-size: var(--text-body);
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   CAREER GROWTH TIMELINE
   ══════════════════════════════════════════════════════════════════════════════ */

.cg-timeline {
    position: relative;
    padding: 0.5rem 0 0 0;
}

.cg-timeline::before {
    content: '';
    position: absolute;
    left: 60px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary-400), var(--primary-200));
    border-radius: 2px;
}

.cg-timeline-month {
    position: relative;
    padding-left: 90px;
    padding-bottom: 1.5rem;
}

.cg-timeline-dot {
    width: 14px;
    height: 14px;
    background: var(--primary-500);
    border: 3px solid var(--white);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--primary-300), 0 2px 4px rgba(0,0,0,0.1);
    position: absolute;
    left: 54px;
    top: 6px;
}

.cg-timeline-dot.end {
    width: 10px;
    height: 10px;
    background: var(--gray-300);
    box-shadow: 0 0 0 2px var(--gray-200);
    left: 56px;
    top: 0;
}

.cg-timeline-month-label {
    position: absolute;
    left: 0;
    top: 2px;
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--gray-700);
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.cg-timeline-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cg-timeline-end {
    position: relative;
    height: 20px;
}

.cg-timeline-end .cg-timeline-dot {
    top: 0;
}

/* Career Employee History Modal */
.career-employee-history {
    padding: 0.5rem 0;
}

.career-employee-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.career-employee-name {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

.career-employee-id {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-top: 0.2rem;
}

/* Current Position Banner */
.career-current-position {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.career-current-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}

.career-current-value {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

/* Timeline Section */
.career-timeline-section {
    margin-top: 0.5rem;
}

.career-timeline-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

.career-timeline {
    position: relative;
    padding-left: 2rem;
}

/* Timeline Event */
.career-timeline-event {
    position: relative;
    padding-bottom: 1rem;
    padding-left: 1rem;
}

.career-timeline-event:last-child {
    padding-bottom: 0;
}

.career-timeline-icon {
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    z-index: 2;
}

.career-timeline-event.promotion .career-timeline-icon {
    background: var(--brand-green-100);
    color: var(--brand-green-600);
}

.career-timeline-event.lateral .career-timeline-icon {
    background: var(--brand-indigo-100);
    color: var(--brand-indigo-600);
}

.career-timeline-event.start .career-timeline-icon {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* Connector line */
.career-timeline-connector {
    position: absolute;
    left: calc(-2rem + 12px);
    top: 50%;
    bottom: -1rem;
    width: 2px;
    background: var(--gray-200);
    transform: translateX(-50%);
}

.career-timeline-connector.last {
    bottom: -0.5rem;
}

.career-timeline-event.start .career-timeline-connector {
    display: none;
}

/* Event Content */
.career-timeline-content {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--gray-100);
}

.career-timeline-event.promotion .career-timeline-content {
    border-left: 3px solid var(--brand-green-400);
}

.career-timeline-event.lateral .career-timeline-content {
    border-left: 3px solid var(--brand-indigo-400);
}

.career-timeline-event.start .career-timeline-content {
    border-left: 3px solid var(--gray-300);
    background: white;
}

.career-timeline-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.career-timeline-date {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.career-timeline-type {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.career-timeline-type.promotion {
    background: var(--brand-green-100);
    color: var(--brand-green-700);
}

.career-timeline-type.lateral {
    background: var(--brand-indigo-100);
    color: var(--brand-indigo-700);
}

.career-timeline-summary {
    font-size: var(--text-body);
    color: var(--gray-600);
    line-height: 1.4;
}

/* Career Movements By Type (grouped view in popup) */
.career-movements-by-type {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Responsive */
@media (max-width: 600px) {
    .cg-timeline::before {
        left: 20px;
    }

    .cg-timeline-month {
        padding-left: 50px;
    }

    .cg-timeline::before {
        left: 20px;
    }

    .cg-timeline-dot {
        left: 14px;
    }

    .cg-timeline-dot.end {
        left: 16px;
    }

    .cg-timeline-month-label {
        display: none;
    }
}

/* Revenue per Employee Card */
.revenue-employee-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    overflow: hidden;
}

.revenue-employee-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s ease;
}

.revenue-employee-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.revenue-employee-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.revenue-employee-body {
    padding: 1.25rem;
}

.revenue-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.revenue-metric-box {
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.revenue-metric-box.primary {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--primary-light) 100%);
    border-color: var(--brand-indigo-300);
}

.revenue-metric-value {
    display: block;
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    line-height: 1.2;
}

.revenue-metric-box.primary .revenue-metric-value {
    color: var(--brand-indigo-800);
    font-size: var(--text-2xl);
}

.revenue-metric-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: 0.25rem;
    font-weight: var(--font-medium);
}

/* Revenue Expand Section */
.revenue-expand-section {
    margin-top: 1rem;
    border-top: 1px solid var(--gray-200);
    padding-top: 1rem;
}

.revenue-expand-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-700);
    transition: all 0.2s;
}

.revenue-expand-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.revenue-expand-btn svg {
    transition: transform 0.2s;
}

.revenue-expand-btn.expanded svg {
    transform: rotate(180deg);
}

.revenue-department-panel {
    margin-top: 1rem;
}

.revenue-department-panel.hidden {
    display: none;
}

.revenue-department-list {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.revenue-department-item {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
}

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

.revenue-department-item:hover {
    background: var(--gray-50);
}

.revenue-dept-info {
    display: flex;
    flex-direction: column;
}

.revenue-dept-name {
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-800);
}

.revenue-dept-count {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.revenue-dept-bar-container {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.revenue-dept-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-indigo-500) 0%, var(--primary) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.revenue-dept-value {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--primary);
    text-align: right;
}

.revenue-dept-note {
    text-align: center;
    padding: 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: var(--text-sm);
    color: var(--gray-500);
    font-style: italic;
}

.no-revenue-data {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--gray-400);
}

.no-revenue-data svg {
    margin-bottom: 1rem;
    color: var(--gray-300);
}

.no-revenue-data p {
    margin: 0;
    font-size: var(--text-base);
    color: var(--gray-600);
    font-weight: var(--font-medium);
}

.no-revenue-data span {
    display: block;
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .revenue-metrics-grid {
        grid-template-columns: 1fr;
    }

    .revenue-department-item {
        grid-template-columns: 1fr 80px;
    }
}

/* Staffing Cost per Occupied Room Card */
.staffing-cost-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    overflow: hidden;
}

.staffing-cost-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s ease;
}

.staffing-cost-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.staffing-cost-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.staffing-cost-header .revenue-month-badge {
    color: var(--gray-700);
    background: var(--gray-100);
}

.staffing-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.staffing-ytd-avg {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--brand-green-700);
    background: rgba(255, 255, 255, 0.7);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}

.staffing-cost-body {
    padding: 1.25rem;
}

.staffing-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.staffing-metric-box {
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.staffing-metric-box.primary {
    background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--brand-green-100) 100%);
    border-color: var(--brand-green-300);
}

.staffing-metric-value {
    display: block;
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    line-height: 1.2;
}

.staffing-metric-box.primary .staffing-metric-value {
    color: var(--brand-green-800);
    font-size: var(--text-2xl);
}

.staffing-metric-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: 0.25rem;
    font-weight: var(--font-medium);
}

.staffing-expand-section {
    margin-top: 0.5rem;
}

.staffing-expand-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-600);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.staffing-expand-btn:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.staffing-expand-btn.expanded svg {
    transform: rotate(180deg);
}

.staffing-expand-btn svg {
    transition: transform 0.2s;
}

.staffing-trend-section {
    margin: 1rem 0;
    padding: 0.75rem 0;
    border-top: 1px solid var(--gray-100);
}

.staffing-trend-chart-container {
    height: 220px;
    position: relative;
}

.staffing-division-panel {
    margin-top: 0.75rem;
}

.staffing-division-panel.hidden {
    display: none;
}

.staffing-division-list {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.staffing-division-item {
    display: grid;
    grid-template-columns: 1fr 120px;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    gap: 1rem;
}

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

.staffing-div-info {
    display: flex;
    flex-direction: column;
}

.staffing-div-name {
    font-weight: var(--font-medium);
    font-size: var(--text-body);
    color: var(--gray-800);
}

.staffing-div-count {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.staffing-div-bar-container {
    height: 6px;
    background: var(--gray-100);
    border-radius: 3px;
    overflow: hidden;
}

.staffing-div-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-green-500) 0%, var(--brand-green-600) 100%);
    border-radius: 3px;
    min-width: 2px;
}

.staffing-div-value {
    text-align: right;
    font-weight: var(--font-semibold);
    font-size: var(--text-body);
    color: var(--gray-800);
}

.staffing-div-per {
    font-size: var(--text-xs);
    font-weight: var(--font-normal);
    color: var(--gray-500);
}

.staffing-div-note {
    text-align: center;
    padding: 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: var(--text-sm);
    color: var(--gray-500);
    font-style: italic;
}

@media (max-width: 768px) {
    .staffing-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .staffing-division-item {
        grid-template-columns: 1fr 80px;
    }
}

/* Headcount Breakdown Card - Workforce Analytics */
.headcount-breakdown-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.headcount-breakdown-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.headcount-breakdown-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.headcount-breakdown-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.headcount-breakdown-header h4 svg {
    stroke: var(--gray-600);
    flex-shrink: 0;
}

.headcount-total-badge {
    font-size: var(--text-sm);
    color: var(--gray-700);
    background: var(--gray-100);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: var(--font-semibold);
}

.headcount-breakdown-body {
    padding: 1.5rem;
}

/* Headcount L1 Metrics Row */
.headcount-metrics-row .card-metric {
    min-height: 90px;
}

/* Department Summary List (L2 subsection) */
.department-summary-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.department-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-radius: 4px;
}

.department-summary-item:hover {
    background: var(--gray-100);
}

.headcount-more-note {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--gray-500);
    padding: 0.75rem;
    font-style: italic;
}

.division-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.division-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.division-item.expanded {
    border-color: var(--brand-indigo-300);
}

.division-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    cursor: pointer;
    transition: background 0.15s;
}

.division-header:hover {
    background: var(--brand-amber-50);
}

.division-item.expanded .division-header {
    background: var(--brand-amber-50);
    border-bottom: 1px solid var(--brand-amber-200);
}

.division-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.division-expand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    transition: transform 0.2s;
}

.division-item.expanded .division-expand-icon {
    transform: rotate(90deg);
    color: var(--brand-amber-600);
}

.division-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.division-dept-count {
    font-size: var(--text-xs);
    color: var(--gray-500);
    background: var(--gray-200);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
}

.division-stats {
    display: flex;
    align-items: center;
    gap: 0;
}

.division-count {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    width: 200px;
    text-align: center;
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.division-percentage {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--brand-pink-600);
    width: 200px;
    text-align: center;
    background: #f3e8ff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Color tiers for divisions */
.headcount-tier-1 { background: var(--brand-amber-600); color: var(--brand-amber-600); }
.headcount-tier-2 { background: var(--brand-amber-500); color: var(--brand-amber-500); }
.headcount-tier-3 { background: var(--brand-amber-400); color: var(--brand-amber-400); }
.headcount-tier-4 { background: var(--brand-amber-300); color: var(--brand-amber-300); }
.headcount-tier-5 { background: var(--brand-amber-200); color: var(--brand-amber-300); }

.division-bar.headcount-tier-1 { background: linear-gradient(90deg, var(--brand-amber-500) 0%, var(--brand-amber-600) 100%); }
.division-bar.headcount-tier-2 { background: linear-gradient(90deg, var(--brand-amber-400) 0%, var(--brand-amber-500) 100%); }
.division-bar.headcount-tier-3 { background: linear-gradient(90deg, var(--brand-amber-300) 0%, var(--brand-amber-400) 100%); }
.division-bar.headcount-tier-4 { background: linear-gradient(90deg, var(--brand-amber-200) 0%, var(--brand-amber-300) 100%); }
.division-bar.headcount-tier-5 { background: linear-gradient(90deg, var(--brand-amber-100) 0%, var(--brand-amber-200) 100%); }

/* Department breakdown */
.department-breakdown {
    background: white;
    padding: 0.5rem 0.5rem 0.5rem 2.5rem;
}

.department-breakdown.hidden,
.bullet-dept-breakdown.hidden {
    display: none;
}

.department-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

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

.department-item:hover {
    background: var(--gray-50);
    border-radius: var(--radius);
}

.department-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.department-name {
    font-size: var(--text-body);
    color: var(--gray-700);
}

.department-stats {
    display: flex;
    align-items: center;
    gap: 0;
}

.department-count {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    width: 200px;
    text-align: center;
    background: var(--gray-100);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.department-percentage {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--brand-pink-600);
    width: 200px;
    text-align: center;
    background: #f3e8ff;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

/* ============================================ */
/* Pay Equity Analysis Card                     */
/* ============================================ */

/* Grade Salary Chart Card */
.grade-salary-chart-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1.25rem;
}
.grade-salary-chart-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s ease;
}
.grade-salary-chart-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}
.grade-salary-chart-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}
.grade-salary-chart-header h4 svg {
    color: var(--gray-600);
}
.grade-chart-total-badge {
    font-size: var(--text-sm);
    color: var(--gray-700);
    background: var(--gray-100);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: var(--font-semibold);
    white-space: nowrap;
    position: relative;
    cursor: help;
}
.grade-chart-total-badge.has-tooltip .badge-tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: var(--text-xs);
    font-weight: var(--font-normal);
    white-space: normal;
    width: 200px;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    z-index: 100;
    line-height: 1.4;
}
.grade-chart-total-badge.has-tooltip:hover .badge-tooltip {
    opacity: 1;
    visibility: visible;
}
.grade-salary-chart-body {
    padding: 1rem 1.25rem 0.5rem;
}
.grade-salary-chart-wrapper {
    position: relative;
}
.grade-salary-chart-controls {
    position: absolute;
    top: 4px;
    right: 0;
    z-index: 10;
}
.grade-progression-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}
.grade-progression-toggle-btn:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}
.grade-progression-toggle-btn.active {
    background: var(--brand-green-50);
    border-color: var(--brand-green-400);
    color: var(--brand-green-700);
}
.grade-progression-toggle-btn.active:hover {
    background: var(--brand-green-100);
}
.grade-progression-toggle-btn svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
}
.click-info-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: var(--text-body);
}
.click-info-card.click-info-median {
    border-left-color: var(--danger);
}
.click-info-header {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}
.click-info-id {
    font-weight: var(--font-normal);
    color: var(--gray-400);
    font-size: var(--text-body);
}
.click-info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    color: var(--gray-600);
}
.click-info-row strong {
    color: var(--gray-800);
}
.click-info-tag {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}
.click-info-min {
    background: var(--danger-light);
    color: var(--brand-red-800);
}
.click-info-max {
    background: var(--success-light);
    color: var(--brand-green-800);
}
.click-info-dismiss {
    margin-top: 0.5rem;
    font-size: var(--text-xs);
    color: var(--gray-400);
    cursor: pointer;
    text-align: right;
}
.click-info-dismiss:hover {
    color: var(--gray-600);
}

.pay-equity-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1.25rem;
}

.pay-equity-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s ease;
}

.pay-equity-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.pay-equity-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.pay-equity-header h4 svg {
    color: var(--gray-600);
}

.pay-equity-toggle {
    display: flex;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--brand-green-600);
}

.pay-equity-btn {
    padding: 0.35rem 1rem;
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    border: none;
    cursor: pointer;
    background: white;
    color: var(--brand-green-800);
    transition: all 0.2s;
}

.pay-equity-btn:not(:last-child) {
    border-right: 1px solid var(--brand-green-600);
}

.pay-equity-btn.active {
    background: var(--brand-green-600);
    color: white;
}

.pay-equity-btn:hover:not(.active) {
    background: var(--brand-green-50);
}

.pay-equity-body {
    padding: 1.25rem;
}

.pay-equity-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.pay-equity-summary-overall {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pay-equity-summary-groups {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pay-equity-summary-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--gray-200);
}

.pay-equity-summary-group.equity-good {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.1);
}

.pay-equity-summary-group.equity-moderate {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.1);
}

.pay-equity-summary-group.equity-high {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
}

.pay-equity-summary-group-name {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.pay-equity-summary-group-value {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
}

.pay-equity-summary-group.equity-good .pay-equity-summary-group-value { color: var(--brand-green-600); }
.pay-equity-summary-group.equity-moderate .pay-equity-summary-group-value { color: var(--brand-amber-600); }
.pay-equity-summary-group.equity-high .pay-equity-summary-group-value { color: var(--danger); }

.pay-equity-summary.equity-good {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.pay-equity-summary.equity-moderate {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.pay-equity-summary.equity-high {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.pay-equity-summary-label {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.pay-equity-summary-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
}

.equity-good .pay-equity-summary-value { color: var(--brand-green-600); }
.equity-moderate .pay-equity-summary-value { color: var(--brand-amber-600); }
.equity-high .pay-equity-summary-value { color: var(--danger); }

.pay-equity-summary-desc {
    font-size: var(--text-sm);
    color: var(--gray-500);
    font-style: italic;
}

.pay-equity-table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
}

.pay-equity-table thead th {
    position: relative;
}

.pay-equity-table thead th .header-tooltip .tooltip-text {
    white-space: normal;
    min-width: 220px;
}

.pay-equity-summary .header-tooltip .tooltip-text {
    white-space: normal;
    min-width: 220px;
}

.pay-equity-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
}

.pay-equity-table thead th {
    padding: 0.65rem 0.75rem;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    text-align: center;
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    font-size: var(--text-sm);
    white-space: nowrap;
}

.pay-equity-grade-col {
    text-align: left !important;
    min-width: 120px;
}

.pay-equity-median-col {
    min-width: 100px;
}

.pay-equity-group-col {
    min-width: 110px;
}

.pay-equity-group-summary {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    padding: 1px 6px;
    border-radius: 3px;
    margin-top: 2px;
}

.pay-equity-group-summary.equity-good {
    background: rgba(16, 185, 129, 0.1);
    color: var(--brand-green-600);
}

.pay-equity-group-summary.equity-moderate {
    background: rgba(245, 158, 11, 0.1);
    color: var(--brand-amber-600);
}

.pay-equity-group-summary.equity-high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.pay-equity-table tbody tr {
    border-bottom: 1px solid var(--gray-100);
}

.pay-equity-table tbody tr:hover {
    background: var(--gray-50);
}

.pay-equity-grade-cell {
    padding: 0.65rem 0.75rem;
    text-align: left;
}

.pay-equity-grade-name {
    display: block;
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.pay-equity-grade-count {
    display: block;
    font-size: var(--text-xs);
    color: var(--gray-400);
}

.pay-equity-median-cell {
    padding: 0.65rem 0.75rem;
    text-align: center;
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.pay-equity-group-cell {
    padding: 0.65rem 0.75rem;
    text-align: center;
}

.pay-equity-group-cell.empty {
    color: var(--gray-300);
}

.pay-equity-group-median {
    display: block;
    font-weight: var(--font-medium);
    color: var(--gray-700);
    font-size: var(--text-body);
}

.pay-equity-variance {
    display: inline-block;
    font-weight: var(--font-bold);
    font-size: var(--text-body);
    padding: 1px 8px;
    border-radius: 4px;
    margin-top: 2px;
}

.pay-equity-variance.equity-good {
    background: rgba(16, 185, 129, 0.1);
    color: var(--brand-green-600);
}

.pay-equity-variance.equity-moderate {
    background: rgba(245, 158, 11, 0.1);
    color: var(--brand-amber-600);
}

.pay-equity-variance.equity-high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.pay-equity-group-count {
    display: block;
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-top: 2px;
}

/* ============================================ */
/* Pay Equity Analysis - New Accordion Design   */
/* ============================================ */

.equity-flagged-badge {
    font-size: var(--text-sm);
    color: var(--brand-red-800);
    background: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: var(--font-semibold);
}

/* Summary Cards Row */
.equity-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.equity-summary-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.85rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.equity-summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.equity-summary-card.equity-good::before { background: var(--brand-green-500); }
.equity-summary-card.equity-moderate::before { background: var(--brand-amber-500); }
.equity-summary-card.equity-high::before { background: var(--danger); }

.equity-summary-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.equity-summary-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
}

.equity-summary-card.equity-good .equity-summary-value { color: var(--brand-green-600); }
.equity-summary-card.equity-moderate .equity-summary-value { color: var(--brand-amber-600); }
.equity-summary-card.equity-high .equity-summary-value { color: var(--danger); }

.equity-summary-status {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.15rem;
}

/* Accordion Container */
.equity-accordions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Accordion Item */
.equity-accordion {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
}

.equity-accordion.expanded {
    border-color: var(--gray-300);
}

/* Accordion Header */
.equity-accordion-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    background: var(--gray-50);
    transition: background 0.15s;
}

.equity-accordion-header:hover {
    background: var(--gray-100);
}

.equity-accordion.expanded .equity-accordion-header {
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
}

.equity-accordion-header.underpaid-header {
    background: linear-gradient(135deg, var(--brand-red-50) 0%, var(--brand-red-100) 100%);
}

.equity-accordion-header.underpaid-header:hover {
    background: linear-gradient(135deg, var(--brand-red-100) 0%, var(--brand-red-200) 100%);
}

.equity-accordion.expanded .equity-accordion-header.underpaid-header {
    background: linear-gradient(135deg, var(--brand-red-100) 0%, var(--brand-red-200) 100%);
}

.equity-accordion-icon {
    display: flex;
    align-items: center;
    color: var(--gray-500);
    transition: transform 0.2s;
}

.equity-accordion.expanded .equity-accordion-icon {
    transform: rotate(90deg);
}

.equity-accordion-title {
    flex: 1;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

/* Accordion Content */
.equity-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 1rem;
}

.equity-accordion.expanded .equity-accordion-content {
    padding: 1rem;
}

/* Gap Summary Cards */
.equity-gap-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.equity-gap-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem;
    text-align: center;
}

.equity-gap-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.25rem;
}

.equity-gap-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
}

.equity-gap-value.equity-good { color: var(--brand-green-600); }
.equity-gap-value.equity-moderate { color: var(--brand-amber-600); }
.equity-gap-value.equity-high { color: var(--danger); }

.equity-gap-desc {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.15rem;
}

/* Groups Table */
.equity-groups-table {
    margin-bottom: 1rem;
}

.equity-groups-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
}

.equity-groups-table th {
    padding: 0.6rem 0.75rem;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    text-align: left;
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    font-size: var(--text-sm);
}

.equity-groups-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.equity-groups-table tr:hover {
    background: var(--gray-50);
}

.equity-groups-table tr.reference-row {
    background: rgba(59, 130, 246, 0.05);
}

.equity-groups-table .group-name {
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.equity-groups-table .reference-tag {
    font-size: var(--text-xs);
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-left: 0.5rem;
    font-weight: var(--font-medium);
}

.gap-baseline {
    color: var(--gray-400);
}

.gap-value {
    font-weight: var(--font-bold);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
}

.gap-value.equity-good {
    background: rgba(16, 185, 129, 0.1);
    color: var(--brand-green-600);
}

.gap-value.equity-moderate {
    background: rgba(245, 158, 11, 0.1);
    color: var(--brand-amber-600);
}

.gap-value.equity-high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Grade Breakdown Table */
.equity-grade-breakdown {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.equity-grade-breakdown h5 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin: 0 0 0.75rem 0;
}

.equity-grade-breakdown table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.equity-grade-breakdown th {
    padding: 0.5rem 0.5rem;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    text-align: center;
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    font-size: var(--text-xs);
}

.equity-grade-breakdown td {
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid var(--gray-100);
    text-align: center;
}

.equity-grade-breakdown .grade-cell {
    text-align: left;
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.equity-grade-breakdown .ref-cell {
    background: rgba(59, 130, 246, 0.05);
}

.equity-grade-breakdown .empty-cell {
    color: var(--gray-300);
}

.equity-grade-breakdown .grade-count {
    display: block;
    font-size: var(--text-xs);
    color: var(--gray-400);
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.equity-good { background: var(--brand-green-500); }
.status-dot.equity-moderate { background: var(--brand-amber-500); }
.status-dot.equity-high { background: var(--danger); }

/* Underpaid Employees Section */
.underpaid-intro {
    margin-bottom: 1rem;
}

.underpaid-intro p {
    font-size: var(--text-body);
    color: var(--gray-600);
    margin: 0 0 0.75rem 0;
}

.underpaid-legend {
    display: flex;
    gap: 1.5rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.severity-critical { background: var(--danger); }
.legend-dot.severity-warning { background: var(--brand-amber-500); }

.underpaid-table-wrapper {
    overflow-x: auto;
}

.underpaid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
}

.underpaid-table th {
    padding: 0.6rem 0.75rem;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    text-align: left;
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    font-size: var(--text-sm);
    white-space: nowrap;
}

.underpaid-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.underpaid-table tr:hover {
    background: var(--gray-50);
}

.underpaid-table .name-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.severity-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.severity-indicator.severity-critical { background: var(--danger); }
.severity-indicator.severity-warning { background: var(--brand-amber-500); }

.underpaid-table .emp-name {
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.underpaid-table .emp-id {
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-left: 0.25rem;
}

.underpaid-table .peers-cell {
    text-align: center;
    color: var(--gray-500);
}

.underpaid-more {
    padding: 0.75rem;
    text-align: center;
    font-size: var(--text-body);
    color: var(--gray-500);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

/* Responsive */
@media (max-width: 768px) {
    .equity-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .equity-groups-table,
    .equity-grade-breakdown {
        overflow-x: auto;
    }

    .equity-groups-table table,
    .equity-grade-breakdown table {
        min-width: 400px;
    }

    .underpaid-table {
        min-width: 500px;
    }
}

@media (max-width: 480px) {
    .equity-summary-cards {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .equity-summary-card {
        padding: 0.65rem;
    }

    .equity-summary-value {
        font-size: var(--text-lg);
    }
}

/* ============================================ */
/* Pay Equity Card - New L1/L2/L3 Design        */
/* ============================================ */

/* L1 Metrics Row */
.pay-equity-metrics-row .card-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}

.pay-equity-metrics-row .card-metric-label {
    line-height: 1.3;
    text-align: center;
}

/* Pay equity — lens styles. Builders in client/pay-equity-lenses.js.
   Signed off 2026-09-15. Tokens only; RAG on data because in/out of target is
   the semantic. The old gap-bar + employee-card CSS (raw hex, diverging bar
   with no axis words) lived here until then. */
.peq-overview .tt-note, .peq-below .tt-note { margin-bottom: 0.6rem; }
/* Since plan Phase 2.7 the Overview rows are the bullet graph (± parity); the
   sentence sits under each row, aligned with the track. */
.peq-rows .peq-sentence { margin: 0.1rem 0 0.55rem calc(150px + 0.75rem); }
.peq-row-label { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.peq-row-label small { display: block; font-weight: 400; font-size: 11px; color: var(--gray-500); }
.peq-section { margin: 14px 0 4px; }
.peq-raw { margin: 4px 0 10px; padding: 10px 12px 4px; background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 8px; }
.peq-raw .l1-strip { margin-bottom: 6px; }
.peq-raw .tr-sentence { margin: 0 0 6px; }

.peq-sentence { grid-column: 1 / -1; font-size: 12px; color: var(--gray-600); margin-left: 122px; }
.peq-sentence b { color: var(--gray-900); font-weight: var(--font-semibold); }
.peq-muted { color: var(--gray-400); }


/* Donuts — one per group. The EoS Liability card is the in-app precedent. */

/* Employees lens — the pill row is the approved filter-pill element. */
.peq-pills { margin-bottom: 0.75rem; flex-wrap: wrap; }

/* Method popup — the inline reading key. */
.method-read { display: grid; grid-template-columns: 60px 1fr; gap: 10px; align-items: center; font-size: 13px; color: var(--gray-700); margin-top: 6px; }
.method-read-swatch { display: flex; align-items: center; }

@media (max-width: 640px) {
    .peq-sentence, .peq-below-dim .peq-sentence, .peq-rows .peq-sentence { margin-left: 0; }
}

/* ============================================ */
/* Grade Compression Analysis Card              */
/* ============================================ */

.grade-compression-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1.25rem;
}

.grade-compression-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s ease;
}

.grade-compression-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.grade-compression-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.grade-compression-header h4 svg {
    width: 20px;
    height: 20px;
    color: var(--gray-600);
}

.compression-issues-badge {
    font-size: var(--text-sm);
    color: #991b1b;
    background: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: var(--font-semibold);
}

.compression-healthy-badge {
    font-size: var(--text-sm);
    color: #166534;
    background: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: var(--font-semibold);
}

.grade-compression-body {
    padding: 1.25rem;
}

/* Compression Summary Cards */
.compression-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.compression-summary-card {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--gray-200);
}

.compression-summary-card.warning {
    border-left: 3px solid #f59e0b;
    background: #fffbeb;
}

.compression-summary-card.critical {
    border-left: 3px solid #dc2626;
    background: #fef2f2;
}

.compression-summary-card.healthy {
    border-left: 3px solid #10b981;
    background: #ecfdf5;
}

.compression-summary-label {
    font-size: var(--text-sm);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.compression-summary-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-900);
}

.compression-summary-card.warning .compression-summary-value {
    color: #b45309;
}

.compression-summary-card.critical .compression-summary-value {
    color: #dc2626;
}

.compression-summary-card.healthy .compression-summary-value {
    color: #059669;
}

/* Compression Sections */
.compression-section {
    margin-bottom: 1.5rem;
}

.compression-section:last-child {
    margin-bottom: 0;
}

.compression-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.compression-section-header h5 {
    margin: 0;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.compression-section-header h5 svg {
    width: 16px;
    height: 16px;
    color: var(--gray-500);
}

.compression-section-count {
    font-size: var(--text-sm);
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: var(--gray-600);
    font-weight: var(--font-medium);
}

.compression-section-count.warning {
    background: #fef3c7;
    color: #92400e;
}

.compression-section-count.critical {
    background: #fee2e2;
    color: #991b1b;
}

/* Compression Table */
.compression-table-wrapper {
    overflow-x: auto;
}

.compression-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
}

.compression-table th {
    text-align: left;
    padding: 0.75rem;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    white-space: nowrap;
}

.compression-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-800);
}

.compression-table tr:hover {
    background: var(--gray-50);
}

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

/* Status Badge */
.compression-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}

.compression-status-badge.normal {
    background: #ecfdf5;
    color: #059669;
}

.compression-status-badge.warning {
    background: #fef3c7;
    color: #b45309;
}

.compression-status-badge.critical {
    background: #fee2e2;
    color: #dc2626;
}

/* Overlap Bar Visual */
.compression-overlap-bar {
    width: 100%;
    max-width: 120px;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.compression-overlap-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.compression-overlap-fill.normal {
    background: #10b981;
}

.compression-overlap-fill.warning {
    background: #f59e0b;
}

.compression-overlap-fill.critical {
    background: #dc2626;
}

/* Employee Inversion Row */
.compression-employee-name {
    font-weight: var(--font-medium);
    color: var(--gray-900);
}

.compression-employee-grade {
    font-size: var(--text-body);
    color: var(--gray-500);
}

.compression-salary-diff {
    font-weight: var(--font-semibold);
}

.compression-salary-diff.positive {
    color: #dc2626;
}

/* Healthy State Card */
.compression-healthy-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.compression-healthy-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #ecfdf5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.compression-healthy-icon svg {
    width: 32px;
    height: 32px;
    color: #10b981;
}

.compression-healthy-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.compression-healthy-text {
    font-size: var(--text-body);
    color: var(--gray-600);
    max-width: 400px;
}

/* Grade Overlap Visualization */

/* Responsive */
@media (max-width: 768px) {
    .compression-summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .compression-table-wrapper {
        overflow-x: auto;
    }

    .compression-table {
        min-width: 500px;
    }

}

@media (max-width: 480px) {
    .compression-summary-cards {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .compression-summary-card {
        padding: 0.75rem;
    }

    .compression-summary-value {
        font-size: var(--text-lg);
    }

    .grade-compression-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

}

/* ============================================ */
/* Priority Salary Adjustments Card             */
/* ============================================ */

.priority-employees-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1.25rem;
}

.priority-employees-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s ease;
}

.priority-employees-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.priority-employees-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.priority-employees-header h4 svg {
    color: var(--gray-600);
}

.priority-employees-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.priority-section {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.priority-section.expanded {
    border-color: var(--brand-red-400);
}

.priority-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.priority-section-header.high-priority {
    background: var(--danger-lighter);
}

.priority-section-header.high-priority:hover {
    background: var(--danger-light);
}

.priority-section-header.medium-priority {
    background: var(--warning-lighter);
}

.priority-section-header.medium-priority:hover {
    background: var(--warning-light);
}

.priority-section.expanded .priority-section-header {
    border-bottom: 1px solid var(--gray-200);
}

.priority-section.expanded .salary-range-expand-icon {
    transform: rotate(90deg);
    color: var(--danger);
}

.priority-section-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.priority-label {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.priority-desc {
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-weight: var(--font-normal);
}

.priority-count {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
}

.priority-count.high {
    background: var(--brand-red-200);
    color: var(--brand-red-800);
}

.priority-count.medium {
    background: var(--brand-amber-200);
    color: var(--brand-amber-800);
}

.priority-section-content {
    padding: 0.75rem 1rem;
}

.priority-section-content.hidden {
    display: none;
}

.salary-emp-table .emp-dept {
    font-size: var(--text-xs);
    color: var(--gray-400);
    display: block;
}

/* ============================================ */
/* Compensation Distribution (Consolidated)     */
/* ============================================ */

.salary-distribution-explorer-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1.25rem;
}

.salary-distribution-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    transition: background 0.15s ease;
}

.salary-distribution-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.salary-distribution-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.salary-distribution-header h4 svg {
    stroke: var(--gray-600);
    flex-shrink: 0;
}

/* Basic Salary / TGC View Toggle */
.comp-dist-view-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}

.comp-dist-view-btn {
    padding: 0.25rem 0.6rem;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: transparent;
    color: var(--brand-green-800);
    transition: all 0.15s ease;
}

.comp-dist-view-btn:hover {
    background: rgba(255, 255, 255, 0.6);
}

.comp-dist-view-btn.active {
    background: white;
    color: var(--brand-green-900);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.comp-dist-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-left: 0.5rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-sm, 6px);
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all 0.15s ease;
    vertical-align: middle;
}

.comp-dist-expand-btn:hover {
    background: rgba(255,255,255,0.4);
    border-color: rgba(255,255,255,0.5);
}

.comp-dist-expand-btn svg {
    stroke: var(--brand-green-900);
}

.benchmark-card-indigo .comp-dist-expand-btn svg {
    stroke: currentColor;
}

.salary-distribution-content {
    padding: 1rem;
}

.salary-dist-grade-view {
    transition: opacity 0.15s ease;
}

.salary-dist-grade-view.hidden {
    display: none;
}

.salary-dist-legend {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

/* Grade view controls */
.grade-view-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.salary-dist-grade-chart {
    transition: opacity 0.15s ease;
}

.salary-dist-grade-chart.hidden {
    display: none;
}

/* Outlier indicator */
.salary-range-outlier-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--amber-600);
    flex-shrink: 0;
}

.salary-range-grade-wrapper.has-outliers .salary-range-grade {
    cursor: pointer;
}

.salary-range-grade-wrapper.has-outliers .salary-range-grade:hover {
    background: var(--amber-50);
}

/* Modal styles */
.salary-dist-modal-stats {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.salary-dist-modal-stats .stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.salary-dist-modal-stats .stat-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.salary-dist-modal-stats .stat-value {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--gray-900);
}

.salary-dist-modal-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.salary-dist-modal-summary .summary-item {
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
}

.salary-dist-modal-summary .summary-below-p25 {
    color: #b45309;
    background: #fef3c7;
}

.salary-dist-modal-summary .summary-above-p75 {
    color: #1d4ed8;
    background: #dbeafe;
}

.salary-dist-modal-summary .summary-cost-p50 {
    color: var(--gray-700);
    background: var(--gray-100);
}

.salary-dist-modal-summary .summary-all-good {
    color: #047857;
    background: #d1fae5;
}

.salary-dist-modal-table-wrapper {
    max-height: 400px;
    overflow-y: auto;
}

.salary-dist-employee-table {
    width: 100%;
    font-size: var(--text-body);
    border-collapse: collapse;
}

.salary-dist-employee-table th {
    text-align: left;
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
}

.salary-dist-employee-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.salary-dist-employee-table .text-right {
    text-align: right;
}

.salary-dist-employee-table .employee-name {
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

.salary-dist-employee-table tr.employee-below-p25 {
    background: #fffbeb;
}

.salary-dist-employee-table tr.employee-above-p75 {
    background: #eff6ff;
}

.salary-dist-employee-table .compa-ratio {
    font-weight: var(--font-semibold);
}

.salary-dist-employee-table .compa-low {
    color: var(--amber-600);
}

.salary-dist-employee-table .compa-high {
    color: var(--blue-600);
}

/* Outliers modal sections */
.outliers-section {
    margin-bottom: 1.5rem;
}

.outliers-section:last-child {
    margin-bottom: 0;
}

.outliers-section-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.outliers-section-title.below-p25 {
    color: #b45309;
    background: #fef3c7;
}

.outliers-section-title.above-p75 {
    color: #1d4ed8;
    background: #dbeafe;
}

.salary-dist-employee-table .emp-name {
    display: block;
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

.salary-dist-employee-table .emp-id {
    display: block;
    font-size: var(--text-xs);
    color: var(--gray-500);
}

/* ============================================ */
/* TGC Distribution Explorer Card               */
/* (DEPRECATED - kept for backwards compat)     */
/* ============================================ */

.tgc-explorer-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1.5rem;
}

.tgc-explorer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    transition: background 0.15s ease;
}

.tgc-explorer-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.tgc-explorer-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: #64748b;
    margin: 0;
}

.tgc-explorer-header h4 svg {
    stroke: var(--gray-600);
    flex-shrink: 0;
}

.tgc-explorer-header .header-tooltip .tooltip-text {
    color: var(--gray-700);
}

.tgc-explorer-content {
    padding: 1rem;
}

.tgc-explorer-diagram-box {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.tgc-explorer-diagram-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.tgc-diagram-title {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--primary);
}

.tgc-diagram-count {
    font-size: var(--text-sm);
    color: var(--gray-500);
    font-weight: var(--font-medium);
}

.tgc-explorer-diagram-content {
    min-height: 80px;
}

.tgc-explorer-diagram-content .salary-range-single-salary {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--primary);
}

.tgc-explorer-pills-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tgc-explorer-pills-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.tgc-explorer-divisions,
.tgc-explorer-departments {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tgc-pills-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tgc-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.tgc-explorer-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.35rem 0.65rem;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-700);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.tgc-explorer-pill:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

.tgc-explorer-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.tgc-explorer-pill.active .tgc-pill-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.tgc-pill-count {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    background: var(--gray-200);
    padding: 0.1rem 0.35rem;
    border-radius: 9999px;
    min-width: 1.25rem;
    text-align: center;
}

.tgc-overall-pill {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-indigo-100) 100%);
    border-color: var(--brand-indigo-200);
    color: var(--primary);
}

.tgc-overall-pill:hover {
    background: linear-gradient(135deg, var(--brand-indigo-100) 0%, var(--brand-indigo-200) 100%);
}

.tgc-overall-pill .tgc-pill-count {
    background: rgba(91, 33, 182, 0.15);
    color: var(--primary);
}

.tgc-division-pill {
    background: linear-gradient(135deg, var(--brand-indigo-100) 0%, var(--brand-indigo-200) 100%);
    border-color: var(--brand-indigo-300);
    color: var(--brand-indigo-700);
}

.tgc-division-pill:hover {
    background: linear-gradient(135deg, var(--brand-indigo-200) 0%, var(--brand-indigo-300) 100%);
}

.tgc-division-pill .tgc-pill-count {
    background: rgba(3, 105, 161, 0.15);
    color: var(--brand-indigo-700);
}

.tgc-department-pill {
    background: linear-gradient(135deg, var(--brand-amber-100) 0%, var(--brand-amber-200) 100%);
    border-color: var(--brand-amber-300);
    color: var(--brand-amber-800);
}

.tgc-department-pill:hover {
    background: linear-gradient(135deg, var(--brand-amber-200) 0%, var(--brand-amber-300) 100%);
}

.tgc-department-pill .tgc-pill-count {
    background: rgba(146, 64, 14, 0.15);
    color: var(--brand-amber-800);
}

.tgc-explorer-departments.hidden {
    display: none;
}

/* ============================================ */
/* Grade Distribution Explorer Card             */
/* ============================================ */

.grade-explorer-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1.5rem;
}

.grade-explorer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    transition: background 0.15s ease;
}

.grade-explorer-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.grade-explorer-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: #64748b;
    margin: 0;
}

.grade-explorer-header h4 svg {
    stroke: var(--gray-600);
    flex-shrink: 0;
}

.grade-explorer-header .header-tooltip .tooltip-text {
    color: var(--gray-700);
}

.grade-explorer-content {
    padding: 1rem;
}

.grade-explorer-diagram-box {
    background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--brand-green-100) 100%);
    border: 1px solid var(--brand-green-200);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.grade-explorer-diagram-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #bbf7d0;
}

.grade-diagram-title {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--brand-green-600);
}

.grade-diagram-count {
    font-size: var(--text-sm);
    color: var(--gray-500);
    font-weight: var(--font-medium);
}

.grade-explorer-diagram-content {
    min-height: 80px;
}

.grade-explorer-diagram-content .salary-range-single-salary {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--brand-green-600);
}

.grade-explorer-compare-content {
    margin-top: 0.75rem;
}

.grade-explorer-compare-content.hidden {
    display: none;
}

/* Compact range bar for comparison view */
.compact-range-bar {
    position: relative;
}

.compact-range-track {
    position: relative;
    height: 12px;
    background: var(--gray-100);
    border-radius: 6px;
    overflow: visible;
}

.compact-range-whisker {
    position: absolute;
    top: 5px;
    height: 2px;
    background: var(--gray-300);
}

.compact-range-box {
    position: absolute;
    top: 2px;
    height: 8px;
    background: linear-gradient(135deg, var(--brand-green-500) 0%, var(--brand-green-600) 100%);
    border-radius: 4px;
}

.compact-range-median {
    position: absolute;
    top: 0;
    width: 2px;
    height: 12px;
    background: var(--danger);
    border-radius: 1px;
    transform: translateX(-50%);
}

.compact-range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    font-size: var(--text-xs);
    color: var(--gray-400);
}

.grade-explorer-pills-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.grade-explorer-pills-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.grade-explorer-bands,
.grade-explorer-grades {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.grade-pills-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grade-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.grade-explorer-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.35rem 0.65rem;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-700);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.grade-explorer-pill:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

.grade-explorer-pill.active {
    background: var(--brand-green-600);
    border-color: var(--brand-green-600);
    color: #fff;
}

.grade-explorer-pill.active .grade-pill-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.grade-pill-count {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    background: var(--gray-200);
    padding: 0.1rem 0.35rem;
    border-radius: 9999px;
    min-width: 1.25rem;
    text-align: center;
}

.grade-overall-pill {
    background: linear-gradient(135deg, var(--brand-green-100) 0%, var(--brand-green-200) 100%);
    border-color: var(--brand-green-300);
    color: var(--brand-green-700);
}

.grade-overall-pill:hover {
    background: linear-gradient(135deg, var(--brand-green-200) 0%, var(--brand-green-300) 100%);
}

.grade-overall-pill .grade-pill-count {
    background: rgba(4, 120, 87, 0.15);
    color: var(--brand-green-700);
}

.grade-compare-pill {
    background: linear-gradient(135deg, var(--brand-amber-100) 0%, var(--brand-amber-200) 100%);
    border-color: var(--brand-amber-300);
    color: var(--brand-amber-800);
}

.grade-compare-pill:hover {
    background: linear-gradient(135deg, var(--brand-amber-200) 0%, var(--brand-amber-300) 100%);
}

.grade-compare-pill svg {
    stroke: #92400e;
}

.grade-compare-pill.active {
    background: var(--warning);
    border-color: var(--warning);
    color: #fff;
}

.grade-compare-pill.active svg {
    stroke: #fff;
}

.grade-compare-grades-pill {
    background: linear-gradient(135deg, var(--brand-indigo-100) 0%, var(--brand-indigo-200) 100%);
    border-color: var(--brand-indigo-300);
    color: var(--brand-indigo-700);
}

.grade-compare-grades-pill:hover {
    background: linear-gradient(135deg, var(--brand-indigo-200) 0%, var(--brand-indigo-300) 100%);
}

.grade-compare-grades-pill svg {
    stroke: var(--brand-indigo-700);
}

.grade-compare-grades-pill.active {
    background: var(--brand-indigo-500);
    border-color: var(--brand-indigo-500);
    color: #fff;
}

.grade-compare-grades-pill.active svg {
    stroke: #fff;
}

/* Grade comparison grid for individual grades */
.grade-compare-grades-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.grade-compare-grade-item {
    cursor: pointer;
    border-left-color: var(--brand-indigo-300);
    transition: all 0.15s ease;
}

.grade-compare-grade-item:hover {
    background: var(--brand-pink-50);
    border-color: var(--brand-indigo-300);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.1);
}

.grade-compare-grade-item .grade-compare-title {
    color: var(--brand-indigo-700);
}

.grade-single-value {
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-500);
}

/* Grade Compare View Toggle */
.grade-view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.grade-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
}

.grade-view-btn:hover {
    background: var(--gray-200);
}

.grade-view-btn.active {
    background: var(--brand-green-600);
    border-color: var(--brand-green-600);
    color: #fff;
}

.grade-view-btn.active svg {
    stroke: #fff;
}

.grade-view-btn svg {
    stroke: var(--gray-500);
}

.grade-compare-view.hidden {
    display: none;
}

/* Stacked Range Bars Chart */
.grade-stacked-chart {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.grade-stacked-header {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.grade-stacked-bars {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
}

.grade-stacked-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s ease;
}

.grade-stacked-row:hover {
    background: var(--success-lighter);
}

.grade-stacked-label {
    flex: 0 0 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    min-width: 0;
}

.grade-stacked-name {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grade-stacked-count {
    font-size: var(--text-xs);
    color: var(--gray-400);
    flex-shrink: 0;
}

.grade-stacked-bar-area {
    flex: 1;
    position: relative;
    height: 18px;
    background: var(--gray-50);
    border-radius: 3px;
}

.grade-stacked-whisker-left,
.grade-stacked-whisker-right {
    position: absolute;
    top: 8px;
    height: 2px;
    background: var(--gray-300);
}

.grade-stacked-box {
    position: absolute;
    top: 3px;
    height: 12px;
    background: linear-gradient(135deg, var(--brand-green-500) 0%, var(--brand-green-600) 100%);
    border-radius: 2px;
    opacity: 0.85;
}

.grade-stacked-row:hover .grade-stacked-box {
    opacity: 1;
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.3);
}

.grade-stacked-median {
    position: absolute;
    top: 1px;
    width: 2px;
    height: 16px;
    background: var(--danger);
    border-radius: 1px;
    transform: translateX(-50%);
    z-index: 2;
}

.grade-stacked-endpoint {
    position: absolute;
    top: 6px;
    width: 6px;
    height: 6px;
    background: var(--gray-400);
    border-radius: 50%;
    transform: translateX(-50%);
}

.grade-stacked-endpoint.grade-stacked-min {
    background: var(--gray-400);
}

.grade-stacked-endpoint.grade-stacked-max {
    background: var(--gray-400);
}

.grade-stacked-scale {
    position: relative;
    height: 20px;
    margin-top: 0.5rem;
    margin-left: 108px;
    border-top: 1px solid var(--gray-200);
}

.grade-scale-tick {
    position: absolute;
    top: 4px;
    font-size: var(--text-xs);
    color: var(--gray-400);
    transform: translateX(-50%);
    white-space: nowrap;
}

.grade-scale-tick:first-child {
    transform: translateX(0);
}

.grade-scale-tick:last-child {
    transform: translateX(-100%);
}

.grade-stacked-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-100);
}

.grade-stacked-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.grade-stacked-legend .legend-swatch {
    width: 12px;
    height: 8px;
    border-radius: 2px;
}

.grade-stacked-legend .legend-whisker {
    background: var(--gray-300);
    height: 2px;
}

.grade-stacked-legend .legend-box {
    background: linear-gradient(135deg, var(--brand-green-500) 0%, var(--brand-green-600) 100%);
}

.grade-stacked-legend .legend-median {
    width: 2px;
    height: 10px;
    background: var(--danger);
}

/* Grade stacked chart hover tooltip */
.grade-stacked-row {
    position: relative;
}

/* Grade overlap vertical connectors */
.grade-stacked-chart {
    position: relative;
}

.grade-overlap-connectors-overlay {
    position: absolute;
    top: 0;
    left: 100px; /* Match label width */
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 40;
}

.grade-overlap-connector {
    position: absolute;
    width: 3px;
    background: var(--color-danger-600, #dc2626);
    border-radius: 2px;
    z-index: 50;
    pointer-events: none;
    box-shadow: 0 0 6px rgba(220, 38, 38, 0.4);
}

.grade-overlap-connector::before,
.grade-overlap-connector::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 9px;
    height: 9px;
    background: var(--color-danger-600, #dc2626);
    border-radius: 50%;
    border: 2px solid var(--white, white);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.2));
}

.grade-overlap-connector::before {
    top: -4px;
}

.grade-overlap-connector::after {
    bottom: -4px;
}

.grade-overlap-label {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-danger-600, #dc2626);
    color: var(--white, white);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 2px 6px;
    border-radius: var(--radius-sm, 4px);
    white-space: nowrap;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.2));
}

/* Grade progression section */
.grade-progression-section {
    margin-top: -4px;
    padding-top: 0;
    border-top: none;
    /* Align with chart area - account for y-axis labels */
    margin-left: 52px;
    margin-right: 12px;
}

.grade-progression-row {
    display: flex;
    align-items: center;
    padding: 2px 0;
}

.grade-progression-label {
    width: 50px;
    flex-shrink: 0;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    padding-right: 6px;
}

.grade-progression-values {
    display: flex;
    flex: 1;
    justify-content: space-around;
}

.grade-progression-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0;
}

.grade-progression-item .progression-value {
    padding: 2px 6px;
    border-radius: 4px;
}

.grade-progression-item .progression-grade-label {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.grade-progression-item.progression-baseline .progression-value {
    color: var(--gray-400);
}

.grade-progression-item .progression-value {
    color: var(--color-success-600, #16a34a);
}

.grade-progression-item.progression-warning .progression-value {
    color: var(--color-warning-700, #b45309);
}

.grade-progression-item.progression-danger .progression-value {
    color: var(--color-danger-600, #dc2626);
}

.grade-progression-item.progression-target .progression-value {
    color: var(--gray-400);
    font-weight: var(--font-medium);
}

/* Pill boxes for concerning progressions */
.grade-progression-item .progression-value.progression-pill {
    border-radius: var(--radius-full, 9999px);
    padding: 2px 8px;
}

.grade-progression-item.progression-danger .progression-value.progression-pill {
    background: var(--color-danger-50, #fef2f2);
    border: 1px solid var(--color-danger-600, #dc2626);
}

.grade-progression-item.progression-warning .progression-value.progression-pill {
    background: var(--color-warning-50, #fffbeb);
    border: 1px solid var(--color-warning-500, #f59e0b);
}

/* Grade progression legend */
.grade-progression-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--gray-200);
}

.progression-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.progression-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-sm, 4px);
}

.progression-legend-good {
    background: var(--color-success-100, #dcfce7);
    border: 1px solid var(--color-success-600, #16a34a);
}

.progression-legend-warning {
    background: var(--color-warning-100, #fef3c7);
    border: 1px solid var(--color-warning-500, #f59e0b);
}

.progression-legend-danger {
    background: var(--color-danger-50, #fef2f2);
    border: 1px solid var(--color-danger-600, #dc2626);
}

/* Overlap toggle button active state */
.grade-overlap-toggle-btn.active {
    background: var(--color-danger-50, #fef2f2) !important;
    border-color: var(--color-danger-600, #dc2626) !important;
    color: var(--color-danger-600, #dc2626) !important;
}

.grade-overlap-toggle-btn.active svg {
    stroke: var(--color-danger-600, #dc2626);
}

/* ===== Employee Overlay Search ===== */
.salary-overlay-search-container {
    position: relative;
}

.salary-overlay-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.salary-overlay-search-icon {
    position: absolute;
    left: 10px;
    color: var(--gray-400);
    pointer-events: none;
}

.salary-overlay-search {
    padding: 6px 10px 6px 32px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md, 8px);
    font-size: var(--text-body);
    width: 440px;
    background: var(--white);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.salary-overlay-search:focus {
    outline: none;
    border-color: var(--brand-green-500, #22c55e);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.salary-overlay-search::placeholder {
    color: var(--gray-400);
}

/* Approved scoped-use 2026-06-11: .salary-overlay-dropdown is the autocomplete-result
   dropdown anchored below a search input (different from .dropdown-menu which is
   fixed-positioned). Scope: salary benchmark overlay only. */
.salary-overlay-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 4px;
    display: none;
}
.salary-overlay-dropdown.visible {
    display: block;
}

.salary-overlay-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.1s ease;
}

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

.salary-overlay-item:hover {
    background: var(--gray-50);
}

.salary-overlay-item-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 2px;
}

.salary-overlay-item-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.salary-overlay-item-grade {
    background: var(--brand-green-100, #dcfce7);
    color: var(--brand-green-700, #15803d);
    padding: 1px 6px;
    border-radius: var(--radius-sm, 4px);
    font-weight: var(--font-medium);
}

.salary-overlay-item-ratio {
    color: var(--gray-600);
    font-weight: var(--font-medium);
}

.salary-overlay-no-results {
    padding: 12px;
    text-align: center;
    color: var(--gray-500);
    font-size: var(--text-body);
}

/* Selected employee chips */
.salary-overlay-chips-row {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    margin-top: 4px;
}

.salary-overlay-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.salary-overlay-clear-all {
    padding: 4px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md, 8px);
    background: var(--white);
    color: var(--gray-600);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.salary-overlay-clear-all:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

.salary-overlay-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 12px;
    border-radius: var(--radius-full, 9999px);
    color: var(--white);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
}

.salary-overlay-chip-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.salary-overlay-chip-remove {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: var(--white);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.salary-overlay-chip-remove:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Employee markers on chart */
.salary-overlay-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.salary-overlay-marker {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translateX(-50%) translateY(-50%);
    top: 50%;
    border: 2px solid var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    cursor: pointer;
    z-index: 60;
}

.salary-overlay-marker-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: var(--white);
    padding: 8px 12px;
    border-radius: var(--radius-md, 8px);
    font-size: var(--text-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.salary-overlay-marker:hover .salary-overlay-marker-tooltip {
    opacity: 1;
    visibility: visible;
}

.salary-overlay-marker-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--gray-900);
}

.marker-tooltip-name {
    font-weight: var(--font-semibold);
    margin-bottom: 4px;
    font-size: var(--text-body);
}

.marker-tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--gray-300);
}

.marker-tooltip-row span:first-child {
    color: var(--gray-400);
}

/* Ensure bar area has relative positioning */
.grade-stacked-bar-area {
    position: relative;
}

/* ===== Department Filter Pills ===== */
.dept-filter-section {
    margin-bottom: 12px;
}

.dept-filter-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Clear button */
.dept-filter-clear {
    padding: 6px 14px;
    border-radius: var(--radius-full, 9999px);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid var(--gray-300);
    background: var(--white);
    color: var(--gray-500);
    margin-left: auto;
}

.dept-filter-clear:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

/* ===== Empty Grade Row (Grayed Out) ===== */
.grade-stacked-row.grade-row-empty {
    opacity: 0.5;
    cursor: default;
}

.grade-stacked-row.grade-row-empty .grade-stacked-label {
    color: var(--gray-400);
}

.grade-stacked-row.grade-row-empty .grade-stacked-count {
    color: var(--gray-400);
}

.grade-stacked-bar-area.empty {
    background: var(--gray-100);
    border-radius: var(--radius-sm, 4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.grade-empty-message {
    font-size: var(--text-xs);
    color: var(--gray-400);
    font-style: italic;
}

/* ===== Grade Chart with Detail Panel (80/20 Split) ===== */
.grade-chart-with-panel {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.grade-chart-with-panel .salary-dist-grade-chart {
    flex: 0 0 80%;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.grade-chart-with-panel .salary-dist-grade-chart .grade-stacked-chart {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.grade-chart-with-panel .salary-dist-grade-chart .grade-stacked-bars {
    flex: 1;
}

.grade-detail-panel {
    flex: 0 0 calc(20% - 16px);
    min-width: 180px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md, 8px);
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.grade-detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--gray-400);
    padding: 24px 12px;
    gap: 12px;
    flex: 1;
}

.grade-detail-placeholder svg {
    stroke: var(--gray-300);
}

.grade-detail-placeholder span {
    font-size: var(--text-body);
    line-height: 1.4;
}

/* Detail Panel Content */
.grade-detail-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.grade-detail-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.grade-detail-name {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}

.grade-detail-dept {
    font-size: var(--text-sm);
    color: var(--brand-teal-600, #0d9488);
    font-weight: var(--font-medium);
}

.grade-detail-type {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    font-weight: var(--font-semibold);
}

/* Detail Panel Bar */
.grade-detail-bar-section {
    padding: 12px 0;
}

.grade-detail-bar {
    position: relative;
    height: 16px;
    background: var(--gray-200);
    border-radius: var(--radius-sm, 4px);
    margin-bottom: 8px;
}

.grade-detail-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-200);
    border-radius: var(--radius-sm, 4px);
}

.grade-detail-bar-iqr {
    position: absolute;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--brand-green-400, #4ade80) 0%, var(--brand-green-500, #22c55e) 100%);
    border-radius: var(--radius-sm, 4px);
}

.grade-detail-marker {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    background: var(--gray-700);
    transform: translateX(-50%);
}

.grade-detail-marker.grade-detail-median {
    width: 3px;
    background: var(--brand-green-700, #15803d);
}

.grade-detail-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--gray-500);
    padding: 0 4px;
}

/* Detail Panel Stats */
.grade-detail-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.grade-detail-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-sm);
}

.grade-detail-stat-label {
    color: var(--gray-500);
}

.grade-detail-stat-value {
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.grade-detail-stat-value.highlight {
    color: var(--brand-green-600, #16a34a);
    font-weight: var(--font-bold);
}

.grade-detail-hint {
    font-size: var(--text-xs);
    color: var(--gray-400);
    text-align: center;
    padding-top: 8px;
    border-top: 1px dashed var(--gray-200);
}

/* Active row highlight */
.grade-stacked-row.active {
    background: var(--brand-green-50, #f0fdf4);
}

.grade-stacked-row.active .grade-stacked-label {
    color: var(--brand-green-700, #15803d);
}

/* ===== Compensation Distribution Expanded View ===== */
.comp-dist-expanded-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1rem;
}

.comp-dist-expanded-controls {
    display: flex;
    gap: 0.75rem;
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.comp-dist-expanded-search {
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md, 8px);
    font-size: var(--text-body);
    width: 400px;
    background: var(--white);
}

.comp-dist-expanded-search:focus {
    outline: none;
    border-color: var(--brand-green-500, #22c55e);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.comp-dist-expanded-filters {
    padding: 0.5rem 0 1rem 0;
}

.comp-dist-expanded-chart-area {
    flex: 1;
    display: flex;
    gap: 1.5rem;
    min-height: 0;
}

.comp-dist-expanded-chart {
    flex: 0 0 78%;
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    overflow-y: auto;
}

.comp-dist-expanded-chart .grade-stacked-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.comp-dist-expanded-chart .grade-stacked-row {
    padding: 0.5rem 0;
}

.comp-dist-expanded-chart .grade-stacked-bar-area {
    height: 24px;
}

.comp-dist-expanded-chart .grade-stacked-box {
    height: 16px;
    top: 4px;
}

.comp-dist-expanded-chart .grade-stacked-whisker-left,
.comp-dist-expanded-chart .grade-stacked-whisker-right {
    top: 11px;
}

.comp-dist-expanded-chart .grade-stacked-median {
    height: 22px;
    top: 1px;
}

.comp-dist-expanded-chart .grade-stacked-endpoint {
    top: 9px;
}

.comp-dist-expanded-chart .grade-stacked-label {
    flex: 0 0 120px;
}

.comp-dist-expanded-chart .grade-stacked-name {
    font-size: var(--text-body);
}

.comp-dist-expanded-chart .grade-stacked-count {
    font-size: var(--text-xs);
}

/* Fix overlap connector positioning for expanded view's wider labels */
#expanded-salary-dist-grade-chart .grade-overlap-connectors-overlay {
    left: 120px;
}

.comp-dist-expanded-panel {
    flex: 0 0 calc(22% - 1.5rem);
    min-width: 220px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md, 8px);
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.comp-dist-expanded-panel .grade-detail-placeholder {
    flex: 1;
}

.comp-dist-expanded-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    align-items: center;
    min-height: 0;
    transition: padding 0.15s ease, min-height 0.15s ease;
}

.comp-dist-expanded-chips.has-chips {
    padding: 0.75rem 0;
    min-height: 36px;
}

.comp-dist-expanded-chart .grade-scale-axis {
    margin-top: 1rem;
}

.comp-dist-expanded-chart .grade-stacked-legend {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

/* Expanded modal header */
#comp-dist-expanded-modal .modal-header {
    background: linear-gradient(135deg, var(--brand-green-100) 0%, var(--brand-green-200) 100%);
    color: var(--brand-green-900);
    border-radius: var(--radius-md, 8px) var(--radius-md, 8px) 0 0;
}

#comp-dist-expanded-modal .modal-header h3 {
    color: var(--brand-green-900);
}

#comp-dist-expanded-modal .modal-close {
    color: var(--brand-green-700);
    opacity: 0.8;
}

#comp-dist-expanded-modal .modal-close:hover {
    opacity: 1;
}

/* Salary distribution modal needs higher z-index to appear above expanded modal */
#salary-dist-modal {
    z-index: 1100;
}

/* ===== Grade Department Modal ===== */
.grade-dept-modal-content {
    padding: 0;
}

.grade-dept-svg-section {
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius-md, 8px);
    margin-bottom: 16px;
}

.grade-dept-bar-container {
    margin-bottom: 16px;
}

.grade-dept-bar {
    position: relative;
    height: 24px;
    background: var(--gray-200);
    border-radius: var(--radius-sm, 4px);
    margin-bottom: 8px;
}

.grade-dept-bar-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--gray-200) 0%, var(--gray-300) 100%);
    border-radius: var(--radius-sm, 4px);
}

.grade-dept-bar-iqr {
    position: absolute;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--brand-green-400, #4ade80) 0%, var(--brand-green-500, #22c55e) 100%);
    border-radius: var(--radius-sm, 4px);
}

.grade-dept-marker {
    position: absolute;
    top: -8px;
    bottom: -8px;
    width: 3px;
    background: var(--gray-800);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.grade-dept-marker-label {
    position: absolute;
    top: -20px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    white-space: nowrap;
}

.grade-dept-marker-value {
    position: absolute;
    bottom: -20px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    white-space: nowrap;
}

.grade-dept-marker.grade-dept-p50 {
    background: var(--brand-green-700, #15803d);
    width: 4px;
}

.grade-dept-bar-scale {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--gray-500);
    padding-top: 8px;
}

.grade-dept-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.grade-dept-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.grade-dept-stat-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}

.grade-dept-stat-label {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

/* Policy Lines */
.grade-policy-line {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 2px;
    background: var(--danger-color, #dc2626);
    border: 1px dashed var(--danger-color, #dc2626);
    background: transparent;
    z-index: 5;
}

.grade-policy-line .policy-line-label {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--danger-color, #dc2626);
    white-space: nowrap;
}

.grade-policy-line.policy-min .policy-line-label::before {
    content: 'Policy ';
}

.grade-policy-line.policy-max .policy-line-label::before {
    content: 'Policy ';
}

.grade-policy-line .policy-line-value {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    color: var(--danger-color, #dc2626);
    white-space: nowrap;
    background: white;
    padding: 0 2px;
}

/* Policy Toggle */
.grade-policy-toggle {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.policy-toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-body);
    color: var(--gray-600);
    cursor: pointer;
    user-select: none;
}

.policy-toggle-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--danger-color, #dc2626);
}

/* Policy Summary */
.grade-policy-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: var(--text-body);
    color: #991b1b;
}

.policy-warning-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger-color, #dc2626);
}

/* Employee policy indicator */
.employee-policy-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger-color, #dc2626);
    margin-right: 6px;
    vertical-align: middle;
}

.employee-outside-policy {
    background: #fef2f2;
}

.employee-outside-policy:hover {
    background: #fee2e2;
}

/* Employee List Section */
.grade-dept-employees-section {
    border-top: 1px solid var(--gray-200);
    padding-top: 12px;
}

.grade-dept-toggle-employees {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md, 8px);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    justify-content: center;
}

.grade-dept-toggle-employees:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.grade-dept-toggle-icon {
    transition: transform 0.2s ease;
}

.grade-dept-employee-list {
    margin-top: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.grade-dept-employee-list.hidden {
    display: none;
}

.grade-dept-employee-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
}

.grade-dept-employee-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--gray-100);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
}

.grade-dept-employee-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.grade-dept-employee-table tr.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.grade-dept-employee-table tr.clickable-row:hover td {
    background-color: var(--gray-100);
}

.grade-dept-employee-table tr.employee-below-p25 td {
    background: var(--color-danger-50, #fef2f2);
}

.grade-dept-employee-table tr.employee-above-p75 td {
    background: var(--color-warning-50, #fffbeb);
}

.grade-dept-employee-table .text-right {
    text-align: right;
}

/* Overlaid employee highlights in modal */
.grade-modal-overlay-marker {
    position: absolute;
    top: -6px;
    bottom: -6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transform: translateX(-50%);
    top: 50%;
    margin-top: -6px;
    border: 2px solid var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.grade-dept-employee-table tr.employee-overlaid {
    position: relative;
}

.grade-dept-employee-table tr.employee-overlaid td:first-child {
    padding-left: 28px;
    position: relative;
}

.employee-overlay-dot {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--white);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.grade-dept-employee-table tr.employee-overlaid td {
    background: color-mix(in srgb, var(--overlay-color) 10%, transparent) !important;
    border-left: 3px solid var(--overlay-color);
}

.grade-dept-employee-table tr.employee-overlaid td:first-child {
    border-left: 3px solid var(--overlay-color);
}

.grade-dept-employee-table tr.employee-overlaid td:not(:first-child) {
    border-left: none;
}

/* Grade progression explanation section */
.grade-progression-explanation {
    margin-top: 12px;
    padding: 12px;
    background: var(--color-primary-50, #eef2ff);
    border: 1px solid var(--color-primary-200, #c7d2fe);
    border-radius: var(--radius-md, 8px);
}

.progression-explanation-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    cursor: pointer;
    user-select: none;
    color: var(--color-primary-700, #4338ca);
    margin-bottom: 8px;
}

.progression-explanation-header svg {
    stroke: var(--color-primary-500, #6366f1);
}

.progression-explanation-header .progression-chevron {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.grade-progression-explanation.collapsed .progression-chevron {
    transform: rotate(-90deg);
}

.progression-explanation-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease, margin-top 0.2s ease;
    opacity: 1;
    margin-top: 8px;
    font-size: var(--text-xs);
    line-height: 1.5;
    color: var(--gray-700, #374151);
}

.grade-progression-explanation.collapsed .progression-explanation-content {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.progression-explanation-content p {
    margin: 0 0 8px 0;
}

.progression-explanation-content p:last-child {
    margin-bottom: 0;
}

.progression-explanation-content ul {
    margin: 4px 0 8px 0;
    padding-left: 16px;
}

.progression-explanation-content li {
    margin-bottom: 4px;
}

.progression-explanation-content strong {
    color: var(--gray-800, #1f2937);
}

.grade-individual-pill {
    background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--brand-green-100) 100%);
    border-color: var(--brand-green-200);
    color: var(--brand-green-700);
}

.grade-individual-pill:hover {
    background: linear-gradient(135deg, var(--brand-green-100) 0%, var(--brand-green-200) 100%);
}

.grade-individual-pill .grade-pill-count {
    background: rgba(4, 120, 87, 0.15);
    color: var(--brand-green-700);
}

.grade-explorer-grades.hidden {
    display: none;
}

/* Grade Explorer Employee List */
.grade-employee-list-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--color-neutral-50, #f9fafb);
    border: 1px solid var(--color-neutral-200, #e5e7eb);
    border-radius: var(--radius-md, 0.5rem);
}

.grade-employee-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-neutral-200, #e5e7eb);
}

.grade-employee-list-header h5 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--color-neutral-800, #1f2937);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grade-employee-list-header h5 svg {
    width: 18px;
    height: 18px;
    stroke: var(--color-primary-600, #4f46e5);
}

.grade-employee-list-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--color-neutral-800, #1f2937);
}

.grade-employee-list-close {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: 1px solid var(--color-neutral-300, #d1d5db);
    border-radius: var(--radius-sm, 0.375rem);
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    font-size: var(--text-sm);
    color: var(--color-neutral-600, #4b5563);
    transition: all 0.2s;
}

.grade-employee-list-close:hover {
    background: var(--color-neutral-100, #f3f4f6);
    color: var(--color-neutral-700, #374151);
    border-color: var(--color-neutral-400, #9ca3af);
}

.grade-employee-list-close svg {
    width: 14px;
    height: 14px;
}

.grade-employee-list-content {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--color-neutral-200, #e5e7eb);
    border-radius: var(--radius-sm, 0.375rem);
}

.grade-employee-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
    background: var(--white, #ffffff);
}

.grade-employee-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.grade-employee-table th {
    background: var(--color-neutral-100, #f3f4f6);
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: var(--font-semibold);
    color: var(--color-neutral-700, #374151);
    border-bottom: 1px solid var(--color-neutral-200, #e5e7eb);
    white-space: nowrap;
}

.grade-employee-table th:last-child,
.grade-employee-table td:last-child {
    text-align: right;
}

.grade-employee-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-neutral-100, #f3f4f6);
    color: var(--color-neutral-700, #374151);
}

.grade-employee-table tbody tr:hover {
    background: var(--color-neutral-50, #f9fafb);
}

/* Employee highlight rows */
.employee-below-p25 {
    background: var(--color-accent-50, #fdf2f8) !important;
    border-left: 3px solid var(--color-accent-500, #ec4899);
}

.employee-below-p25:hover {
    background: var(--color-accent-100, #fce7f3) !important;
}

.employee-above-p75 {
    background: var(--color-primary-50, #eef2ff) !important;
    border-left: 3px solid var(--color-primary-500, #6366f1);
}

.employee-above-p75:hover {
    background: var(--color-primary-100, #e0e7ff) !important;
}

/* Compa ratio styling */
.compa-ratio-low {
    color: var(--color-accent-600, #db2777);
    font-weight: var(--font-semibold);
}

.compa-ratio-high {
    color: var(--color-primary-600, #4f46e5);
    font-weight: var(--font-semibold);
}

.compa-ratio-normal {
    color: var(--color-neutral-600, #4b5563);
}

/* Cost columns */
.cost-value {
    font-weight: var(--font-medium);
    color: var(--color-neutral-700, #374151);
}

.cost-value.cost-negative {
    color: var(--color-success-600, #059669);
}

.cost-na {
    color: var(--color-neutral-400, #9ca3af);
    font-style: italic;
}

/* Employee list summary */
.grade-employee-list-summary {
    margin-top: 1rem;
}

.grade-employee-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--color-neutral-100, #f3f4f6);
    border: 1px solid var(--color-neutral-200, #e5e7eb);
    border-radius: var(--radius-sm, 0.375rem);
    font-size: var(--text-body);
}

.summary-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm, 0.375rem);
    font-weight: var(--font-medium);
}

.summary-below-p25 {
    background: var(--color-accent-100, #fce7f3);
    color: var(--color-accent-700, #be185d);
    border: 1px solid var(--color-accent-300, #f9a8d4);
}

.summary-above-p75 {
    background: var(--color-primary-100, #e0e7ff);
    color: var(--color-primary-700, #4338ca);
    border: 1px solid var(--color-primary-300, #a5b4fc);
}

.summary-cost-p50 {
    background: var(--color-warning-100, #fef3c7);
    color: var(--color-warning-700, #b45309);
    border: 1px solid var(--color-warning-300, #fcd34d);
}

.summary-all-good {
    background: var(--color-success-100, #dcfce7);
    color: var(--color-success-700, #15803d);
    border: 1px solid var(--color-success-300, #86efac);
}

/* ============================================ */
/* Salary Range Spread Card                     */
/* ============================================ */

.salary-range-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--card-accent);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1.5rem;
}

/* Rewards card collapsible */
.rewards-collapsible-header {
    cursor: pointer;
    user-select: none;
}

.rewards-collapsible-header h4 {
    color: #64748b;
}

.rewards-collapsible-header h4 svg {
    stroke: #64748b;
    color: #64748b;
}

.rewards-collapse-icon {
    display: inline-flex;
    align-items: center;
    transition: transform 0.25s ease;
}

.rewards-collapsible-header.collapsed .rewards-collapse-icon {
    transform: rotate(-90deg);
}

.rewards-collapsible-header.collapsed {
    border-bottom: none !important;
}

.rewards-card-collapsible {
    max-height: 5000px;
    overflow: visible;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 1;
}

.rewards-card-collapsible.collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

.salary-range-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s ease;
}

.salary-range-header:hover {
    background: linear-gradient(90deg, var(--gray-50) 0%, transparent 100%);
}

.salary-range-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.salary-range-header h4 svg {
    color: var(--gray-600);
}

.salary-range-legend {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: var(--text-xs);
    color: #57534e;
    font-weight: var(--font-medium);
}

.legend-marker {
    display: inline-block;
    width: 14px;
    height: 4px;
    border-radius: 2px;
}

.legend-min-max {
    background: #94a3b8;
    height: 2px;
}

.legend-p25-p75 {
    background: linear-gradient(90deg, var(--brand-indigo-400), var(--brand-indigo-500));
    height: 10px;
    border-radius: 4px;
}

.legend-median {
    background: #000000;
    width: 3px;
    height: 14px;
    border-radius: 1px;
}

/* Column headers for salary range card */
.salary-range-col-headers {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--brand-pink-50);
    border-bottom: 1px solid #e9d5ff;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.salary-range-col-label {
    width: 240px;
    flex-shrink: 0;
}

.salary-range-col-chart {
    flex: 1;
    text-align: center;
}

.salary-range-col-compa {
    width: 100px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    position: relative;
    flex-shrink: 0;
}

/* Compa ratio value column */
.salary-range-compa-col {
    width: 100px;
    text-align: center;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    flex-shrink: 0;
}

.salary-range-compa-col.compa-normal {
    color: var(--gray-700);
}

.salary-range-compa-col.compa-high {
    color: var(--brand-amber-700);
}

.salary-range-compa-col.compa-low {
    color: var(--primary);
}

/* Cost columns */
.salary-range-col-cost {
    width: 100px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    position: relative;
    flex-shrink: 0;
}

.col-cost-label {
    line-height: 1.3;
}

.salary-range-cost-col {
    width: 100px;
    text-align: center;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-400);
    flex-shrink: 0;
}

.salary-range-cost-col.has-cost {
    color: var(--danger);
}

.salary-range-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Hotel total row */
.salary-range-hotel-total {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-indigo-100) 100%);
    border: 2px solid #a78bfa;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.salary-range-hotel-name {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--primary);
}

/* Division level */
.salary-range-division {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.salary-range-division.expanded {
    border-color: var(--brand-indigo-300);
}

.salary-range-division-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    cursor: pointer;
    transition: background 0.15s;
}

.salary-range-division-header:hover {
    background: var(--brand-pink-50);
}

.salary-range-division.expanded .salary-range-division-header {
    background: var(--brand-pink-50);
    border-bottom: 1px solid #ede9fe;
}

.salary-range-division-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 240px;
    flex-shrink: 0;
}

.salary-range-expand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--gray-400);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.salary-range-expand-icon.sub {
    width: 16px;
    height: 16px;
}

.salary-range-insufficient-data {
    display: block;
    text-align: right;
    font-size: var(--text-xs);
    color: var(--brand-amber-600);
    font-style: italic;
    padding: 1px 1rem 2px 0;
    line-height: 1.2;
    background: var(--gray-50);
    border-top: 1px dashed rgba(217, 119, 6, 0.2);
}

.salary-range-division.expanded > .salary-range-division-header .salary-range-expand-icon,
.salary-range-department.expanded > .salary-range-dept-header .salary-range-expand-icon {
    transform: rotate(90deg);
    color: var(--brand-pink-600);
}

.salary-range-division-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.salary-range-dept-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.salary-range-grade-name {
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.salary-range-single-salary {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.salary-range-count {
    font-size: var(--text-xs);
    color: var(--primary);
    background: var(--brand-indigo-50);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Chart area */
.salary-range-chart-area {
    flex: 1;
    min-width: 0;
}

.range-bar-wrapper {
    position: relative;
    padding: 28px 25px 18px;
}

.range-bar-values {
    position: relative;
    height: 24px;
    margin-bottom: 6px;
}

.range-val {
    position: absolute;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    transform: translateX(-50%);
    white-space: nowrap;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    outline: none;
    padding: 0;
    top: 0;
}

.range-val.range-p25,
.range-val.range-p75 {
    top: -2px;
}

.range-val.range-median {
    top: 10px;
}

.range-val.range-min,
.range-val.range-max {
    top: 10px;
}

.range-val.range-min {
    left: 0;
    color: var(--gray-500);
}

.range-val.range-max {
    left: 100%;
    color: var(--gray-500);
}

.range-val.range-p25 {
    color: var(--gray-700);
    font-weight: var(--font-medium);
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.range-val.range-median {
    color: #000000;
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
}

.range-val.range-p75 {
    color: var(--gray-700);
    font-weight: var(--font-medium);
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Track */
.range-bar-track {
    position: relative;
    height: 14px;
    margin: 0;
}

.range-bar-whisker {
    position: absolute;
    top: 50%;
    height: 2px;
    background: #94a3b8;
    transform: translateY(-50%);
}

.range-bar-box {
    position: absolute;
    top: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--brand-indigo-400) 0%, var(--brand-indigo-500) 50%, var(--primary) 100%);
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.35);
}

.range-bar-median-line {
    position: absolute;
    top: -4px;
    width: 3px;
    height: 22px;
    background: #000000;
    border-radius: 2px;
    transform: translateX(-50%);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.range-bar-endpoint {
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    background: white;
    border: 2px solid var(--gray-500);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Labels */
.range-bar-labels {
    position: relative;
    height: 14px;
    margin-top: 4px;
}

.range-label {
    position: absolute;
    font-size: var(--text-xs);
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transform: translateX(-50%);
}

.range-label:first-child {
    left: 0;
}

.range-label-right {
    left: 100% !important;
}

.range-label-median {
    color: #000000;
    font-weight: var(--font-semibold);
}

.range-bar-spread {
    text-align: center;
    font-size: var(--text-xs);
    color: var(--brand-indigo-500);
    font-weight: var(--font-semibold);
    margin-top: 2px;
    letter-spacing: 0.2px;
}

/* Grade-theme amber overrides */
.grade-theme .salary-range-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-200);
}

.grade-theme .salary-range-header h4 {
    color: #64748b;
}

.grade-theme .salary-range-header h4 svg {
    color: #64748b;
}

.grade-theme .salary-range-hotel-total {
    background: linear-gradient(135deg, var(--brand-green-100) 0%, var(--brand-green-200) 100%);
    border: 2px solid #2dd4bf;
}

.grade-theme .salary-range-hotel-name {
    color: #115e59;
}

.grade-theme .range-bar-box {
    background: linear-gradient(135deg, var(--brand-green-300) 0%, var(--brand-green-500) 50%, var(--brand-green-600) 100%);
    box-shadow: 0 1px 4px rgba(20, 184, 166, 0.35);
}

.grade-theme .range-bar-spread {
    color: #0d9488;
}

.grade-theme .legend-p25-p75 {
    background: linear-gradient(90deg, var(--brand-green-300), var(--brand-green-500));
}

/* Department level */
.salary-range-departments {
    background: white;
    padding: 0.5rem 0.5rem 0.5rem 0.5rem;
}

.salary-range-departments.hidden {
    display: none;
}

.salary-range-department {
    border: 1px solid var(--gray-100);
    border-radius: var(--radius);
    margin-bottom: 0.35rem;
    overflow: hidden;
}

.salary-range-department.expanded {
    border-color: var(--brand-indigo-200);
}

.salary-range-dept-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
}

.salary-range-dept-header:hover {
    background: var(--brand-pink-50);
}

.salary-range-department.expanded .salary-range-dept-header {
    background: var(--brand-pink-50);
    border-bottom: 1px solid #ede9fe;
}

.salary-range-dept-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 240px;
    flex-shrink: 0;
}

/* Grade level */
.salary-range-grades {
    background: #fafaf9;
    padding: 0.35rem 0.5rem 0.35rem 0.5rem;
}

.salary-range-grades.hidden {
    display: none;
}

.salary-range-grade {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.salary-range-grade:last-child {
    border-bottom: none;
}

.salary-range-grade:hover {
    background: white;
    border-radius: var(--radius);
}

.salary-range-grade-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 240px;
    flex-shrink: 0;
}

/* Grade wrapper for expandable employees */
.salary-range-grade-wrapper {
    border-bottom: 1px solid var(--gray-100);
}

.salary-range-grade-wrapper:last-child {
    border-bottom: none;
}

.salary-range-grade-wrapper.expanded > .salary-range-grade .salary-range-expand-icon {
    transform: rotate(90deg);
    color: var(--brand-pink-600);
}

/* Employee detail section */
.salary-range-employees {
    background: #fafaf9;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--gray-100);
}

.salary-range-employees.hidden {
    display: none;
}

.salary-emp-section {
    margin-bottom: 0.75rem;
}

.salary-emp-section:last-child {
    margin-bottom: 0;
}

.salary-emp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    margin-bottom: 0.4rem;
}

.salary-emp-section-header.below-p25 {
    background: var(--danger-lighter);
    color: var(--brand-red-800);
    border: 1px solid var(--brand-red-200);
}

.salary-emp-section-header.above-p75 {
    background: var(--success-lighter);
    color: var(--brand-green-800);
    border: 1px solid var(--brand-green-200);
}

.salary-emp-section-count {
    font-weight: var(--font-medium);
    opacity: 0.7;
}

.salary-emp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    table-layout: fixed;
}

.salary-emp-table col.col-employee { width: 22%; }
.salary-emp-table col.col-position { width: 22%; }
.salary-emp-table col.col-tenure { width: 8%; }
.salary-emp-table col.col-salary { width: 12%; }
.salary-emp-table col.col-compa { width: 12%; }
.salary-emp-table col.col-cost-p25 { width: 12%; }
.salary-emp-table col.col-cost-p50 { width: 12%; }

.salary-emp-table thead th {
    text-align: left;
    padding: 0.35rem 0.5rem;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--gray-200);
}

.salary-emp-table tbody tr {
    border-bottom: 1px solid var(--gray-100);
}

.salary-emp-table tbody tr:last-child {
    border-bottom: none;
}

.salary-emp-table tbody tr:hover {
    background: white;
}

.salary-emp-table td {
    padding: 0.4rem 0.5rem;
    color: var(--gray-700);
}

.salary-emp-table .emp-name {
    font-weight: var(--font-semibold);
    display: block;
}

.salary-emp-table .emp-id {
    font-size: var(--text-xs);
    color: var(--gray-400);
}

.salary-emp-table .cost-cell {
    color: var(--danger);
    font-weight: var(--font-semibold);
}

.salary-emp-table .tenure-cell {
    font-size: var(--text-sm);
    color: var(--gray-500);
    white-space: nowrap;
}

.salary-emp-table .compa-cell {
    font-weight: var(--font-semibold);
}

.salary-emp-table .compa-cell.compa-low {
    color: var(--primary);
}

.salary-emp-table .compa-cell.compa-high {
    color: var(--brand-amber-700);
}

@media (max-width: 768px) {
    .salary-range-division-info,
    .salary-range-dept-info,
    .salary-range-grade-info {
        width: 140px;
    }

    .salary-range-legend {
        display: none;
    }

    .range-bar-labels {
        display: none;
    }
}

/* Column headers for headcount card */
.headcount-column-headers {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--brand-amber-50);
    border-bottom: 1px solid var(--brand-amber-200);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--brand-amber-800);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    border-radius: var(--radius);
}

.header-division {
    flex: 1;
    padding-left: 2rem;
}

.header-headcount,
.header-hc-pct,
.header-salary-pct {
    width: 200px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    position: relative;
}

/* Header tooltip wrapper — icon styling only.
   The inner tooltip uses canonical .tooltip.tooltip-lg per docs/ui-elements.md → Tooltips. */
.header-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    color: var(--brand-indigo-500);
}
.header-tooltip svg {
    opacity: 0.6;
    transition: opacity 0.2s;
}
.header-tooltip:hover svg {
    opacity: 1;
}

/* Salary percentage for divisions */
.division-salary-percentage {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--brand-green-600);
    width: 200px;
    text-align: center;
    background: var(--brand-green-50);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Salary percentage for departments */
.department-salary-percentage {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--brand-green-600);
    width: 200px;
    text-align: center;
    background: var(--brand-green-50);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .headcount-column-headers {
        font-size: var(--text-xs);
    }

    .header-headcount,
    .header-hc-pct,
    .header-salary-pct,
    .division-count,
    .division-percentage,
    .division-salary-percentage,
    .department-count,
    .department-percentage,
    .department-salary-percentage {
        width: 60px;
        font-size: var(--text-xs);
    }

    .division-stats,
    .department-stats {
        gap: 0.5rem;
    }
}

/* ============================================
   Benchmark Headcount Distribution Card
   ============================================ */

.bm-headcount-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1rem;
}

.bm-headcount-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bm-headcount-header h4 {
    margin: 0;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bm-headcount-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.bm-badge-primary {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
}

.bm-badge-bench {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: rgba(107, 114, 128, 0.08);
    color: var(--gray-600);
}

/* ============================================
   Benchmark Percentile Bullet Charts
   ============================================ */

.bm-ptile-body {
    padding: 0.75rem 1rem 1rem;
}

/* Overview Chart Section */
.bm-overview-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.bm-overview-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.bm-overview-header h5 {
    margin: 0;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-800);
}

.bm-overview-subtitle {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.bm-division-detail-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.bm-division-detail-header h5 {
    margin: 0;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-800);
}

.bm-overview-chart-container {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 0.5rem;
    overflow: hidden;
}

.bm-overview-chart-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.5rem;
}

.bm-overview-svg {
    display: block;
    min-width: 600px;
    height: 280px;
    width: 100%;
}

/* ============================================
   Division Overview Card
   ============================================ */

.bm-division-overview-card .bm-division-overview-content {
    padding: 1rem;
}

.bm-overview-toggle-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.bm-overview-toggle-btn {
    padding: 0.5rem 1rem;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: #fff;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.15s ease;
}

.bm-overview-toggle-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.bm-overview-toggle-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.bm-overview-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: var(--gray-50);
    border-radius: 8px;
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.bm-overview-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.bm-overview-legend-swatch {
    width: 16px;
    height: 10px;
    display: inline-block;
    border-radius: 2px;
}

.bm-overview-legend-line {
    width: 2px;
    height: 14px;
    display: inline-block;
    background: var(--gray-800);
}

.bm-overview-legend-marker {
    width: 4px;
    height: 16px;
    display: inline-block;
    background: var(--primary);
    border-radius: 2px;
}

.bm-division-overview-card .bm-overview-chart-container {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.5rem;
}

/* Bullet Chart List */
.bm-overview-bullet-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bm-overview-bullet-row {
    display: grid;
    grid-template-columns: 120px 1fr 100px;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.bm-overview-bullet-row:hover {
    background: var(--gray-50);
}

.bm-overview-bullet-label {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-overview-bullet-chart {
    position: relative;
    height: 32px;
}

.bm-overview-bullet-track {
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
    height: 16px;
    background: var(--gray-100);
    border-radius: 3px;
    overflow: visible;
}

.bm-overview-range {
    position: absolute;
    top: 0;
    height: 100%;
}

.bm-overview-range-q1 {
    background: var(--danger-light);
    border-radius: 3px 0 0 3px;
}

.bm-overview-range-q2 {
    background: var(--warning-light);
}

.bm-overview-range-q3 {
    background: var(--brand-green-100);
}

.bm-overview-range-q4 {
    background: var(--brand-green-200);
    border-radius: 0 3px 3px 0;
}

.bm-overview-p50-line {
    position: absolute;
    top: -2px;
    width: 2px;
    height: 20px;
    background: var(--gray-800);
    transform: translateX(-50%);
    z-index: 2;
}

.bm-overview-marker {
    position: absolute;
    top: -4px;
    width: 4px;
    height: 24px;
    background: var(--primary);
    border-radius: 2px;
    transform: translateX(-50%);
    z-index: 3;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.bm-overview-marker.bm-band-q1 {
    background: var(--danger);
}

.bm-overview-marker.bm-band-q2 {
    background: #f97316;
}

.bm-overview-marker.bm-band-q3 {
    background: var(--success);
}

.bm-overview-marker.bm-band-q4 {
    background: var(--brand-green-700);
}

.bm-overview-bullet-labels {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 12px;
}

.bm-overview-val-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: var(--text-xs);
    color: var(--gray-500);
    white-space: nowrap;
}

.bm-overview-val-label.bm-overview-val-p50 {
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.bm-overview-bullet-result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.bm-overview-your-val {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

/* Legend color swatches */
.bm-overview-legend-swatch.bm-overview-range-q1 {
    background: var(--danger-light);
    border: 1px solid var(--brand-red-200);
}

.bm-overview-legend-swatch.bm-overview-range-q2 {
    background: var(--warning-light);
    border: 1px solid var(--brand-amber-200);
}

.bm-overview-legend-swatch.bm-overview-range-q3 {
    background: var(--brand-green-100);
    border: 1px solid var(--brand-green-200);
}

.bm-overview-legend-swatch.bm-overview-range-q4 {
    background: var(--brand-green-200);
    border: 1px solid #86efac;
}

/* ============================================
   Benchmark Span of Control Card
   ============================================ */

.bm-span-control-card .bm-span-control-content {
    padding: 1rem;
}

/* Manager Density Benchmark Section */
.bm-density-section {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-indigo-100) 100%);
    border: 1px solid var(--brand-indigo-300);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.bm-density-section .bm-span-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--brand-indigo-700);
}

.bm-density-section .bm-span-section-title svg {
    stroke: #0369a1;
}

.bm-density-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
    .bm-density-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.bm-density-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0f2fe;
}

.bm-density-metric.bm-density-primary {
    border: 1px solid #0284c7;
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-indigo-100) 100%);
}

.bm-density-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    line-height: 1.2;
}

.bm-density-primary .bm-density-value {
    color: var(--brand-indigo-700);
}

.bm-density-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.bm-density-range {
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-top: 0.2rem;
}

.bm-density-status {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-top: 0.3rem;
}

.bm-density-status.bm-density-lean {
    background: var(--primary-light);
    color: var(--brand-indigo-800);
}

.bm-density-status.bm-density-optimal {
    background: var(--success-light);
    color: var(--brand-green-800);
}

.bm-density-status.bm-density-heavy {
    background: var(--danger-light);
    color: var(--brand-red-800);
}

/* Cost Savings Section */
.bm-density-savings {
    background: white;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
}

.bm-density-savings.bm-density-lean-note {
    border-color: var(--brand-green-500);
}

.bm-density-savings-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--brand-amber-700);
    margin-bottom: 0.5rem;
}

.bm-density-savings-header svg {
    stroke: #b45309;
}

.bm-density-lean-note .bm-density-savings-header {
    color: var(--brand-green-800);
}

.bm-density-lean-note .bm-density-savings-header svg {
    stroke: #166534;
}

.bm-density-savings-content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

@media (max-width: 600px) {
    .bm-density-savings-content {
        flex-direction: column;
        gap: 0.75rem;
    }
}

.bm-density-savings-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    padding: 0.5rem 1rem;
    background: var(--warning-light);
    border-radius: 6px;
}

.bm-density-savings-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--brand-amber-700);
    line-height: 1.2;
}

.bm-density-savings-label {
    font-size: var(--text-xs);
    color: var(--brand-amber-800);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.bm-density-savings-detail {
    flex: 1;
}

.bm-density-savings-detail p {
    margin: 0 0 0.35rem 0;
    font-size: var(--text-sm);
    color: var(--gray-600);
    line-height: 1.4;
}

.bm-density-savings-detail p:last-child {
    margin-bottom: 0;
}

.bm-density-lean-note .bm-density-savings-content p {
    color: var(--brand-green-800);
}

/* Cost Increase (below market median) */
.bm-density-savings.bm-density-cost-increase {
    border-color: var(--brand-red-400);
    background: var(--danger-lighter);
}

.bm-density-cost-increase .bm-density-savings-header {
    color: var(--brand-red-700);
}

.bm-density-cost-increase .bm-density-savings-header svg {
    stroke: var(--brand-red-700);
}

.bm-density-cost-stat {
    background: var(--danger-light);
}

.bm-density-cost-increase .bm-density-savings-value {
    color: var(--brand-red-700);
}

.bm-density-cost-increase .bm-density-savings-label {
    color: var(--brand-red-800);
}

.bm-density-lean-note-text {
    font-style: italic;
    color: var(--gray-500) !important;
    margin-top: 0.25rem;
}

.bm-span-overall-section {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.bm-span-overall-header {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 700px) {
    .bm-span-overall-header {
        grid-template-columns: 1fr;
    }
}

.bm-span-overall-stat {
    text-align: center;
}

.bm-span-stat-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.bm-span-stat-value {
    display: block;
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    line-height: 1.2;
}

.bm-span-stat-detail {
    display: block;
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.bm-rank-badge-lg {
    font-size: var(--text-lg) !important;
    padding: 0.3rem 0.75rem !important;
}

.bm-span-overall-chart {
    position: relative;
    max-width: 500px;
    margin: 0.5rem auto 0;
}

/* New SVG-based span benchmark chart */
.bm-span-svg-chart {
    width: 100%;
}

.bm-span-svg-chart svg {
    width: 100%;
    height: auto;
    display: block;
}

.bm-span-svg-scale {
    display: none; /* Hide scale - values shown on chart */
}

.bm-span-divisions-section {
    margin-top: 1rem;
}

.bm-span-section-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.bm-span-divisions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Legend for span of control diagrams */
.bm-span-legend {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-radius: 6px;
    flex-wrap: wrap;
}

.bm-span-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.bm-span-legend-swatch {
    width: 16px;
    height: 12px;
    border-radius: 2px;
}

.bm-span-legend-target {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.5);
}

.bm-span-legend-market {
    background: rgba(59, 130, 246, 0.15);
    border: 1px dashed rgba(59, 130, 246, 0.5);
}

.bm-span-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-indigo-500);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--gray-200);
}

.bm-span-legend-diamond {
    width: 8px;
    height: 8px;
    background: var(--gray-500);
    transform: rotate(45deg);
}

/* Column headers for division grid */
.bm-span-division-headers {
    display: grid;
    grid-template-columns: 140px 1fr 50px 60px;
    gap: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--gray-200);
}

.bm-span-division-headers span {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.bm-span-header-val,
.bm-span-header-rank {
    text-align: center;
}

.bm-span-division-row {
    display: grid;
    grid-template-columns: 140px 1fr 50px 60px;
    gap: 0.75rem;
    align-items: center;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    transition: background 0.15s ease;
    border: 1px solid var(--gray-100);
    margin-bottom: 0.25rem;
}

.bm-span-division-row:hover {
    background: var(--gray-50);
}

.bm-span-division-label {
    display: flex;
    flex-direction: column;
}

.bm-span-division-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    line-height: 1.2;
}

.bm-span-division-meta {
    font-size: var(--text-xs);
    color: var(--gray-400);
}

.bm-span-division-chart {
    position: relative;
}

.bm-span-division-chart .bm-span-svg-chart svg {
    height: 45px;
}

.bm-span-division-chart .bm-division-variance-svg {
    width: 100%;
    height: 60px;
}

.bm-span-your-val {
    text-align: right;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.bm-span-badge-col {
    text-align: left;
}

.bm-span-interpretation {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: var(--primary-lighter);
    border: 1px solid var(--brand-indigo-200);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    font-size: var(--text-body);
    color: var(--brand-indigo-800);
    line-height: 1.5;
}

.bm-span-interpretation svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--brand-indigo-500);
}

.bm-span-interpretation strong {
    color: var(--brand-indigo-800);
}

/* ============================================
   Department Comparison Card
   ============================================ */

.bm-dept-comparison-card .bm-dept-comparison-content {
    padding: 1rem;
}

.dept-comp-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1rem;
    min-height: 350px;
}

@media (max-width: 800px) {
    .dept-comp-layout {
        grid-template-columns: 1fr;
    }
}

.dept-comp-sidebar {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.dept-comp-sidebar-header {
    padding: 0.6rem 0.75rem;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
}

.dept-comp-dept-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem;
}

.dept-comp-item {
    padding: 0.5rem 0.75rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.dept-comp-item:hover {
    background: var(--gray-100);
    color: var(--gray-800);
    border-left-color: var(--gray-300);
}

.dept-comp-item.selected {
    background: var(--primary);
    color: #fff;
    border-left-color: var(--primary-hover);
}

.dept-comp-chart-area {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
    min-height: 300px;
}

.dept-comp-no-selection {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: var(--gray-400);
    font-size: var(--text-body);
    text-align: center;
    padding: 2rem;
}

.dept-comp-general-market-notice {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-indigo-50) 100%);
    border: 1px solid var(--brand-indigo-200);
    border-radius: 8px;
    color: var(--brand-indigo-800);
    margin: 1rem;
}

.dept-comp-general-market-notice svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
    color: var(--brand-indigo-500);
}

.dept-comp-general-market-notice strong {
    display: block;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    margin-bottom: 0.4rem;
    color: var(--brand-indigo-800);
}

.dept-comp-general-market-notice p {
    margin: 0;
    font-size: var(--text-body);
    line-height: 1.5;
    color: var(--brand-indigo-500);
}

.dept-comp-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.dept-comp-chart-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.dept-comp-chart-metric {
    font-size: var(--text-sm);
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Division Comparison - Triple Chart Layout */
.dept-comp-charts-grid {
    padding: 0.5rem;
}

.dept-comp-chart-title-row {
    text-align: center;
    margin-bottom: 0.75rem;
}

.dept-comp-division-name {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}

.dept-comp-triple {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.dept-comp-mini-chart {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 0.5rem;
}

.dept-comp-mini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.dept-comp-mini-title {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dept-comp-mini-rank {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--primary);
    background: var(--primary-lighter);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

/* Division Comparison List */
.div-comp-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0;
}

.div-comp-row {
    display: flex;
    align-items: center;
    padding: 0;
    border-radius: 4px;
}

.div-comp-your-row {
    /* No border - just highlight bar */
}

.div-comp-bar {
    width: 100%;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.5rem;
    min-width: 40px;
    transition: width 0.3s ease;
}

.div-comp-your-bar {
    background: linear-gradient(90deg, var(--brand-indigo-500), var(--brand-indigo-700));
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.div-comp-bench-bar {
    background: linear-gradient(90deg, var(--gray-200), var(--gray-300));
}

.div-comp-bar-label {
    font-size: var(--text-xs);
    white-space: nowrap;
    font-weight: var(--font-medium);
    text-align: center;
    flex: 1;
}

.div-comp-your-bar .div-comp-bar-label {
    color: #ffffff;
    font-weight: var(--font-semibold);
}

.div-comp-bench-bar .div-comp-bar-label {
    color: var(--gray-500);
}

.div-comp-bar-value {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    white-space: nowrap;
}

.div-comp-your-bar .div-comp-bar-value {
    color: #ffffff;
}

.div-comp-bench-bar .div-comp-bar-value {
    color: var(--gray-600);
}

/* Legacy styles kept for compatibility */
.div-comp-your-value {
    color: var(--primary-hover);
    font-weight: var(--font-bold);
}

.dept-comp-rank-info {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--primary);
    background: var(--primary-lighter);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-left: auto;
}

/* Division Comparison Interpretations */
.dept-comp-interpretations {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.dept-comp-interp-card {
    background: var(--gray-50);
    border-radius: 6px;
    padding: 0.75rem;
    font-size: var(--text-sm);
}

.dept-comp-interp-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.dept-comp-interp-metric {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: #fff;
    background: var(--gray-500);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
}

.dept-comp-interp-title {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
}

.dept-comp-interp-text {
    color: var(--gray-700);
    line-height: 1.5;
    margin: 0 0 0.5rem 0;
}

.dept-comp-interp-action {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.5rem;
    background: var(--brand-indigo-100);
    border-radius: 4px;
    color: var(--brand-indigo-700);
    font-size: var(--text-xs);
    line-height: 1.4;
}

.dept-comp-interp-action svg {
    flex-shrink: 0;
    stroke: var(--brand-indigo-600);
    margin-top: 1px;
}

/* Legend */
.bullet-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.5rem 0 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 0.75rem;
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.bullet-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.bullet-legend-swatch {
    width: 16px;
    height: 10px;
    border-radius: 2px;
    display: inline-block;
}

.bullet-legend-marker {
    width: 2px;
    height: 14px;
    background: var(--gray-800);
    display: inline-block;
}

.bullet-legend-hotel {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

/* Division list */
.bullet-division-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.bullet-division-item {
    border-bottom: 1px solid var(--gray-100);
    padding: 0.6rem 0;
}

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

.bullet-division-header {
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bullet-division-body {
    padding-top: 0.5rem;
}

.bullet-division-body.hidden {
    display: none;
}

.bullet-dept-toggle {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--primary);
    cursor: pointer;
    padding: 0.4rem 0 0.1rem;
    user-select: none;
}
.bullet-dept-toggle:hover {
    text-decoration: underline;
}
.bullet-dept-toggle-icon {
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease;
}
.bullet-dept-toggle-icon.expanded {
    transform: rotate(90deg);
}

.bullet-div-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.bullet-div-expand-icon {
    display: inline-flex;
    align-items: center;
    color: var(--gray-400);
    transition: transform 0.2s ease;
}

.bullet-div-expand-icon.expanded {
    transform: rotate(90deg);
}

.bullet-div-name {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.bullet-div-dept-count {
    font-size: var(--text-xs);
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

/* Bullet row: label | chart | position | hotel value */
.bullet-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-left: 1.6rem;
}

.bullet-row {
    display: grid;
    grid-template-columns: 42px 1fr 20px 50px 75px 55px;
    align-items: center;
    gap: 0.4rem;
    min-height: 28px;
    margin-bottom: 0.7rem;
}

.bullet-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* The chart track */
.bullet-chart {
    position: relative;
    height: 20px;
    background: var(--gray-100);
    border-radius: 3px;
    overflow: visible;
    margin-bottom: 14px;
}

/* Quartile range bands */
.bullet-range {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 0;
}

.bullet-range:first-child {
    border-radius: 3px 0 0 3px;
}

.bullet-range:nth-child(4) {
    border-radius: 0 3px 3px 0;
}

.bullet-range-q1 { background: rgba(220, 38, 38, 0.15); }
.bullet-range-q2 { background: rgba(245, 158, 11, 0.15); }
.bullet-range-q3 { background: rgba(34, 197, 94, 0.15); }
.bullet-range-q4 { background: rgba(37, 99, 235, 0.12); }

/* P50 median line */
.bullet-p50-line {
    position: absolute;
    top: -2px;
    width: 2px;
    height: calc(100% + 4px);
    background: var(--gray-700);
    transform: translateX(-1px);
    z-index: 2;
}

/* Hotel marker - round dot centered in row */
.bullet-hotel-marker {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}

.bullet-hotel-marker.bm-band-q1 { background: var(--danger); box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3); }
.bullet-hotel-marker.bm-band-q2 { background: var(--brand-amber-600); box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.3); }
.bullet-hotel-marker.bm-band-q3 { background: var(--success); box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.3); }
.bullet-hotel-marker.bm-band-q4 { background: var(--primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3); }

/* Min/Max labels on chart */
.bullet-min-label,
.bullet-max-label {
    position: absolute;
    bottom: -14px;
    font-size: var(--text-xs);
    color: var(--gray-400);
    transform: translateX(-50%);
    white-space: nowrap;
}

/* Quartile labels inside bands */
.bullet-q-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: var(--text-2xs);
    font-weight: var(--font-bold);
    color: var(--gray-400);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    line-height: 1;
}

/* Boundary value labels (P25, P50, P75) below the chart */
.bullet-boundary-label {
    position: absolute;
    bottom: -14px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    transform: translateX(-50%);
    white-space: nowrap;
}
.bullet-boundary-label.bullet-boundary-p50 {
    font-weight: var(--font-bold);
    color: var(--gray-700);
}

/* Hide boundary labels on narrow department rows to avoid overlap */
.bullet-dept-item .bullet-q-label {
    font-size: var(--text-2xs);
}
.bullet-dept-item .bullet-boundary-label {
    font-size: var(--text-2xs);
}

/* Spacer between chart and labels */
.bullet-spacer {
    /* Empty spacer column */
}

.bm-rank-badge {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    text-align: center;
}

.bm-band-label {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.12rem 0.4rem;
    border-radius: 3px;
    white-space: nowrap;
    text-align: center;
}

/* Hotel value on right */
.bullet-hotel-val {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--primary);
    text-align: right;
}

/* Quartile color coding */
.bm-band-q1 {
    background: rgba(220, 38, 38, 0.1);
    color: var(--brand-red-700);
}

.bm-band-q2 {
    background: rgba(245, 158, 11, 0.1);
    color: var(--brand-amber-700);
}

.bm-band-q3 {
    background: rgba(34, 197, 94, 0.1);
    color: var(--brand-green-700);
}

.bm-band-q4 {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-hover);
}

/* Department breakdown */
.bullet-dept-breakdown {
    margin-top: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--gray-200);
    margin-left: 0.5rem;
}

.bullet-dept-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

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

.bullet-dept-name {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--gray-600);
    padding-bottom: 0.3rem;
    padding-left: 1.6rem;
}

.bullet-dept-item .bullet-chart {
    height: 16px;
}

.bullet-dept-item .bullet-hotel-marker {
    width: 10px;
    height: 10px;
}

.bullet-dept-item .bullet-p50-line {
    top: -1px;
    height: calc(100% + 2px);
}

.bullet-dept-item .bullet-row {
    min-height: 24px;
}

.bullet-dept-item .bullet-hotel-val {
    font-size: var(--text-xs);
}

.bullet-dept-item .bm-rank-badge {
    font-size: var(--text-xs);
    padding: 0.1rem 0.3rem;
    min-width: 28px;
}

.bullet-dept-item .bm-band-label {
    font-size: var(--text-2xs);
    padding: 0.1rem 0.3rem;
}

/* ---- Recommendation Button ---- */
.bm-rec-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--primary);
    background: transparent;
    border: 1.5px solid var(--primary);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    margin-left: auto;
}
.bm-rec-btn:hover {
    background: var(--primary);
    color: #fff;
}
.bm-rec-btn svg {
    flex-shrink: 0;
}

/* ---- Recommendation Modal Content ---- */
.rec-content {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.rec-header-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.rec-header-summary h4 {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}
.rec-hotel-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    padding: 0.2rem 0.5rem;
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
}
.rec-bench-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    padding: 0.2rem 0.5rem;
    background: var(--card-border);
    color: var(--text-secondary);
    border-radius: 4px;
}
.rec-summary {
    background: var(--gray-50, #f9fafb);
    border: 1px solid var(--card-border);
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: var(--text-body);
    line-height: 1.65;
    color: var(--text-primary);
}
.rec-summary p {
    margin: 0 0 0.4rem 0;
}
.rec-summary p:last-child {
    margin-bottom: 0;
}
.rec-section {
    border-top: 1px solid var(--card-border);
    padding-top: 0.8rem;
}
.rec-section-title {
    margin: 0 0 0.6rem 0;
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}
.rec-metric {
    margin-bottom: 0.8rem;
}
.rec-metric-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}
.rec-metric-label {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    min-width: 90px;
}
.rec-metric-value {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}
.rec-alert {
    font-size: var(--text-sm);
    line-height: 1.5;
    padding: 0.5rem 0.7rem;
    border-radius: 6px;
    border-left: 3px solid;
}
.rec-alert-q1 {
    background: #fff5f5;
    border-color: #e53e3e;
    color: #742a2a;
}
.rec-alert-q2 {
    background: var(--warning-lighter);
    border-color: var(--brand-amber-600);
    color: var(--brand-amber-900);
}
.rec-alert-q3 {
    background: var(--success-lighter);
    border-color: var(--success);
    color: #14532d;
}
.rec-alert-q4 {
    background: var(--primary-lighter);
    border-color: var(--primary);
    color: #1e3a5f;
}
.rec-dept {
    margin-bottom: 0.6rem;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--card-border);
}
.rec-dept-name {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: 0.3rem;
}
.rec-dept-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.rec-dept-metrics .rec-alert {
    font-size: var(--text-xs);
    padding: 0.35rem 0.5rem;
}
.rec-footnote {
    font-size: var(--text-xs);
    color: var(--text-muted);
    padding-top: 0.6rem;
    border-top: 1px solid var(--card-border);
    line-height: 1.5;
}

/* Top 5 Actions Recommendation Styles */
.bm-top-rec-btn {
    margin-left: 0.5rem;
}

.bm-top5-rec .rec-summary-stats {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 8px;
    justify-content: center;
}

.rec-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: white;
    border: 1px solid var(--gray-200);
    min-width: 80px;
}

.rec-stat-item.has-issues {
    border-color: var(--brand-amber-400);
    background: var(--warning-lighter);
}

.rec-stat-count {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-700);
}

.rec-stat-item.has-issues .rec-stat-count {
    color: var(--brand-amber-700);
}

.rec-stat-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rec-actions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rec-action-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    border-left: 4px solid var(--gray-300);
}

.rec-action-card.rec-action-understaffed {
    border-left-color: var(--danger);
    background: linear-gradient(90deg, var(--brand-red-50) 0%, white 20%);
}

.rec-action-card.rec-action-overstaffed {
    border-left-color: var(--warning);
    background: linear-gradient(90deg, var(--brand-amber-50) 0%, white 20%);
}

.rec-action-card.rec-action-high_salary_share {
    border-left-color: var(--brand-indigo-500);
    background: linear-gradient(90deg, var(--brand-indigo-50) 0%, white 20%);
}

.rec-action-priority {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 50%;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: var(--gray-600);
}

.rec-action-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rec-action-content {
    flex: 1;
    min-width: 0;
}

.rec-action-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.rec-action-desc {
    font-size: var(--text-sm);
    color: var(--gray-600);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.rec-action-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.rec-metric-item {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.rec-metric-item strong {
    color: var(--gray-700);
}

/* Responsive */
@media (max-width: 768px) {
    .bullet-row {
        grid-template-columns: 36px 1fr 12px 42px 62px 44px;
        gap: 0.3rem;
    }

    .bullet-label {
        font-size: var(--text-xs);
    }

    .bullet-chart {
        height: 16px;
    }

    .bm-rank-badge {
        font-size: var(--text-xs);
    }

    .bm-band-label {
        font-size: var(--text-2xs);
    }
}
/* ============================================
   Department-Level Benchmark (Rewards Tab)
   ============================================ */

/* Salary Mode Toggle */
.salary-mode-toggle-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-indigo-100) 100%);
    border: 1px solid var(--brand-indigo-200);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.salary-mode-label {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--brand-indigo-700);
}

.salary-mode-toggle {
    display: flex;
    background: white;
    border-radius: 6px;
    padding: 2px;
    border: 1px solid var(--brand-indigo-300);
}

.salary-mode-btn {
    padding: 0.4rem 0.85rem;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    border: none;
    background: transparent;
    color: var(--gray-500);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.salary-mode-btn:hover {
    color: var(--brand-indigo-600);
}

.salary-mode-btn.active {
    background: var(--brand-indigo-600);
    color: white;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.3);
}

.salary-mode-hint {
    font-size: var(--text-xs);
    color: var(--brand-indigo-700);
    font-style: italic;
}

/* Department Selector */
.dept-benchmark-selector {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.dept-benchmark-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.dept-benchmark-selector-header h4 {
    margin: 0;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dept-benchmark-selector-header h4 svg {
    color: var(--gray-400);
}

.dept-division-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dept-division-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 0.25rem;
}

/* Department Overview Panel */
.dept-overview-panel {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
}

.dept-overview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--primary-light) 100%);
    border-bottom: 1px solid var(--gray-200);
}

.dept-overview-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--brand-indigo-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dept-overview-header h4 svg {
    color: var(--brand-indigo-500);
}

.dept-overview-subtitle {
    font-size: var(--text-sm);
    color: var(--brand-indigo-500);
    margin: 0.25rem 0 0 0;
}

.dept-overview-body {
    padding: 1.25rem;
}

/* Key Metrics Row */
.dept-metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.dept-metric-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.dept-metric-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    line-height: 1.2;
}

.dept-metric-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dept-metric-comparison {
    font-size: var(--text-xs);
    margin-top: 0.35rem;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

.dept-metric-comparison.above {
    background: var(--brand-green-100);
    color: var(--brand-green-700);
}

.dept-metric-comparison.below {
    background: var(--danger-light);
    color: var(--brand-red-700);
}

.dept-metric-comparison.neutral {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* Grade Composition Chart */
.dept-composition-section {
    border-top: 1px solid var(--gray-100);
    padding-top: 1.25rem;
}

.dept-composition-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dept-grade-bars {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dept-grade-bar-row {
    display: grid;
    grid-template-columns: 140px 1fr 60px;
    align-items: center;
    gap: 0.75rem;
}

.dept-grade-bar-label {
    font-size: var(--text-sm);
    color: var(--gray-600);
    font-weight: var(--font-medium);
}

.dept-grade-bar-track {
    height: 18px;
    background: var(--gray-100);
    border-radius: 9px;
    overflow: hidden;
    position: relative;
}

.dept-grade-bar-fill {
    height: 100%;
    border-radius: 9px;
    transition: width 0.3s ease;
}

.dept-grade-bar-fill.entry { background: linear-gradient(90deg, var(--brand-red-200) 0%, var(--brand-red-400) 100%); }
.dept-grade-bar-fill.skilled { background: linear-gradient(90deg, var(--brand-amber-200) 0%, var(--brand-amber-400) 100%); }
.dept-grade-bar-fill.professional { background: linear-gradient(90deg, var(--brand-green-200) 0%, var(--brand-green-400) 100%); }
.dept-grade-bar-fill.managerial { background: linear-gradient(90deg, var(--brand-indigo-200) 0%, var(--brand-indigo-400) 100%); }
.dept-grade-bar-fill.senior { background: linear-gradient(90deg, var(--brand-indigo-200) 0%, var(--brand-indigo-400) 100%); }
.dept-grade-bar-fill.executive { background: linear-gradient(90deg, var(--brand-pink-200) 0%, var(--accent) 100%); }

.dept-grade-bar-value {
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-align: right;
}

/* Band Comparison Table */
.dept-band-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.dept-band-comparison-table th {
    padding: 0.5rem 0.6rem;
    text-align: left;
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-200);
}

.dept-band-comparison-table th.text-right,
.dept-band-comparison-table td.text-right {
    text-align: right;
}

.dept-band-comparison-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.dept-band-comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.dept-band-comparison-table tbody tr:hover {
    background: var(--gray-50);
}

/* Band color indicators */
.dept-band-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

.dept-band-indicator.entry { background: var(--brand-red-400); }
.dept-band-indicator.skilled { background: var(--brand-amber-400); }
.dept-band-indicator.professional { background: #34d399; }
.dept-band-indicator.managerial { background: #60a5fa; }
.dept-band-indicator.senior { background: var(--brand-pink-500); }
.dept-band-indicator.executive { background: var(--accent); }

/* Variance badges */
.dept-variance-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
}

.dept-variance-badge.neutral {
    background: var(--gray-100);
    color: var(--gray-500);
}

.dept-variance-badge.above {
    background: var(--warning-light);
    color: var(--brand-amber-700);
}

.dept-variance-badge.below {
    background: var(--primary-light);
    color: var(--primary-hover);
}

/* Unmapped warning */
.dept-unmapped-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--warning-light);
    border-radius: var(--radius);
    font-size: var(--text-xs);
    color: var(--brand-amber-800);
}

.dept-unmapped-warning svg {
    flex-shrink: 0;
    color: var(--warning);
}

/* Role Benchmark Table */
.dept-role-table-container {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.dept-role-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--brand-green-100) 100%);
    border-bottom: 1px solid var(--gray-200);
}

.dept-role-table-header h4 {
    margin: 0;
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--brand-green-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dept-role-table-header h4 svg {
    color: var(--brand-green-500);
}

.dept-role-table-subtitle {
    font-size: var(--text-sm);
    color: var(--brand-green-700);
    margin: 0.25rem 0 0 0;
}

/* View Toggle & Filters */
.dept-role-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dept-view-toggle {
    display: flex;
    background: var(--gray-100);
    border-radius: 6px;
    padding: 3px;
}

.dept-view-btn {
    padding: 0.35rem 0.75rem;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    border: none;
    background: transparent;
    color: var(--gray-600);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dept-view-btn:hover {
    color: var(--gray-800);
}

.dept-view-btn.active {
    background: white;
    color: var(--gray-800);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.dept-grade-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dept-grade-filter label {
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.dept-grade-filter select {
    padding: 0.3rem 0.6rem;
    font-size: var(--text-xs);
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    background: white;
}

/* Role Table */
.dept-role-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
}

.dept-role-table thead th {
    background: var(--gray-50);
    padding: 0.75rem 0.75rem;
    text-align: left;
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-200);
}

.dept-role-table thead th:nth-child(n+3) {
    text-align: right;
}

.dept-role-table tbody td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.dept-role-table tbody td:nth-child(n+3) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.dept-role-table tbody tr:hover {
    background: var(--success-lighter);
    cursor: pointer;
}

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

/* Role title cell */
.dept-role-title-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dept-role-title {
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.dept-role-count {
    font-size: var(--text-xs);
    color: var(--gray-400);
}

/* Visual Role Table Layout */
.dept-role-table-visual thead th:nth-child(n+3),
.dept-role-table-visual tbody td:nth-child(n+3) {
    text-align: center;
}

.dept-role-table-visual .role-range-header {
    text-align: center;
}

.dept-role-table-visual .role-range-cell {
    padding: 0.5rem 0.75rem;
    min-width: 280px;
}

/* Role Range Chart */
.role-range-chart {
    position: relative;
    width: 100%;
    height: 50px;
}

.role-range-track {
    position: absolute;
    top: 12px;
    left: 0;
    right: 0;
    height: 16px;
    background: var(--gray-100);
    border-radius: 8px;
}

.role-range-bar {
    position: absolute;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--brand-indigo-100) 0%, var(--brand-indigo-300) 50%, var(--brand-indigo-100) 100%);
    border-radius: 8px;
}

.role-range-p50-line {
    position: absolute;
    top: -2px;
    width: 2px;
    height: 20px;
    background: var(--primary-hover);
    border-radius: 1px;
    transform: translateX(-50%);
    z-index: 2;
}

.role-range-dot {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 3;
}

.role-range-dot.below-p25 { background: var(--danger); }
.role-range-dot.p25-p50 { background: var(--warning); }
.role-range-dot.p50-p75 { background: var(--brand-green-500); }
.role-range-dot.above-p75 { background: var(--brand-indigo-500); }
.role-range-dot.neutral { background: var(--gray-400); }

/* Range Labels */
.role-range-labels {
    position: absolute;
    top: 30px;
    left: 0;
    right: 0;
    height: 16px;
}

.role-range-label {
    position: absolute;
    font-size: var(--text-xs);
    color: var(--gray-500);
    white-space: nowrap;
}

.role-range-label.p25 {
    transform: translateX(-20%);
}

.role-range-label.p50 {
    transform: translateX(-50%);
    font-weight: var(--font-semibold);
    color: var(--primary-hover);
}

.role-range-label.p75 {
    transform: translateX(-80%);
}

/* Your Value Label */
.role-range-your-label {
    position: absolute;
    top: -2px;
    transform: translateX(-50%);
}

.role-range-your-value {
    display: inline-block;
    padding: 1px 6px;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    border-radius: 8px;
    white-space: nowrap;
}

.role-range-your-value.below-p25 {
    background: var(--danger-light);
    color: var(--brand-red-700);
}

.role-range-your-value.p25-p50 {
    background: var(--warning-light);
    color: var(--brand-amber-700);
}

.role-range-your-value.p50-p75 {
    background: var(--brand-green-100);
    color: var(--brand-green-700);
}

.role-range-your-value.above-p75 {
    background: var(--primary-light);
    color: var(--primary-hover);
}

.role-range-your-value.neutral {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Range legend */
.dept-range-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    background: var(--gray-50);
    border-radius: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.dept-range-legend-title {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dept-range-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.dept-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.dept-range-legend-item.below-p25 { color: var(--brand-red-700); }
.dept-range-legend-item.below-p25 .dept-legend-dot { background: var(--danger); }

.dept-range-legend-item.p25-p50 { color: var(--brand-amber-700); }
.dept-range-legend-item.p25-p50 .dept-legend-dot { background: var(--warning); }

.dept-range-legend-item.p50-p75 { color: var(--brand-green-700); }
.dept-range-legend-item.p50-p75 .dept-legend-dot { background: var(--brand-green-500); }

.dept-range-legend-item.above-p75 { color: var(--primary-hover); }
.dept-range-legend-item.above-p75 .dept-legend-dot { background: var(--brand-indigo-500); }

/* Position indicator */
.dept-position-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
}

.dept-position-indicator.below-p25 {
    background: var(--danger-light);
    color: var(--brand-red-700);
}

.dept-position-indicator.p25-p50 {
    background: var(--warning-light);
    color: var(--brand-amber-700);
}

.dept-position-indicator.p50-p75 {
    background: var(--brand-green-100);
    color: var(--brand-green-700);
}

.dept-position-indicator.above-p75 {
    background: var(--primary-light);
    color: var(--primary-hover);
}

.dept-position-indicator.no-data {
    background: var(--gray-100);
    color: var(--gray-400);
}

/* Position dot */
.dept-position-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dept-position-indicator.below-p25 .dept-position-dot { background: var(--danger); }
.dept-position-indicator.p25-p50 .dept-position-dot { background: var(--warning); }
.dept-position-indicator.p50-p75 .dept-position-dot { background: var(--brand-green-500); }
.dept-position-indicator.above-p75 .dept-position-dot { background: var(--brand-indigo-500); }
.dept-position-indicator.no-data .dept-position-dot { background: var(--gray-300); }

/* Market values */
.dept-market-value {
    color: var(--gray-500);
    font-size: var(--text-sm);
}

.dept-your-value {
    color: var(--gray-800);
    font-weight: var(--font-semibold);
}

/* Mapping Status */
.dept-mapping-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--warning-light);
    border-top: 1px solid #fde68a;
    font-size: var(--text-sm);
    color: var(--brand-amber-800);
}

.dept-mapping-status svg {
    flex-shrink: 0;
}

.dept-mapping-status.complete {
    background: var(--brand-green-100);
    border-top-color: var(--brand-green-200);
    color: var(--brand-green-800);
}

/* Role Drilldown Modal */
.dept-drilldown-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.dept-drilldown-overlay.active {
    opacity: 1;
    visibility: visible;
}

.dept-drilldown-card {
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.dept-drilldown-overlay.active .dept-drilldown-card {
    transform: scale(1);
}

.dept-drilldown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--primary-light) 100%);
    border-bottom: 1px solid var(--gray-200);
}

.dept-drilldown-header h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--brand-indigo-800);
}

.dept-drilldown-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--gray-500);
    border-radius: 4px;
}

.dept-drilldown-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.dept-drilldown-body {
    padding: 1.25rem;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

/* Drilldown metrics */
.dept-drilldown-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.dept-drilldown-metric {
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: var(--radius);
    padding: 1rem;
}

.dept-drilldown-metric-label {
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.dept-drilldown-metric-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}

/* Drilldown distribution chart */
.dept-drilldown-chart {
    margin-bottom: 1.25rem;
}

.dept-drilldown-chart-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.dept-drilldown-bar-container {
    position: relative;
    height: 40px;
    background: var(--gray-100);
    border-radius: 6px;
    overflow: visible;
    margin-bottom: 0.5rem;
}

/* Distribution range */
.dept-drilldown-range {
    position: absolute;
    top: 8px;
    height: 24px;
    border-radius: 4px;
}

.dept-drilldown-range.iqr {
    background: linear-gradient(90deg, var(--brand-green-100) 0%, var(--brand-green-200) 100%);
}

.dept-drilldown-range.whisker {
    background: var(--gray-200);
}

/* Percentile markers in drilldown */
.dept-drilldown-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.dept-drilldown-marker.your-position {
    background: var(--primary);
}

.dept-drilldown-marker.p50 {
    background: var(--brand-green-600);
    width: 4px;
    height: 32px;
    border-radius: 2px;
    top: 4px;
    transform: translateX(-50%);
}

/* Market cuts section */
.dept-drilldown-cuts {
    border-top: 1px solid var(--gray-100);
    padding-top: 1rem;
}

.dept-drilldown-cuts-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.dept-drilldown-cuts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.dept-drilldown-cut {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: var(--text-sm);
}

.dept-drilldown-cut-label {
    color: var(--gray-600);
}

.dept-drilldown-cut-value {
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

/* Responsive */
@media (max-width: 768px) {
    .dept-metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .dept-role-table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .dept-role-controls {
        width: 100%;
        justify-content: space-between;
    }

    .dept-grade-bar-row {
        grid-template-columns: 100px 1fr 50px;
    }

    .dept-drilldown-metrics {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   CRM (Client Management)
   ============================================ */

/* Dashboard Stats */
.crm-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.crm-stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid var(--gray-200);
    text-align: center;
    transition: box-shadow 0.2s;
}

.crm-stat-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.crm-stat-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}

.crm-stat-label {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Deprecated 2026-06-11: .crm-tabs / .crm-tab / .crm-tab-content replaced by canonical
   .tabs / .tab-btn / .tab-content. */

/* Actions Row */
.clients-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

/* ===== Global Search Bar Component ===== */
.search-bar {
    position: relative;
    width: 100%;
}

.search-bar svg.search-bar-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 0.6rem 0.75rem 0.6rem 2.35rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: var(--text-body);
    background: var(--white);
    color: var(--gray-900);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.search-bar input::placeholder {
    color: var(--gray-400);
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Compact variant for dropdowns/tight spaces — renamed from .top-bar-hotel-search-bar
   2026-06-11 per docs/ui-elements.md → Search bars (Approved). */
.search-bar.search-bar-compact {
    margin: 0.25rem 0.375rem 0.375rem;
    width: calc(100% - 0.75rem);
}

.search-bar.search-bar-compact input {
    padding: 0.4rem 0.625rem 0.4rem 2rem;
    font-size: var(--text-sm);
}

.search-bar.search-bar-compact svg.search-bar-icon {
    left: 0.5rem;
    width: 14px;
    height: 14px;
}
/* Salary overlay search container sizing */
.salary-overlay-search-container .search-bar {
    max-width: 440px;
}

/* Settings manager search — position relative for dropdown */
.settings-manager-search-wrapper .search-bar {
    width: 100%;
}

/* CRM Tables */
.crm-table-wrapper {
    overflow-x: auto;
}

.crm-overdue-row {
    background: #fef2f2 !important;
}

.crm-actions {
    white-space: nowrap;
    display: flex;
    gap: 0.25rem;
}

.crm-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: var(--font-medium);
}

.crm-link:hover {
    text-decoration: underline;
}

/* CRM Badges */
.crm-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    white-space: nowrap;
}

.crm-badge-warning { background: var(--warning-light); color: var(--brand-amber-800); }
.crm-badge-info { background: var(--primary-light); color: var(--brand-indigo-800); }
.crm-badge-success { background: var(--brand-green-100); color: var(--brand-green-800); }
.crm-badge-danger { background: var(--danger-light); color: var(--brand-red-800); }
.crm-badge-muted { background: var(--gray-100); color: var(--gray-500); }

.crm-hotel-tag {
    display: inline-block;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: var(--text-xs);
    padding: 1px 6px;
    border-radius: 3px;
    margin: 1px 2px;
    line-height: 1.4;
    white-space: nowrap;
}
.crm-hotels-cell {
    max-width: 180px;
    line-height: 1.6;
}

/* Danger outline button */
.btn-danger-outline {
    color: var(--danger) !important;
    border-color: #fca5a5 !important;
}

.btn-danger-outline:hover {
    background: #fef2f2 !important;
    border-color: var(--danger) !important;
}

/* Section Header Row */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Subscription Cards */

.sub-amount {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

/* Confirmation tab */
.confirmation-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
}

.confirmation-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.confirmation-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirmation-icon-warn {
    background: var(--warning-light);
    color: var(--brand-amber-700);
}

.confirmation-icon-ok {
    background: var(--success-light);
    color: var(--brand-green-700);
}

.confirmation-summary {
    flex: 1;
}

.confirmation-count {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    line-height: 1;
}

.confirmation-label {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-top: 0.25rem;
}

.confirmation-desc {
    font-size: var(--text-body);
    color: var(--gray-400);
    margin-top: 0.15rem;
}

.confirmation-details {
    border-top: 1px solid var(--gray-200);
    padding: 0;
}

.confirmation-sub-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.15rem 0;
    font-size: var(--text-body);
}

.btn-pdf {
    background: var(--gray-50) !important;
    border-color: var(--gray-300) !important;
    color: var(--danger) !important;
    font-weight: var(--font-semibold) !important;
    font-size: var(--text-sm) !important;
    padding: 0.2rem 0.5rem !important;
}
.btn-pdf:hover {
    background: #fee2e2 !important;
    border-color: var(--danger) !important;
}

.btn-contract {
    background: var(--gray-50) !important;
    border-color: var(--gray-300) !important;
    color: #7c3aed !important;
    font-weight: var(--font-semibold) !important;
    font-size: var(--text-sm) !important;
}
.btn-contract:hover {
    background: #ede9fe !important;
    border-color: #7c3aed !important;
}

.btn-generate-contract {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Performance aging */
.performance-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.perf-card {
    flex: 1;
    min-width: 140px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 14px 16px;
    text-align: center;
}
.perf-card-label {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-bottom: 4px;
    font-weight: var(--font-medium);
}
.perf-card-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}
.perf-card-warning {
    border-color: var(--warning);
    background: var(--warning-lighter);
}
.perf-card-warning .perf-card-value { color: var(--brand-amber-700); }
.perf-card-danger {
    border-color: var(--brand-red-500);
    background: var(--danger-lighter);
}
.perf-card-danger .perf-card-value { color: var(--danger); }
.perf-card-critical {
    border-color: var(--brand-red-800);
    background: var(--danger-light);
}
.perf-card-critical .perf-card-value { color: var(--brand-red-800); }

.prospect-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    background: var(--gray-100);
    color: var(--gray-700);
}
.prospect-status-hot {
    background: var(--warning-light);
    color: var(--brand-amber-800);
}
.prospect-status-lost {
    background: var(--danger-light);
    color: var(--brand-red-800);
}
.prospect-overdue {
    color: var(--danger);
    font-weight: var(--font-semibold);
}

.btn-convert {
    background: var(--gray-50) !important;
    border-color: var(--gray-300) !important;
    color: var(--success) !important;
    font-weight: var(--font-semibold) !important;
    font-size: var(--text-sm) !important;
}
.btn-convert:hover {
    background: #f0fdf4 !important;
    border-color: var(--success) !important;
}

.contract-upload-section {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}
.contract-upload-section h4 {
    margin: 0 0 12px 0;
    font-size: var(--text-body);
    color: var(--gray-700);
}

.sub-discount {
    font-size: var(--text-body);
    color: var(--success);
    margin-top: 0.25rem;
    font-weight: var(--font-medium);
}

.sub-notes {
    font-size: var(--text-body);
    color: var(--gray-400);
    margin-top: 0.25rem;
    font-style: italic;
}

.sub-total-amount {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    min-height: 2.25rem;
    display: flex;
    align-items: center;
}

.sub-invoice-amount {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    min-height: 2.25rem;
    display: flex;
    align-items: center;
}

.sub-invoice-amount.has-discount {
    color: var(--success);
    background: var(--success-lighter);
    border-color: var(--brand-green-200);
}

/* CRM modal form overrides — intentionally different from general .form-section rules */
.form-section-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.form-section-desc {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

/* Deprecated 2026-06-11: .crm-toggle / .crm-toggle-slider / .crm-toggle-label
   was dead CSS (never applied as classes). Use canonical .switch instead.
   See docs/ui-elements.md → Toggles / switches. */

.crm-inactive-row {
    opacity: 0.5;
}

/* Modal small variant */
.modal-small {
    max-width: 420px;
}

/* CRM responsive (supplementary) */
@media (max-width: 768px) {
    .clients-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .clients-search {
        max-width: none;
    }

}

/* ===== Learning Centre – Turnover Guide ===== */

/* Guide cards — accent border card system (matches Insights card pattern) */
.guide-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--guide-accent, var(--gray-300));
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1rem;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    transition: width 0.3s ease, background-color 0.25s ease, border-left-width 0.3s ease, border-right-width 0.3s ease;
}

.guide-card.card-expanded {
    width: 100%;
    border-left: 6px solid var(--guide-accent, var(--gray-300)) !important;
    border-right: 6px solid var(--guide-accent, var(--gray-300)) !important;
}

/* Accent colors per section */
.guide-card-people { --guide-accent: var(--brand-teal-400); }
.guide-card-financial { --guide-accent: var(--brand-pink-400); }
.guide-card-rewards { --guide-accent: var(--brand-green-400); }
.guide-card-workforce { --guide-accent: var(--brand-amber-400); }
.guide-card-benchmark { --guide-accent: var(--brand-indigo-400); }
.guide-card-support { --guide-accent: var(--gray-400); }

.guide-card-header {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    user-select: none;
    transition: background-color 0.15s ease;
}

.guide-card-header:hover {
    background-color: var(--gray-50);
}

.guide-card-header h3 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: #64748b;
    margin-bottom: 0;
    flex: 1;
}

.guide-card.card-expanded .guide-card-header h3 {
    color: #334155;
}

.guide-card-header p {
    opacity: 0.85;
    font-size: var(--text-body);
}

.guide-chevron {
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.guide-card-header.collapsed .guide-chevron {
    transform: rotate(-90deg);
}

/* Collapsible body */
.guide-card-body-collapsible {
    max-height: 5000px;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 1;
}

.guide-card-body-collapsible.collapsed {
    max-height: 0;
    opacity: 0;
}

.guide-intro {
    padding: 1.5rem 2.5rem;
    font-size: var(--text-body);
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
    line-height: 1.7;
}

.guide-section {
    padding: 2rem 2.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.guide-section:last-child {
    border-bottom: none;
}

.guide-section h4 {
    font-size: var(--text-lg);
    color: var(--gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-section p,
.guide-section li {
    font-size: var(--text-body);
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.guide-section ol,
.guide-section ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

/* SVG diagram container */
.guide-diagram {
    margin: 1.5rem 0;
    text-align: center;
}

.guide-svg {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Callout boxes */
.guide-callout {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    font-size: var(--text-body);
    line-height: 1.6;
}

.guide-callout strong {
    display: block;
    margin-bottom: 0.25rem;
}

.guide-callout-tip {
    background: var(--success-lighter);
    border-left: 4px solid var(--brand-green-500);
    color: var(--brand-green-800);
}

.guide-callout-info {
    background: var(--primary-lighter);
    border-left: 4px solid var(--primary);
    color: var(--brand-indigo-800);
}

.guide-callout-warning {
    background: var(--warning-lighter);
    border-left: 4px solid var(--warning);
    color: var(--brand-amber-800);
}

/* Metrics grid */
.guide-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.guide-metric-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.guide-metric-title {
    font-weight: var(--font-semibold);
    font-size: var(--text-body);
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.guide-metric-formula {
    font-family: var(--font-mono);
    font-size: var(--text-body);
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.guide-metric-card p {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-bottom: 0;
}

/* Colour key / legend */
.guide-colour-key {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
}

.guide-colour-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: var(--text-body);
    color: var(--gray-600);
}

.guide-colour-swatch {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
}

/* Retirement risk buckets */
.guide-retirement-buckets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.guide-retire-bucket {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    text-align: center;
    border: 1px solid transparent;
}

.guide-retire-bucket-low {
    background: var(--brand-green-50);
    color: var(--brand-green-800);
    border-color: var(--brand-green-200);
}

.guide-retire-bucket-medium {
    background: var(--warning-lighter);
    color: var(--brand-amber-800);
    border-color: var(--brand-amber-200);
}

.guide-retire-bucket-high {
    background: var(--danger-lighter);
    color: var(--brand-red-800);
    border-color: var(--brand-red-200);
}

.guide-retire-bucket-critical {
    background: var(--danger-lighter);
    color: #7f1d1d;
    border-color: var(--brand-red-300);
}

/* Guide tables */
.guide-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: var(--text-body);
}

.guide-table th,
.guide-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.guide-table th {
    background: var(--gray-50);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    font-size: var(--text-body);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.guide-table td {
    color: var(--gray-600);
}

.guide-required {
    display: inline-block;
    background: var(--danger-lighter);
    color: var(--brand-red-800);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
}

/* Steps list */
.guide-steps {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    counter-reset: guide-step;
}

.guide-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.guide-step:last-child {
    border-bottom: none;
}

.guide-step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    font-size: var(--text-body);
}

.guide-step-text {
    font-size: var(--text-body);
    color: var(--gray-600);
    line-height: 1.6;
    padding-top: 0.25rem;
}

.guide-step-text strong {
    color: var(--gray-800);
}

/* Guide colour variants — Turnover Analysis (indigo — matches .turnover-card-header) */
/* Guide chevron colors — inherit from accent */
.guide-card-header .guide-chevron {
    stroke: var(--gray-400);
}
.guide-card.card-expanded .guide-card-header .guide-chevron {
    stroke: var(--guide-accent, var(--gray-400));
}

/* Hotel-only and Business-only visibility classes */
.hotel-only,
.business-only {
    display: block;
}

/* Learning section headings */
.learning-category {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.learning-category:first-child {
    margin-top: 0;
}

.learning-category-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-bottom: none;
    border-left: 4px solid var(--section-accent, var(--gray-300));
    border-radius: var(--radius);
    background: var(--gray-50);
    margin-bottom: 1.25rem;
}

/* Section accent colors */
#learning-section-people .learning-category-header { --section-accent: var(--brand-teal-400); }
#learning-section-financial .learning-category-header { --section-accent: var(--brand-pink-400); }
#learning-section-rewards .learning-category-header { --section-accent: var(--brand-green-400); }
#learning-section-workforce .learning-category-header { --section-accent: var(--brand-amber-400); }
#learning-section-benchmark .learning-category-header { --section-accent: var(--brand-indigo-400); }
#learning-section-support .learning-category-header { --section-accent: var(--gray-400); }

.learning-category-header h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}

.learning-category-header svg {
    flex-shrink: 0;
}

.learning-category-count {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-left: auto;
}

.learning-category-placeholder {
    font-size: var(--text-body);
    color: var(--gray-400);
    font-style: italic;
    padding: 1.25rem 1.5rem;
    background: var(--gray-50);
    border: 1px dashed var(--gray-200);
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 1rem;
}

/* Guide responsive */
@media (max-width: 768px) {
    .guide-card-header {
        padding: 1.5rem;
    }

    .guide-intro,
    .guide-section {
        padding: 1.25rem 1.5rem;
    }

    .guide-metrics-grid {
        grid-template-columns: 1fr;
    }

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

/* ============================================
   Reports Section
   ============================================ */

.reports-container {
    max-width: 100%;
}

.reports-setup {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

/* Reports selectors removed — now in top bar */

#generate-report-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
}

#generate-report-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.reports-list-section {
    margin-top: 1.5rem;
}

.reports-list-section h3 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 0.75rem;
}

.reports-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
}

.reports-list-table thead th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    background: var(--gray-50);
    font-size: var(--text-body);
}

.reports-list-table tbody td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.reports-list-table tbody tr:hover {
    background: var(--gray-50);
}

.reports-actions {
    display: flex;
    gap: 0.5rem;
}

.report-download-btn {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.report-download-btn:hover {
    background: var(--primary) !important;
    color: white !important;
}

.report-delete-btn {
    color: var(--danger) !important;
    border-color: var(--danger) !important;
}

.report-delete-btn:hover {
    background: var(--danger) !important;
    color: white !important;
}

@media (max-width: 768px) {
    .reports-list-table {
        font-size: var(--text-sm);
    }

    .reports-list-table thead th,
    .reports-list-table tbody td {
        padding: 0.4rem 0.5rem;
    }
}

/* ============================================
   Department Mapping Wizard
   ============================================ */

#department-mapping-modal {
    z-index: 1100;
}

/* Department mapping modal uses default 80% size */
#department-mapping-modal .modal-body {
    overflow-y: auto;
}

.mapping-wizard-desc {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-bottom: 1rem;
}

/* Deprecated 2026-06-11: .mapping-category-select was dead CSS (never applied as class).
   Use .form-group-sm select. */

.confidence-high {
    background: var(--brand-green-100);
    color: var(--brand-green-600);
}

.confidence-medium {
    background: var(--warning-light);
    color: var(--brand-amber-600);
}

.confidence-low {
    background: var(--danger-light);
    color: var(--danger);
}

.confidence-manual {
    background: var(--primary-light);
    color: var(--primary);
}

/* ── Canonical mapping dropdown — Department + Division ──────────
   Both mapping flows render <select> elements inside table rows where
   the default `.form-group select` padding (0.75rem 1rem) would be too
   tall. This rule provides one consistent compact dropdown that still
   matches the app's canonical border, radius, font, and focus state —
   ensuring department + division mapping dropdowns look identical to
   each other and to other compact dropdowns elsewhere in the app.
   ─────────────────────────────────────────────────────────────── */
/* .mapping-template-select / .mapping-division-select are retained as JS marker classes
   only — styling comes from the canonical .form-group-sm wrapper.
   The Create-new-option styling below is scoped to the create-new-option class itself. */

option.create-new-option {
    font-style: italic;
    color: var(--brand-indigo-500);
    background: #f0f0ff;
}

.mapping-division-cell {
    min-width: 160px;
}

.mapping-wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mapping-wizard-info {
    background: #f0f9ff;
    border: 1px solid var(--brand-indigo-200);
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: var(--text-body);
    color: var(--brand-indigo-700);
}

.mapping-wizard-info strong {
    color: #0c4a6e;
}

.mapping-wizard-info em {
    font-style: italic;
}

/* Division/Functional Area summary grid */
.division-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.division-summary-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.division-summary-card h5 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.division-summary-card .division-dept-count {
    font-size: var(--text-xs);
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 0.1rem 0.4rem;
    border-radius: 9999px;
    font-weight: var(--font-medium);
}

.division-summary-card ul {
    margin: 0;
    padding: 0 0 0 1rem;
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.division-summary-card li {
    margin-bottom: 0.2rem;
}

/* Mapping summary in hotel profile */
.mapping-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
}

.mapping-summary-table th {
    text-align: left;
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mapping-summary-table td {
    padding: 0.4rem 0.5rem;
    font-size: var(--text-body);
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

/* Grade Salary Policy Table */
.grade-salary-policy-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.grade-salary-policy-table th {
    text-align: left;
    padding: 0.4rem 0.5rem;
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--gray-200);
}

.grade-salary-policy-table td {
    padding: 0.35rem 0.5rem;
    font-size: var(--text-body);
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.grade-salary-policy-table td.grade-cell {
    font-weight: var(--font-semibold);
    min-width: 80px;
}

.grade-salary-policy-table input[type="number"] {
    width: 100%;
    max-width: 120px;
    padding: 0.25rem 0.4rem;
    font-size: var(--text-body);
    border: 1px solid var(--gray-300);
    border-radius: 0.25rem;
}

.grade-salary-policy-table input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* ============================================
   Support Tickets Styles
   ============================================ */

/* Navbar ticket badge */
.ticket-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 8px;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: white;
    background: var(--danger);
    border-radius: 9px;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

#nav-support-tickets.has-tickets {
    background: rgba(220, 38, 38, 0.1);
    border-left: 3px solid var(--danger);
}

#nav-support-tickets.has-tickets svg {
    stroke: var(--danger);
}

/* Helpdesk nav unread notification */
#nav-helpdesk.has-unread {
    color: var(--danger) !important;
    background: rgba(220, 38, 38, 0.1);
    border-left: 3px solid var(--danger);
}

#nav-helpdesk.has-unread svg {
    stroke: var(--danger);
}

/* My Tickets Section (Helpdesk) */
.my-tickets-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}

.my-tickets-section h3 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.my-tickets-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* User ticket card */
.my-ticket-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.my-ticket-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.my-ticket-card.has-new-reply {
    border-left: 4px solid var(--danger);
    background: rgba(220, 38, 38, 0.03);
}

.my-ticket-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.my-ticket-header .ticket-id {
    font-size: var(--text-sm);
    color: var(--gray-500);
    font-weight: var(--font-medium);
}

.my-ticket-subject {
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 0.35rem;
}

.my-ticket-meta {
    display: flex;
    gap: 1rem;
    font-size: var(--text-body);
    color: var(--gray-500);
}

/* Admin Tickets List */
.admin-tickets-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-ticket-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
}

.admin-ticket-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.admin-ticket-card.priority-high {
    border-left: 3px solid var(--danger);
}

.admin-ticket-card.priority-medium {
    border-left: 3px solid var(--brand-amber-500);
}

.admin-ticket-card.priority-low {
    border-left: 3px solid var(--success);
}

.admin-ticket-id {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    min-width: 50px;
}

.admin-ticket-main {
    min-width: 0;
}

.admin-ticket-subject {
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.admin-ticket-meta {
    display: flex;
    gap: 1rem;
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.admin-ticket-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.admin-ticket-date {
    font-size: var(--text-sm);
    color: var(--gray-400);
    white-space: nowrap;
}

/* Ticket Stats Row */
.ticket-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ticket-stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}

.ticket-stat-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}

.ticket-stat-label {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.ticket-stat-pending { border-top: 3px solid var(--brand-amber-500); }
.ticket-stat-pending .ticket-stat-value { color: var(--warning); }

.ticket-stat-progress { border-top: 3px solid var(--brand-indigo-500); }
.ticket-stat-progress .ticket-stat-value { color: var(--brand-indigo-500); }

.ticket-stat-complete { border-top: 3px solid var(--success); }
.ticket-stat-complete .ticket-stat-value { color: var(--success); }

/* Ticket Detail Modal */
.ticket-detail-header {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.ticket-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.ticket-detail-meta .ticket-id {
    font-weight: var(--font-bold);
    color: var(--gray-600);
}

.ticket-detail-meta .ticket-category {
    font-size: var(--text-body);
    color: var(--gray-500);
    padding: 0.15rem 0.5rem;
    background: var(--gray-200);
    border-radius: 4px;
}

.ticket-detail-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: var(--text-body);
    color: var(--gray-600);
}

.ticket-detail-subject {
    margin-bottom: 1.5rem;
}

.ticket-detail-subject h4 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

/* Conversation Thread */
.ticket-conversation {
    margin-bottom: 1.5rem;
}

.ticket-conversation h4 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.ticket-messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 350px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.ticket-message {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}

.ticket-message.admin-reply {
    background: var(--primary-lighter);
    border-color: var(--brand-indigo-200);
}

.ticket-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.ticket-message-author {
    font-weight: var(--font-semibold);
    font-size: var(--text-body);
    color: var(--gray-800);
}

.ticket-message.admin-reply .ticket-message-author {
    color: var(--primary-hover);
}

.ticket-message-author::after {
    content: '';
}

.ticket-message.admin-reply .ticket-message-author::after {
    content: ' (Support)';
    font-weight: var(--font-normal);
    color: var(--brand-indigo-500);
}

.ticket-message-date {
    font-size: var(--text-sm);
    color: var(--gray-400);
}

.ticket-message-body {
    font-size: var(--text-body);
    color: var(--gray-700);
    line-height: 1.5;
    white-space: pre-wrap;
}

/* Reply Form */
.ticket-reply-form {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.ticket-reply-form .form-group {
    margin-bottom: 0.75rem;
}

.ticket-reply-form label {
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-700);
    margin-bottom: 0.35rem;
    display: block;
}

.ticket-reply-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: var(--text-body);
    resize: vertical;
    min-height: 80px;
}

.ticket-reply-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Admin Controls */
.ticket-admin-controls {
    background: var(--warning-light);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
}

.ticket-admin-controls h4 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--brand-amber-800);
    margin-bottom: 0.75rem;
}

.ticket-status-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ticket-status-controls .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.pending { background: var(--warning); }
.status-dot.in-progress { background: var(--primary); }
.status-dot.complete { background: var(--success); }

/* Active status button styling */
.ticket-status-controls .btn.status-active {
    ring: 2px;
    box-shadow: 0 0 0 2px var(--primary);
    background: var(--primary-light, #eff6ff);
    border-color: var(--primary);
    font-weight: var(--font-semibold);
}

.ticket-status-controls .btn.status-active[data-status="pending"] {
    box-shadow: 0 0 0 2px var(--warning);
    background: var(--warning-light);
    border-color: var(--warning);
    color: var(--brand-amber-800);
}

.ticket-status-controls .btn.status-active[data-status="in_progress"] {
    box-shadow: 0 0 0 2px var(--primary);
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--brand-indigo-800);
}

.ticket-status-controls .btn.status-active[data-status="complete"] {
    box-shadow: 0 0 0 2px var(--success);
    background: var(--success-light);
    border-color: var(--success);
    color: var(--brand-green-800);
}

/* Status Timeline in Ticket Detail */
.ticket-status-timeline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-sm);
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray-300);
}

.timeline-item.pending .timeline-dot { background: var(--warning); }
.timeline-item.in-progress .timeline-dot { background: var(--brand-indigo-500); }
.timeline-item.complete .timeline-dot { background: var(--success); }

.timeline-item.inactive .timeline-dot { background: var(--gray-300); }
.timeline-item.inactive .timeline-label,
.timeline-item.inactive .timeline-time { color: var(--gray-400); }

.timeline-label {
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.timeline-time {
    color: var(--gray-500);
    font-size: var(--text-xs);
}

.timeline-connector {
    flex: 1;
    height: 2px;
    background: var(--gray-300);
    min-width: 20px;
}

.timeline-connector.active {
    background: var(--primary);
}

/* Performance Tab Styling */
.ticket-perf-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.ticket-perf-tab svg {
    opacity: 0.7;
}

/* Performance Panel */
.ticket-performance-panel {
    padding: 1.5rem 0;
}

.perf-section {
    margin-bottom: 2rem;
}

.perf-section h3 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.perf-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.perf-metric-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    transition: all 0.15s ease;
}

.perf-metric-card:hover {
    box-shadow: var(--shadow-md);
}

.perf-metric-card.highlight {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, white 100%);
}

.perf-metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.perf-metric-icon.pending {
    background: var(--warning-light);
    color: var(--brand-amber-600);
}

.perf-metric-icon.in-progress {
    background: var(--primary-light);
    color: var(--primary);
}

.perf-metric-icon.complete {
    background: var(--success-light);
    color: var(--success);
}

.perf-metric-content {
    flex: 1;
}

.perf-metric-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-900);
    line-height: 1.2;
}

.perf-metric-label {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-top: 0.15rem;
}

/* Priority Grid */
.perf-priority-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.perf-priority-card {
    padding: 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    text-align: center;
}

.perf-priority-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.priority-dot.high { background: var(--danger); }
.priority-dot.medium { background: var(--warning); }
.priority-dot.low { background: var(--success); }

.perf-priority-value {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-900);
}

.perf-priority-card.high { border-left: 3px solid var(--danger); }
.perf-priority-card.medium { border-left: 3px solid var(--brand-amber-500); }
.perf-priority-card.low { border-left: 3px solid var(--success); }

/* Category Grid */
.perf-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.perf-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}

.perf-category-name {
    font-size: var(--text-body);
    color: var(--gray-700);
}

.perf-category-count {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--gray-900);
    background: var(--gray-100);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

/* Summary */
.perf-summary {
    display: flex;
    gap: 2rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--brand-indigo-800) 0%, var(--brand-indigo-500) 100%);
    border-radius: var(--radius);
}

.perf-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Scoped to .perf-summary (dark gradient background) */
.perf-summary .perf-summary-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: white;
}

.perf-summary .perf-summary-label {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.25rem;
}

/* Form section title */
.form-section-title {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

/* Inactivity Warning Modal */
.inactivity-modal .modal-content {
    animation: shake 0.5s ease-in-out;
}

.inactivity-modal .modal-header {
    background: linear-gradient(135deg, var(--brand-amber-100) 0%, var(--brand-amber-200) 100%);
    border-bottom: 2px solid var(--brand-amber-500);
}

.inactivity-modal .modal-header h3 {
    color: var(--brand-amber-800);
}

.inactivity-icon {
    margin-bottom: 0.5rem;
}

.inactivity-countdown {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--danger);
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* System Views Styles */
.system-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.system-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.system-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.system-card-header h3 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin: 0;
}

.system-card-body {
    padding: 1.5rem;
}

.system-description {
    color: var(--gray-600);
    font-size: var(--text-body);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.system-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.system-toggle-label {
    font-weight: var(--font-medium);
    color: var(--gray-800);
}

/* .toggle-switch / .toggle-slider removed 2026-10-06: the 2FA requirement was its
   last user and now uses the approved .switch (docs/ui-elements.md, Toggles). */

.system-status {
    font-size: var(--text-body);
    color: var(--gray-600);
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.system-stats-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.system-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.system-stat-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--primary);
}

.system-stat-label {
    font-size: var(--text-sm);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Performance Analytics Styles */
.performance-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.performance-summary-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: center;
}

.performance-summary-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.performance-summary-label {
    font-size: var(--text-body);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.performance-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.performance-section h3 {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin: 0 0 1rem;
}

.performance-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.performance-section-header h3 {
    margin: 0;
}

.performance-top-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.performance-feature-row {
    display: grid;
    grid-template-columns: 40px 1fr 100px 80px;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.performance-feature-rank {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--primary);
    text-align: center;
}

.performance-feature-rank.gold {
    color: var(--warning);
}

.performance-feature-rank.silver {
    color: var(--gray-400);
}

.performance-feature-rank.bronze {
    color: var(--brand-amber-700);
}

.performance-feature-name {
    font-weight: var(--font-medium);
    color: var(--gray-900);
}

.performance-feature-category {
    font-size: var(--text-sm);
    color: var(--gray-500);
    padding: 0.25rem 0.5rem;
    background: var(--gray-200);
    border-radius: 9999px;
    text-align: center;
}

.performance-feature-clicks {
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    text-align: right;
}

.performance-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.performance-category-card {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1rem;
}

.performance-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.performance-category-name {
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    font-size: var(--text-body);
}

.performance-category-total {
    font-weight: var(--font-semibold);
    color: var(--primary);
}

.performance-category-items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.performance-category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-body);
    padding: 0.25rem 0;
}

.performance-category-item-name {
    color: var(--gray-600);
}

.performance-category-item-clicks {
    font-weight: var(--font-medium);
    color: var(--gray-700);
}

.performance-chart-container {
    height: 250px;
    position: relative;
}

.performance-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.system-setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.system-setting-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.system-setting-label {
    font-weight: var(--font-medium);
    color: var(--gray-800);
}

.system-setting-desc {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.system-setting-value {
    font-weight: var(--font-semibold);
    color: var(--primary);
    font-size: var(--text-body);
}

.system-policy-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.system-policy-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    color: var(--gray-700);
    font-size: var(--text-body);
}

.system-policy-list li:before {
    content: "✓";
    color: var(--success);
    font-weight: var(--font-semibold);
}

/* Exchange Rates Table */
.exchange-rates-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
}

.exchange-rates-grid th,
.exchange-rates-grid td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.exchange-rates-grid th {
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--gray-50);
}

.exchange-rates-grid tbody tr:hover {
    background: var(--gray-50);
}

.exchange-rate-input {
    width: 120px;
    padding: 0.35rem 0.5rem;
    font-size: var(--text-body);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
}

.exchange-rate-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.exchange-rate-input:disabled {
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    border-radius: 3px;
    text-transform: uppercase;
}

.badge-success {
    background: var(--success-light);
    color: var(--brand-green-800);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--brand-amber-800);
}

.badge-muted {
    background: var(--gray-100);
    color: var(--gray-600);
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: var(--text-sm);
}

/* Currency Conversion Indicator */
.currency-conversion-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    color: var(--brand-indigo-500);
    cursor: help;
}

.currency-conversion-indicator svg {
    width: 12px;
    height: 12px;
}

.currency-converted-note {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--text-xs);
    color: var(--brand-indigo-500);
    background: var(--primary-lighter);
    border: 1px solid var(--brand-indigo-200);
    border-radius: 3px;
    padding: 0.15rem 0.4rem;
    margin-left: 0.5rem;
}

.currency-converted-note svg {
    width: 10px;
    height: 10px;
}

/* Backup Management Styles */
.backup-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.backup-stat {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
}

.backup-stat-value {
    display: block;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--primary);
}

.backup-stat-label {
    display: block;
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.backup-history-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
}

.backup-history-grid th,
.backup-history-grid td {
    padding: 0.6rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.backup-history-grid th {
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--gray-50);
}

.backup-history-grid tbody tr:hover {
    background: var(--gray-50);
}

.backup-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

#backup-page-info {
    font-size: var(--text-body);
    color: var(--gray-600);
}

/* Deprecated 2026-06-11: #system-settings-view .tabs / .tab-btn scoped rules +
   .system-tab-content replaced by canonical global .tabs / .tab-btn / .tab-content. */

/* Methodology Tab */
.methodology-container {
    max-width: 900px;
}

.methodology-intro {
    color: var(--gray-600);
    font-size: var(--text-body);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

.methodology-section {
    margin-bottom: 2rem;
}

.methodology-section-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}

.methodology-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.methodology-item {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.methodology-item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.methodology-item-header:hover {
    background: var(--gray-50);
}

.methodology-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: transform 0.2s;
}

.methodology-item.expanded .methodology-chevron {
    transform: rotate(180deg);
}

.methodology-item-title {
    font-weight: var(--font-medium);
    color: var(--gray-700);
    font-size: var(--text-body);
}

.methodology-item-content {
    display: none;
    padding: 0 1rem 1rem 2.5rem;
    font-size: var(--text-body);
    color: var(--gray-600);
    line-height: 1.6;
}

.methodology-item.expanded .methodology-item-content {
    display: block;
}

.methodology-item-content ul {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.methodology-item-content li {
    margin-bottom: 0.35rem;
}

.methodology-item-content code {
    background: var(--gray-100);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: var(--text-body);
    color: var(--brand-indigo-700);
}

.methodology-item-content strong {
    color: var(--gray-800);
}

.badge-primary {
    background: var(--primary-light);
    color: var(--brand-indigo-800);
}

.badge-info {
    background: var(--brand-indigo-100);
    color: var(--brand-indigo-700);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--brand-red-800);
}

/* Audit Log Styles */
.audit-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.audit-filters .form-select-sm {
    padding: 0.35rem 0.75rem;
    font-size: var(--text-body);
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
}

.audit-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

#audit-page-info {
    font-size: var(--text-body);
    color: var(--gray-600);
}

/* Btn small variant */
.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: var(--text-body);
}

/* ===========================================
   ACCOUNTS MANAGEMENT STYLES
   =========================================== */

/* Impersonation Banner */
.impersonation-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(135deg, var(--brand-amber-500) 0%, var(--brand-amber-600) 100%);
    color: var(--gray-800);
    padding: 0.875rem 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-bottom: 3px solid #b45309;
    animation: impersonation-pulse 2s ease-in-out infinite;
}

@keyframes impersonation-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); }
    50% { box-shadow: 0 4px 24px rgba(245, 158, 11, 0.4); }
}

.impersonation-banner.hidden {
    display: none;
}

.impersonation-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.impersonation-content svg {
    flex-shrink: 0;
}

.impersonation-text {
    font-size: var(--text-body);
    font-weight: var(--font-medium);
}

.impersonation-text strong {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0, 0, 0, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-right: 0.25rem;
}

#impersonation-user-name,
#impersonation-account-name {
    font-weight: var(--font-bold);
}

.btn-warning {
    background: var(--gray-800);
    color: white;
    border: none;
    font-weight: var(--font-semibold);
}

.btn-warning:hover {
    background: #0f172a;
}

body.impersonating {
    padding-top: 56px;
}

body.impersonating .impersonation-banner {
    display: flex;
}

body.impersonating .sidebar {
    top: 56px;
    height: calc(100vh - 56px);
}

/* The 56px offset is already provided by `body.impersonating { padding-top: 56px }`
   above — adding it again to .main-content double-counted, leaving a 56px white gap
   between the banner and the top bar. Removed. The top-bar's sticky top: 56px below
   keeps it pinned just under the banner when the user scrolls. */

body.impersonating .top-bar {
    top: 56px; /* below impersonation banner when sticky */
}

body.impersonating .top-bar-mobile-panel {
    top: calc(56px + 60px); /* below impersonation banner + top bar */
}

body.impersonating .dashboard-header {
    top: 56px;
}

/* .settings-sidebar sticks at top: 60px (top-bar height) normally.
   When impersonating, account for the extra 56px banner above the top bar. */
body.impersonating .settings-sidebar {
    top: calc(56px + 60px);
    height: calc(100vh - calc(56px + 60px));
}

/* Billing Stat Colors */

/* Accounts List Panel - add bottom padding so it can scroll to top of viewport */
#accounts-list-panel {
    padding-bottom: 50vh;
}

/* Account Detail Panel */
#account-detail-panel {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.account-tab {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--gray-500);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: all 0.2s;
}

.account-tab:hover {
    color: var(--gray-700);
}

.account-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

#toggle-accounts-list-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-weight: var(--font-medium);
}

#toggle-accounts-list-btn .chevron-icon {
    transition: transform 0.2s;
}

#toggle-accounts-list-btn.expanded .chevron-icon {
    transform: rotate(180deg);
}

/* Security Tabs (follows account-tab pattern) */
/* Deprecated 2026-06-11: .security-tabs / .security-tab / .security-tab-content replaced
   by canonical .tabs / .tab-btn / .tab-content. */

/* Account Overview Grid */
.account-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Hotel Detail Card */
.hotel-detail-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.hotel-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.hotel-detail-header h4 {
    margin: 0;
    font-size: var(--text-lg);
}

.hotel-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.hotel-detail-section h5 {
    font-size: var(--text-body);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin: 0 0 0.75rem;
}

/* Hotel Detail Section Headers */
.hotel-detail-section-header {
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    font-weight: var(--font-semibold);
    margin: 1.25rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.hotel-detail-section-header:first-of-type {
    margin-top: 0;
}

/* Facilities Display */
.hotel-facilities-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.no-facilities-msg {
    color: var(--gray-400);
    font-size: var(--text-body);
    font-style: italic;
}

/* Mapping Section Description */
.mapping-section-desc {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin: 0 0 1rem;
}

.mapping-table-container {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1rem;
    min-height: 100px;
}

.mapping-table-container .text-muted {
    font-size: var(--text-body);
    color: var(--gray-400);
    font-style: italic;
}

.mapping-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: var(--text-body);
    color: var(--gray-600);
}

.mapping-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-body);
}

.mapping-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: var(--gray-100);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}

.mapping-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

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

.mapping-table tr:hover td {
    background: var(--gray-50);
}

/* Benchmark Peers Display */
.benchmark-peers-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.benchmark-peer-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, #6366f1 100%);
    color: white;
    border-radius: var(--radius);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
}

.benchmark-peer-tag .peer-match {
    font-size: var(--text-sm);
    opacity: 0.85;
}

/* Modal Benchmark List (read-only display) */
.modal-benchmark-list {
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.modal-benchmark-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-benchmark-tags .benchmark-peer-tag {
    padding: 0.35rem 0.65rem;
    font-size: var(--text-body);
    background: var(--gray-100);
    color: var(--gray-700);
}

.benchmark-count-text {
    margin: 0.5rem 0 0 0;
    font-size: var(--text-sm);
    color: var(--gray-500);
}

/* Users Tab */

#account-users-summary {
    font-size: var(--text-body);
    color: var(--gray-600);
}

/* Subscription Timeline */
.subscription-timeline-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.subscription-timeline-card h4 {
    margin: 0 0 1.25rem 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

/* Plan Details Card (in subscription modal) */

/* Setup Fee Section (in subscription modal) */

/* Mini Invoice Row (in account subscription tab) */

/* Subscription History */
.history-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.history-icon {
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    flex-shrink: 0;
}

.history-content {
    flex: 1;
}

.history-title {
    font-weight: var(--font-medium);
    color: var(--gray-900);
    font-size: var(--text-body);
}

.history-details {
    color: var(--gray-600);
    font-size: var(--text-body);
    margin-top: 0.125rem;
}

.history-meta {
    color: var(--gray-400);
    font-size: var(--text-sm);
    margin-top: 0.25rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.history-effective {
    color: var(--primary-color);
    font-weight: var(--font-medium);
}

.history-icon-success {
    background: #dcfce7;
    color: #16a34a;
}

.history-icon-info {
    background: #dbeafe;
    color: #2563eb;
}

.history-icon-warning {
    background: #fef3c7;
    color: #d97706;
}

.history-icon-danger {
    background: #fee2e2;
    color: #dc2626;
}

/* ===========================================
   WIZARD STYLES
   =========================================== */

.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-400);
}

.wizard-step.active {
    color: var(--primary);
}

.wizard-step.completed {
    color: var(--success);
}

.wizard-step-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gray-200);
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
}

.wizard-step.active .wizard-step-number {
    background: var(--primary);
    color: white;
}

.wizard-step.completed .wizard-step-number {
    background: var(--success);
    color: white;
}

.wizard-step-label {
    font-size: var(--text-body);
    font-weight: var(--font-medium);
}

.wizard-step-connector {
    width: 60px;
    height: 2px;
    background: var(--gray-200);
    margin: 0 0.75rem;
}

.wizard-panel {
    display: none;
}

.wizard-panel.active {
    display: block;
}

.wizard-panel h4 {
    margin: 0 0 0.5rem;
    font-size: var(--text-lg);
}

.wizard-description {
    color: var(--gray-500);
    font-size: var(--text-body);
    margin-bottom: 1.5rem;
}

.wizard-toggle-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.wizard-toggle-section .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.wizard-link-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: 6px;
}

.wizard-link-note svg {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* Responsive */
@media (max-width: 768px) {

    .account-overview-grid {
        grid-template-columns: 1fr;
    }

    .hotel-detail-grid {
        grid-template-columns: 1fr;
    }

    .wizard-steps {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .wizard-step-connector {
        display: none;
    }
}

/* ===========================================
   MY PROFILE (HOTEL/BUSINESS CONFIG) STYLES
   =========================================== */

/* Deprecated 2026-06-11: .my-profile-tabs / .my-profile-tab / .my-profile-tab-content
   replaced by canonical .tabs / .tab-btn / .tab-content. */

/* Profile Config Grid */
.profile-config-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.profile-config-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.profile-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.profile-config-header h3 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.profile-info-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-info-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-body);
}

.profile-info-row .label {
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.profile-info-row .value {
    color: var(--gray-800);
    font-weight: var(--font-medium);
    text-align: right;
}
.section-header {
    margin-bottom: 1.5rem;
}

.section-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: var(--text-lg);
    color: var(--gray-800);
}

.section-header p {
    margin: 0;
    color: var(--gray-600);
    font-size: var(--text-body);
}

.current-benchmarks {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.current-benchmarks h4 {
    margin: 0 0 1rem 0;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}
.add-benchmarks-section h4 {
    margin: 0 0 1rem 0;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}
/* ======================================
   NEW BENCHMARK SELECTOR STYLES
   ====================================== */

/* Stale Warning Banner */
.benchmark-stale-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--warning-light);
    border: 1px solid var(--brand-amber-500);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    color: var(--brand-amber-800);
    font-size: var(--text-body);
}

.benchmark-stale-banner svg {
    flex-shrink: 0;
    color: var(--warning);
}

.benchmark-stale-banner .btn {
    margin-left: auto;
}

/* Benchmark Management Modal */
/* Benchmark management modal uses default 80% size */
#benchmark-management-modal .modal-content {
    background: var(--white);
}

#benchmark-management-modal .modal-body {
    background: var(--gray-50);
}

/* Benchmark Modal Body */
.benchmark-modal-body {
    max-height: 70vh;
    overflow-y: auto;
    color: var(--gray-800);
}

.benchmark-modal-body .benchmark-section-card {
    margin-bottom: 1rem;
    background: var(--white);
}

.benchmark-modal-body .benchmark-section-card:last-child {
    margin-bottom: 0;
}

.benchmark-modal-body .benchmark-section-header h4 {
    margin: 0;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.benchmark-modal-body .benchmark-matches-header h5 {
    margin: 0;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.benchmark-modal-body .empty-message {
    color: var(--gray-500);
}

.benchmark-modal-body p {
    color: var(--gray-600);
}

.benchmark-modal-body .benchmark-peer-chip .peer-name {
    color: var(--gray-800);
}

.benchmark-modal-body .benchmark-peer-chip .peer-location {
    color: var(--gray-500);
}

.benchmark-modal-body .match-name {
    color: var(--gray-800);
}

.benchmark-modal-body .match-location {
    color: var(--gray-500);
}

.benchmark-modal-body .match-details {
    color: var(--gray-600);
}

/* Section Cards */
.benchmark-section-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.benchmark-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.benchmark-section-header h3 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

/* Current Benchmarks Grid */
.benchmark-peers-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Settings peer row list */
.settings-peer-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    transition: all 0.15s;
}

.settings-peer-row:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.settings-peer-stale {
    border-left: 3px solid var(--brand-amber-500);
}

.settings-peer-name-col {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;
    min-width: 0;
}

.settings-peer-name {
    font-weight: var(--font-semibold);
    font-size: 0.8rem;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-peer-location {
    font-size: 0.7rem;
    color: var(--gray-500);
}

.settings-peer-detail-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    width: 80px;
    flex-shrink: 0;
}

.settings-peer-detail-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-400);
    font-weight: 500;
}

.settings-peer-detail-value {
    font-size: 0.75rem;
    color: var(--gray-700);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
    text-align: center;
}

.settings-peer-match-score {
    font-size: 0.725rem;
    font-weight: 600;
    color: var(--primary-color);
    background: var(--indigo-50);
    padding: 0.2rem 0.5rem;
    border-radius: 100px;
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .settings-peer-row {
        flex-wrap: wrap;
    }
    .settings-peer-detail-col {
        min-width: 45px;
    }
}

.benchmark-peer-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: var(--text-body);
    cursor: pointer;
    transition: all 0.15s;
}

.benchmark-peer-chip:hover {
    background: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.1);
}

.benchmark-peer-chip.is-stale {
    border-color: var(--warning);
    background: var(--warning-lighter);
}

.benchmark-peer-chip .stale-icon {
    color: var(--warning);
}

.benchmark-peer-chip .peer-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.benchmark-peer-chip .peer-name {
    font-weight: var(--font-medium);
    color: var(--gray-800);
}

.benchmark-peer-chip .peer-location {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.benchmark-peer-chip .remove-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: all 0.15s;
}

.benchmark-peer-chip .remove-btn:hover {
    color: var(--danger-color);
    background: var(--danger-light);
}

/* Filters */
.benchmark-filters {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.benchmark-filter-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: var(--text-body);
    cursor: pointer;
    transition: all 0.15s;
}

.filter-toggle:hover {
    border-color: var(--primary-color);
}

.filter-toggle input:checked + span {
    color: var(--primary-color);
    font-weight: var(--font-medium);
}

.filter-toggle input {
    accent-color: var(--primary-color);
}

.benchmark-filter-selects {
    display: flex;
    gap: 1rem;
}

.filter-select-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
}

.filter-select-group label {
    color: var(--gray-600);
}

.filter-select-group select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: var(--text-body);
    background: white;
}

/* Matches Header */
.benchmark-matches-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.benchmark-matches-header h4 {
    margin: 0;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.matches-count {
    font-size: var(--text-body);
    color: var(--gray-500);
}

.benchmark-matches-header .btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Matches Grid */
.benchmark-matches-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 500px;
    overflow-y: auto;
}

.benchmark-match-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    transition: all 0.15s;
}

.benchmark-match-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.benchmark-match-card.is-stale {
    border-left: 3px solid var(--brand-amber-500);
}

.match-info {
    flex: 1;
}

.match-name {
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.match-location {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.match-details {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.match-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.match-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: var(--brand-indigo-100);
    color: var(--brand-indigo-700);
    border-radius: 100px;
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

.match-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.match-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Factor category labels in breakdown */
.factor-exact {
    color: var(--brand-green-700);
    font-weight: var(--font-semibold);
}

.factor-high {
    color: var(--brand-green-800);
    font-weight: var(--font-semibold);
}

.factor-medium {
    color: var(--brand-amber-800);
    font-weight: var(--font-semibold);
}

.factor-low {
    color: #9a3412;
    font-weight: var(--font-semibold);
}

.factor-none {
    color: var(--gray-400);
    font-weight: var(--font-medium);
}

/* Score label in modal ring */
.benchmark-score-label {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    text-align: center;
}

.benchmark-score-label.match-exact {
    color: var(--brand-green-700);
}

.benchmark-score-label.match-high {
    color: var(--brand-green-800);
}

.benchmark-score-label.match-medium {
    color: var(--brand-amber-800);
}

.benchmark-score-label.match-low {
    color: var(--gray-500);
}

.match-add-btn {
    padding: 0.4rem 0.75rem;
    font-size: var(--text-body);
}

/* Footer Note */
.benchmark-footer-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-500);
    font-size: var(--text-body);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.benchmark-footer-note svg {
    flex-shrink: 0;
}

/* Profile Completeness Modal */
.completeness-warning {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--warning-light);
    border: 1px solid var(--brand-amber-500);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.completeness-warning svg {
    flex-shrink: 0;
    color: var(--warning);
}

.completeness-warning strong {
    display: block;
    color: var(--brand-amber-800);
    margin-bottom: 0.25rem;
}

.completeness-warning p {
    color: var(--brand-amber-800);
    margin: 0;
    font-size: var(--text-body);
}

#completeness-fields-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#completeness-fields-container .form-group {
    margin: 0;
}

#completeness-fields-container .form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#completeness-fields-container .form-group label .required-badge {
    font-size: var(--text-xs);
    color: white;
    background: var(--danger-color);
    padding: 0.1rem 0.4rem;
    border-radius: 100px;
}

.completeness-progress {
    color: var(--gray-600);
    font-size: var(--text-body);
}

#profile-completeness-modal .modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Facilities checkbox grid for completeness modal */
.completeness-facilities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    max-height: 200px;
    overflow-y: auto;
}

.completeness-facilities-grid label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    cursor: pointer;
}

@media (max-width: 768px) {
    .completeness-facilities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Hotel-only filters (hide for businesses) */
body.is-business-profile .hotel-only-filter,
body.is-business-profile .hotel-only-tab {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .benchmark-filter-toggles {
        flex-direction: column;
    }

    .benchmark-filter-selects {
        flex-direction: column;
    }

    .benchmark-match-card {
        flex-direction: column;
        gap: 1rem;
    }

    .match-actions {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
    }
}

/* Mappings Config */
.mappings-config-section {
    padding: 0;
}

.mappings-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.mapping-config-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.mapping-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.mapping-card-header h3 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.mapping-count {
    font-size: var(--text-sm);
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 100px;
}

.mapping-description {
    color: var(--gray-600);
    font-size: var(--text-body);
    margin: 0 0 1.25rem 0;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-config-grid {
        grid-template-columns: 1fr;
    }

    .mappings-cards-grid {
        grid-template-columns: 1fr;
    }}

/* ===========================================
   MY SETTINGS VIEW STYLES
   =========================================== */

.my-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.settings-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.settings-card-header svg {
    color: var(--primary-color);
}

.settings-card-header h3 {
    margin: 0;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.settings-card-body {
    padding: 1.25rem;
}

.settings-role-description {
    margin: 0.5rem 0 1rem 0;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: var(--text-body);
    color: var(--gray-600);
    line-height: 1.5;
}

.settings-card-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.settings-card-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Setup Wizard Card */
.settings-wizard-description {
    margin: 0 0 1rem 0;
    font-size: var(--text-body);
    color: var(--gray-600);
    line-height: 1.5;
}

.settings-wizard-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Setup Wizard Launch Card (Settings view) */
.settings-wizard-launch-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 2rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    max-width: 500px;
    margin: 2rem auto;
}

.settings-wizard-launch-card .settings-wizard-icon {
    color: var(--indigo-500);
    margin-bottom: 1rem;
}

.settings-wizard-launch-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
}

.settings-wizard-launch-card .settings-wizard-description {
    margin: 0 0 1.5rem 0;
    font-size: var(--text-body);
    color: var(--gray-600);
    line-height: 1.6;
}

.settings-wizard-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
    width: 100%;
    max-width: 280px;
}

.settings-wizard-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    color: var(--gray-700);
}

.settings-wizard-item svg {
    color: var(--brand-green-600);
    flex-shrink: 0;
}

.settings-wizard-launch-card .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: var(--text-body);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Status Indicator */
.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 100px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.status-indicator.enabled {
    background: var(--success-light);
    color: var(--brand-green-800);
}

.status-indicator.disabled {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Sessions List */

.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.session-device {
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-800);
}

.session-meta {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.session-current {
    font-size: var(--text-xs);
    background: var(--primary-color);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 100px;
    margin-left: 0.5rem;
}

/* 2FA Setup Styles */
.totp-setup-content {
    text-align: center;
}

.qr-code-container {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin: 1rem 0;
}

.secret-code {
    display: block;
    padding: 0.75rem 1rem;
    background: var(--gray-100);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: var(--text-body);
    word-break: break-all;
    margin: 1rem 0;
}

.totp-setup-content form {
    margin-top: 1.5rem;
    text-align: left;
}

/* ===========================================
   CONSOLIDATED SETTINGS VIEW STYLES
   =========================================== */

/* Settings Layout — sidebar + content */
.settings-layout {
    display: flex;
    min-height: calc(100vh - 100px);
    margin: 0 -2rem -2rem -2rem;
}

.settings-sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    padding: 1rem 0;
    overflow-y: auto;
    position: sticky;
    top: 60px;
    align-self: flex-start;
    height: calc(100vh - 60px);
}

.settings-main {
    flex: 1;
    overflow-y: auto;
}

.settings-content {
    max-width: 820px;
    margin: 0 auto;
    padding: 1.25rem 2rem 4rem;
    background: none;
    border: none;
    border-radius: 0;
}

/* Settings Sidebar Items */
.ss-group {
    padding: 0;
}

.ss-group[data-group="organisation"],
.ss-group[data-group="account"] {
    padding-top: 0;
}

.ss-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-400);
    padding: 0 1.25rem;
    margin-bottom: 0.4rem;
    margin-top: 1rem;
}

.ss-title:first-child {
    margin-top: 0.25rem;
}

.ss-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 1.25rem;
    font-size: 0.8rem;
    color: var(--gray-600);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.1s;
    text-decoration: none;
}

.ss-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.ss-item.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-left-color: #3b82f6;
    font-weight: 600;
}

.ss-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.55;
}

.ss-item.active svg {
    opacity: 1;
    color: #3b82f6;
}

.ss-badge {
    margin-left: auto;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    background: var(--gray-100);
    color: var(--gray-500);
}

.ss-item.active .ss-badge {
    background: #dbeafe;
    color: #1d4ed8;
}

.ss-badge-warn {
    background: #fef3c7;
    color: #92400e;
}

.ss-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 0.5rem 1.25rem;
}

/* Settings Section Visibility */
.settings-section {
    display: none;
}

.settings-section.active {
    display: block;
}

/* (Old settings-placeholder-card, section-header, section-desc, section-divider, info-grid, info-item, info-list removed — replaced by s-card/f-row system) */

/* Division Summary in Settings */
.settings-division-summary h4 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.division-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.division-summary-item .division-name {
    font-weight: var(--font-medium);
    color: var(--gray-800);
    font-size: var(--text-body);
}

.division-summary-item .division-depts {
    font-size: var(--text-body);
    color: var(--gray-500);
}

/* Salary Policy Grid */
.salary-policy-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.salary-policy-header {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    gap: 1rem;
    font-size: var(--text-sm);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0 0.25rem 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.salary-policy-row {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid var(--gray-100);
}

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

.salary-policy-grade {
    font-weight: var(--font-medium);
    color: var(--gray-700);
    font-size: var(--text-body);
}

.salary-policy-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: var(--text-body);
}

.salary-policy-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* ═══════════════════════════════════════════════
   SETTINGS CARD SYSTEM (mockup-matched)
   ═══════════════════════════════════════════════ */

/* Cards */
.s-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    margin-bottom: 1rem;
}
.s-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
}
.s-card-header h3 {
    font-size: 0.875rem;
    margin: 0;
}
.s-card-body {
    padding: 1rem 1.25rem;
}

/* Field rows */
.f-row {
    display: flex;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--gray-50);
}
.f-row:last-child { border-bottom: none; }
.f-label {
    width: 170px;
    font-size: 0.775rem;
    color: var(--gray-500);
    flex-shrink: 0;
}
.f-value {
    flex: 1;
    font-size: 0.825rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.f-edit {
    margin-left: auto;
    font-size: 0.7rem;
    color: #3b82f6;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}
.f-row:hover .f-edit { opacity: 1; }
.f-edit:hover { background: #eff6ff; }

/* Settings badges */
.s-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.45rem;
    border-radius: 6px;
    font-size: 0.675rem;
    font-weight: 600;
}
.s-badge-green { background: #dcfce7; color: #166534; }
.s-badge-amber { background: #fef3c7; color: #92400e; }
.s-badge-red { background: #fee2e2; color: #991b1b; }
.s-badge-blue { background: #dbeafe; color: #1e40af; }
.s-badge-gray { background: #f3f4f6; color: #4b5563; }

/* Ghost button */
.btn-ghost {
    background: none;
    border: none;
    color: #3b82f6;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
}
.btn-ghost:hover { background: #eff6ff; }

/* Stars display */
.s-stars { color: #f59e0b; font-size: 0.85rem; letter-spacing: 1px; }

/* Facility tags */
.fac-tag {
    display: inline-block;
    font-size: 0.675rem;
    padding: 0.15rem 0.5rem;
    background: #f0fdf4;
    color: #166534;
    border-radius: 5px;
    font-weight: 500;
}
.fac-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* Mapping cards */
.map-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: #f9fafb;
    border-radius: 10px;
    margin-bottom: 0.6rem;
}
.map-card:last-child { margin-bottom: 0; }
.map-card h4 { font-size: 0.825rem; margin: 0 0 0.1rem 0; }
.map-card p { font-size: 0.7rem; color: #6b7280; margin: 0; }
.map-meta { display: flex; align-items: center; gap: 0.6rem; }

/* Security rows */
.sec-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0;
    border-bottom: 1px solid #f3f4f6;
}
.sec-row:last-child { border-bottom: none; }
.sec-row h4 { font-size: 0.825rem; margin: 0 0 0.1rem 0; }
.sec-row p { font-size: 0.725rem; color: #6b7280; margin: 0; }

/* Session items */
.sess-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid #f9fafb;
}
.sess-item:last-child { border-bottom: none; }
.sess-icon {
    width: 34px;
    height: 34px;
    background: #f3f4f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sess-icon svg { width: 16px; height: 16px; color: #6b7280; }
.sess-det { flex: 1; }
.sess-dev { font-size: 0.775rem; font-weight: 500; }
.sess-meta { font-size: 0.675rem; color: #9ca3af; }
.sess-cur {
    font-size: 0.625rem;
    background: #dcfce7;
    color: #166534;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 0.4rem;
}

/* Team table */
.t-table { width: 100%; border-collapse: collapse; }
.t-table th {
    text-align: left;
    font-size: 0.675rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid #e5e7eb;
}
.t-table td {
    padding: 0.55rem 0.6rem;
    font-size: 0.8rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}
.t-table tr:last-child td { border-bottom: none; }
.t-user { display: flex; align-items: center; gap: 0.5rem; }

/* ══════════════════════════════════════════════════════════════════════════════
   AVATARS — Family 30 canonical
   Single primitive .avatar + size + color modifiers.
   - Size: .avatar-sm (28), default (32), .avatar-lg (40), .avatar-xl (48)
   - Color: default primary indigo; .avatar-success/-warning/-danger/-info/
     -purple/-neutral
   - Style: solid default (full bg + white text); .avatar-soft (light bg + colored text)
   ══════════════════════════════════════════════════════════════════════════════ */

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    flex-shrink: 0;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
}

/* Size modifiers */
.avatar-sm {
    width: 28px;
    height: 28px;
    font-size: var(--text-xs);
}

.avatar-lg {
    width: 40px;
    height: 40px;
    font-size: var(--text-body);
}

.avatar-xl {
    width: 48px;
    height: 48px;
    font-size: var(--text-base);
}

/* Color modifiers (solid bg + white text by default) */
.avatar-success { background: var(--success); }
.avatar-warning { background: var(--warning); }
.avatar-danger  { background: var(--danger); }
.avatar-info    { background: #3b82f6; }
.avatar-purple  { background: #8b5cf6; }
.avatar-neutral { background: var(--gray-300); color: var(--gray-700); }

/* Soft style — light bg + colored text */
.avatar-soft               { background: var(--gray-100); color: var(--gray-700); }
.avatar-soft.avatar-success { background: var(--brand-green-100); color: var(--brand-green-800); }
.avatar-soft.avatar-warning { background: var(--warning-light);   color: var(--brand-amber-800); }
.avatar-soft.avatar-danger  { background: var(--danger-light);    color: var(--brand-red-800); }
.avatar-soft.avatar-info    { background: #eff6ff;                color: #1e40af; }
.avatar-soft.avatar-purple  { background: #f3e8ff;                color: #6b21a8; }
.avatar-soft:not([class*="avatar-success"]):not([class*="avatar-warning"]):not([class*="avatar-danger"]):not([class*="avatar-info"]):not([class*="avatar-purple"]):not([class*="avatar-neutral"]) {
    background: var(--primary-light);
    color: var(--brand-indigo-800);
}

/* Peer grid */
.peer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.peer-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #f3f4f6;
}
.peer-rank {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1e40af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}
.peer-info h5 { font-size: 0.775rem; margin: 0; }
.peer-meta { font-size: 0.675rem; color: #9ca3af; }
.peer-x {
    margin-left: auto;
    color: #d1d5db;
    cursor: pointer;
    font-size: 1.1rem;
    background: none;
    border: none;
    padding: 0;
}
.peer-x:hover { color: #ef4444; }

/* Threshold rows */
.th-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f9fafb;
}
.th-row:last-child { border-bottom: none; }
.th-name { flex: 1; font-size: 0.8rem; }
.th-vals { display: flex; gap: 0.35rem; }
.th-chip {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 5px;
}
.th-g { background: #dcfce7; color: #166534; }
.th-a { background: #fef3c7; color: #92400e; }
.th-r { background: #fee2e2; color: #991b1b; }

/* Plan card (subscription) */
.plan-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 12px;
    border: 1px solid #bfdbfe;
}
.plan-icon {
    width: 44px;
    height: 44px;
    background: #3b82f6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.plan-icon svg { width: 22px; height: 22px; color: white; }
.plan-info h4 { font-size: 0.9rem; color: #1e3a5f; margin: 0 0 0.15rem 0; }
.plan-info p { font-size: 0.7rem; color: #3b82f6; margin: 0; }

/* Outlet rows */
.out-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: #f9fafb;
    border-radius: 10px;
    margin-bottom: 0.4rem;
}
.out-row:last-child { margin-bottom: 0; }
.out-icon {
    width: 34px;
    height: 34px;
    background: #fef3c7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.out-info { flex: 1; }
.out-info h5 { font-size: 0.8rem; margin: 0; }
.out-info p { font-size: 0.675rem; color: #6b7280; margin: 0; }

/* Settings page header */
.settings-page-header { margin-bottom: 1.25rem; }
.settings-page-header h2 { font-size: 1.15rem; margin: 0 0 0.15rem 0; }
.settings-page-header p { font-size: 0.775rem; color: #6b7280; margin: 0; }

/* Responsive */
@media (max-width: 768px) {
    .settings-main-tabs {
        gap: 0.375rem;
    }

    .settings-main-tab {
        padding: 0.5rem 1rem;
        font-size: var(--text-body);
    }

    .settings-main-tab span {
        display: none;
    }

    .settings-sidebar {
        display: none;
    }

    .settings-layout {
        flex-direction: column;
    }

    .settings-content {
        padding: 1rem;
    }

}

@media (max-width: 480px) {
    .settings-main-tab {
        padding: 0.5rem 0.75rem;
    }

    .settings-main-tab svg {
        width: 18px;
        height: 18px;
    }
}

/* ===========================================
   PASSWORD RESET STYLES
   =========================================== */

.forgot-password-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: var(--primary-color);
    font-size: var(--text-body);
    text-decoration: none;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

.forgot-password-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.forgot-password-header h3 {
    margin: 0.75rem 0 0.5rem 0;
    font-size: var(--text-lg);
    color: var(--gray-800);
}

.forgot-password-header p {
    margin: 0;
    color: var(--gray-600);
    font-size: var(--text-body);
}

.back-to-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: var(--text-body);
    cursor: pointer;
    padding: 0;
    margin-bottom: 1rem;
}

.back-to-login-btn:hover {
    text-decoration: underline;
}

.success-message {
    color: var(--brand-green-600);
    font-size: var(--text-body);
    margin-top: 1rem;
    text-align: center;
}

/* Reset Password Screen */
.reset-error-content,
.reset-success-content {
    text-align: center;
    padding: 1rem;
}

.reset-error-content svg,
.reset-success-content svg {
    margin-bottom: 1rem;
}

.reset-error-content h3,
.reset-success-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: var(--text-lg);
}

.reset-error-content p,
.reset-success-content p {
    color: var(--gray-600);
    margin: 0 0 1.5rem 0;
    font-size: var(--text-body);
}

.reset-subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

/* Password Requirements */
.password-requirements {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.requirements-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    margin: 0 0 0.5rem 0;
}

.password-requirements ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.password-requirements .requirement {
    font-size: var(--text-body);
    color: var(--gray-500);
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.password-requirements .requirement::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-300);
}

.password-requirements .requirement.valid {
    color: var(--brand-green-600);
}

.password-requirements .requirement.valid::before {
    background: var(--brand-green-600);
}

/* ═══════════════════════════════════════════════════════════════════════════
   INSIGHTS OVERVIEW DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════ */

.insights-overview {
    padding: 0;
}

/* Data Context Bar */
.overview-context-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: var(--text-body);
    color: var(--gray-600);
    flex-wrap: wrap;
}

.overview-context-bar .context-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.overview-context-bar .context-item svg {
    width: 14px;
    height: 14px;
    stroke: var(--gray-500);
}

.overview-context-bar .context-value {
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.overview-context-bar .context-divider {
    width: 1px;
    height: 20px;
    background: var(--gray-300);
}

.overview-stale-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--warning-light);
    border: 1px solid var(--brand-amber-500);
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: var(--text-body);
    color: var(--brand-amber-800);
}

.overview-stale-warning svg {
    width: 18px;
    height: 18px;
    stroke: var(--brand-amber-500);
    flex-shrink: 0;
}

.overview-stale-warning a {
    color: var(--brand-amber-800);
    font-weight: var(--font-semibold);
    margin-left: auto;
}

/* Health Score Section */
.overview-health-section {
    background: linear-gradient(135deg, var(--brand-indigo-50) 0%, var(--brand-indigo-100) 100%);
    border: 1px solid var(--brand-indigo-200);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.health-score-display {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.health-score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: white;
}

.health-score-circle.health-green { background: linear-gradient(135deg, var(--brand-green-600) 0%, var(--brand-green-500) 100%); }
.health-score-circle.health-amber { background: linear-gradient(135deg, var(--brand-amber-600) 0%, var(--brand-amber-500) 100%); }
.health-score-circle.health-red { background: linear-gradient(135deg, var(--danger) 0%, var(--brand-red-500) 100%); }

.health-score-label {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.health-score-sublabel {
    font-size: var(--text-body);
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.health-issues-summary {
    display: flex;
    gap: 1rem;
}

/* Key Numbers */
.overview-key-numbers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.key-number-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    text-align: center;
}

.key-number-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}

.key-number-label {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.key-number-trend {
    font-size: var(--text-sm);
    margin-top: 0.35rem;
    font-weight: var(--font-medium);
}

.key-number-trend.trend-up { color: var(--brand-green-600); }
.key-number-trend.trend-down { color: var(--danger); }
.key-number-trend.trend-neutral { color: var(--gray-500); }

/* Priority Alerts & Upcoming Risks */
.overview-alerts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.overview-alerts-section,
.overview-risks-section {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.overview-section-title {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--gray-700);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.overview-section-title svg {
    width: 16px;
    height: 16px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.15s;
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: 6px;
}

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

.alert-item:hover {
    background: var(--gray-50);
}

.alert-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.alert-indicator.red { background: var(--danger); }
.alert-indicator.amber { background: var(--warning); }
.alert-indicator.green { background: var(--brand-green-600); }

.alert-text {
    flex: 1;
    font-size: var(--text-body);
    color: var(--gray-700);
}

.alert-value {
    font-weight: var(--font-semibold);
    color: var(--gray-800);
}

.alert-action {
    font-size: var(--text-sm);
    color: var(--primary-color);
    font-weight: var(--font-medium);
}

.risk-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: var(--text-body);
    color: var(--gray-700);
}

.risk-item svg {
    width: 16px;
    height: 16px;
    stroke: var(--brand-amber-500);
    flex-shrink: 0;
    margin-top: 1px;
}

/* Metrics Grid */
.overview-metrics-section {
    margin-bottom: 1.25rem;
}

.overview-metrics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.overview-metrics-header h4 {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--gray-700);
    margin: 0;
}

.metrics-category-pills {
    display: flex;
    gap: 0.5rem;
}

.metrics-category-pill {
    padding: 0.35rem 0.75rem;
    font-size: var(--text-sm);
    border-radius: 15px;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.15s;
}

.metrics-category-pill.active,
.metrics-category-pill:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.overview-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.metric-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.metric-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1);
    transform: translateY(-2px);
}

.metric-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.metric-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.metric-status-dot.green { background: var(--rag-green); }
.metric-status-dot.amber { background: var(--rag-amber); }
.metric-status-dot.red { background: var(--rag-red); }

.metric-card-label {
    font-size: var(--text-sm);
    color: var(--gray-600);
    font-weight: var(--font-medium);
    line-height: 1.3;
}

.metric-card-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-800);
    margin-bottom: 0.35rem;
}

.metric-card-sparkline {
    height: 24px;
    margin-bottom: 0.35rem;
}

.metric-card-sparkline svg {
    width: 100%;
    height: 100%;
}

.metric-card-trend {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}

.metric-card-trend.trend-up { color: var(--brand-green-600); }
.metric-card-trend.trend-down { color: var(--danger); }
.metric-card-trend.trend-neutral { color: var(--gray-500); }
.metric-card-trend.trend-up-bad { color: var(--danger); }
.metric-card-trend.trend-down-good { color: var(--brand-green-600); }

/* Quick Wins Section */
.overview-quickwins-section {
    background: linear-gradient(135deg, var(--brand-green-50) 0%, var(--brand-green-100) 100%);
    border: 1px solid #86efac;
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.quickwin-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: var(--text-body);
    color: var(--gray-700);
}

.quickwin-item svg {
    width: 18px;
    height: 18px;
    stroke: #059669;
    flex-shrink: 0;
}

.quickwin-metric {
    font-weight: var(--font-semibold);
    color: var(--brand-green-600);
}

/* Insight Metric Modal */
.insight-modal-status {
    text-align: center;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: 10px;
    margin-bottom: 1.25rem;
}

.insight-modal-status-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.insight-modal-status-icon.green { background: var(--success-light); color: var(--brand-green-600); }
.insight-modal-status-icon.amber { background: var(--warning-light); color: var(--brand-amber-600); }
.insight-modal-status-icon.red { background: var(--danger-light); color: var(--danger); }

.insight-modal-status-icon svg {
    width: 24px;
    height: 24px;
}

.insight-modal-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}

.insight-modal-label {
    font-size: var(--text-body);
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.insight-modal-trend {
    font-size: var(--text-body);
    margin-top: 0.5rem;
    font-weight: var(--font-medium);
}

.insight-modal-threshold {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

.insight-modal-section {
    margin-bottom: 1.25rem;
}

.insight-modal-section h5 {
    font-size: var(--text-body);
    font-weight: var(--font-bold);
    color: var(--gray-700);
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.insight-modal-section ul {
    margin: 0;
    padding-left: 1.25rem;
}

.insight-modal-section li {
    font-size: var(--text-body);
    color: var(--gray-700);
    margin-bottom: 0.4rem;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 1200px) {
    .overview-metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .overview-alerts-grid {
        grid-template-columns: 1fr;
    }

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

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

@media (max-width: 768px) {
    .overview-health-section {
        flex-direction: column;
        text-align: center;
    }

    .health-issues-summary {
        justify-content: center;
    }

    .overview-key-numbers {
        grid-template-columns: 1fr 1fr;
    }

    .overview-metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .my-settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-card-actions {
        flex-direction: column;
    }

    .settings-card-actions .btn {
        width: 100%;
    }
}

/* Kept from the old setup wizard styles (removed 2026-10-12): still used. */
.grade-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: var(--text-base);
}

/* ========================================
   Settings Manager Structure Styles
   ======================================== */

.settings-managers-error {
    text-align: center;
    padding: 1.5rem;
}

.settings-managers-section {
    margin-bottom: 1.5rem;
}

.settings-managers-section-title {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-100);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.settings-managers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

/* ====================================================
   NEW: Clean list + override pill (replaces grid-of-cards)
   ==================================================== */

.settings-managers-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.settings-managers-section-stats {
    font-size: 12px;
    color: var(--gray-400);
}

.settings-managers-list {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: visible; /* allow popover to escape */
}

.settings-manager-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    position: relative;
}
.settings-manager-row:last-child { border-bottom: none; }
.settings-manager-row.changed { animation: settings-manager-flash 1.2s ease; }
@keyframes settings-manager-flash {
    0% { background: var(--white); }
    20% { background: #fef3c7; }
    100% { background: var(--white); }
}

.settings-manager-row .row-scope {
    flex: 0 0 180px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.settings-manager-row .row-scope-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-900);
}
.settings-manager-row .row-scope-meta {
    font-size: 11px;
    font-weight: 400;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.settings-manager-row .row-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color, #4f46e5);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
    flex-shrink: 0;
}

.settings-manager-row .row-person {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.settings-manager-row .row-person-name {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-900);
}
.settings-manager-row .row-person-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.settings-manager-row .row-person-meta {
    font-size: 11px;
    color: var(--gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-manager-row.manual .row-person-name {
    color: var(--primary-color, #4f46e5);
}
.settings-manager-row .row-lock-icon {
    width: 11px;
    height: 11px;
    color: var(--primary-color, #4f46e5);
    flex-shrink: 0;
    opacity: 0.85;
}

.settings-manager-row .row-confidence {
    font-size: 11px;
    font-weight: 600;
    padding: 0.125rem 0.4rem;
    border-radius: 8px;
    flex-shrink: 0;
}
.settings-manager-row .row-confidence.high   { background: #dcfce7; color: #15803d; }
.settings-manager-row .row-confidence.medium { background: #fef3c7; color: #92400e; }
.settings-manager-row .row-confidence.low    { background: #fee2e2; color: #991b1b; }
.settings-manager-row.manual .row-confidence { display: none; }

/* The circular override pill */
.settings-manager-row .row-override-pill {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--white);
    border: 1.5px solid var(--gray-300);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}
.settings-manager-row .row-override-pill:hover,
.settings-manager-row .row-override-pill.active {
    border-color: var(--primary-color, #4f46e5);
    color: var(--primary-color, #4f46e5);
    background: #eef2ff;
}
.settings-manager-row .row-override-pill svg { width: 13px; height: 13px; }

/* GM row gets the indigo gradient treatment */
.settings-manager-row.gm-row {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: var(--white);
    border: none;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
}
.settings-manager-row.gm-row .row-scope-name { color: var(--white); }
.settings-manager-row.gm-row .row-scope-meta { color: rgba(255, 255, 255, 0.7); }
.settings-manager-row.gm-row .row-person-name { color: var(--white); }
.settings-manager-row.gm-row .row-person-meta { color: rgba(255, 255, 255, 0.8); }
.settings-manager-row.gm-row .row-avatar { background: var(--white); color: var(--primary-color, #4f46e5); }
.settings-manager-row.gm-row .row-lock-icon { color: var(--white); }
.settings-manager-row.gm-row .row-confidence { background: rgba(255, 255, 255, 0.2); color: var(--white); }
.settings-manager-row.gm-row .row-override-pill {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--white);
}
.settings-manager-row.gm-row .row-override-pill:hover,
.settings-manager-row.gm-row .row-override-pill.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: var(--white);
}

/* Mobile: bump pill to 36px tap target */
@media (max-width: 640px) {
    .settings-manager-row .row-override-pill {
        width: 36px;
        height: 36px;
    }
    .settings-manager-row .row-override-pill svg { width: 15px; height: 15px; }
    .settings-manager-row .row-scope { flex: 0 0 130px; }
}

/* Popover (fixed-positioned, appended to body) */
.manager-override-popover {
    position: fixed;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 0.75rem;
    width: 340px;
    max-width: calc(100vw - 1rem);
    z-index: 220;
    color: var(--gray-900);
}

.manager-override-popover .popover-search {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 13px;
    background-color: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
    margin-bottom: 0.5rem;
}
.manager-override-popover .popover-search:focus {
    outline: none;
    border-color: var(--primary-color, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.manager-override-popover .popover-results {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-50);
}
.manager-override-popover .popover-result {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.1s;
}
.manager-override-popover .popover-result:last-child { border-bottom: none; }
.manager-override-popover .popover-result:hover { background: var(--white); }
.manager-override-popover .popover-result-info { flex: 1; min-width: 0; }
.manager-override-popover .popover-result-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.manager-override-popover .popover-result-meta {
    font-size: 11px;
    color: var(--gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.manager-override-popover .popover-result-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-color, #4f46e5);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 10px;
    flex-shrink: 0;
}
.manager-override-popover .popover-empty {
    padding: 1rem;
    text-align: center;
    color: var(--gray-400);
    font-size: 12px;
    font-style: italic;
}

.manager-override-popover .popover-footer {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--gray-200);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.manager-override-popover .popover-footer-btn {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    padding: 0.4rem;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.15s;
}
.manager-override-popover .popover-footer-btn:hover {
    color: var(--gray-900);
    border-color: var(--gray-400);
    background: var(--gray-50);
}
.manager-override-popover .popover-footer-btn.danger:hover {
    color: #dc2626;
    border-color: #dc2626;
    background: #fef2f2;
}
.manager-override-popover .popover-footer-btn svg { width: 12px; height: 12px; }

.settings-manager-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.75rem;
}

.settings-manager-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.settings-manager-scope-name {
    font-weight: var(--font-semibold);
    font-size: var(--text-body);
    color: var(--gray-800);
}

.settings-manager-selection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.settings-manager-current {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.settings-manager-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.settings-manager-name {
    font-weight: var(--font-semibold);
    font-size: var(--text-body);
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-manager-position {
    font-size: var(--text-xs);
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-manager-meta {
    font-size: var(--text-xs);
    color: var(--gray-400);
}

.settings-manager-confidence {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.15rem 0.4rem;
    border-radius: 8px;
    flex-shrink: 0;
}

.settings-manager-confidence.high {
    background: var(--success-lighter);
    color: var(--brand-green-700);
}

.settings-manager-confidence.medium {
    background: var(--warning-lighter);
    color: var(--brand-amber-700);
}

.settings-manager-confidence.low {
    background: var(--danger-lighter);
    color: var(--brand-red-700);
}

.settings-manager-none {
    color: var(--gray-400);
    font-size: var(--text-body);
    font-style: italic;
}

.settings-manager-edit-btn {
    flex-shrink: 0;
}

/* Settings Manager Editor Modal */
.settings-manager-editor {
    min-width: 350px;
}

.settings-manager-editor h4 {
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    margin: 0 0 1rem 0;
    color: var(--gray-800);
}

.settings-manager-none-option {
    padding: 0.5rem 0.75rem;
    border-style: dashed;
    justify-content: center;
}

.settings-manager-none-label {
    font-size: var(--text-body);
    color: var(--gray-500);
}

/* Settings Manager Search */
.settings-manager-search-wrapper {
    position: relative;
    margin: 0.75rem 0;
}

.settings-manager-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
}

.settings-manager-search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.1s;
}

.settings-manager-search-item:hover {
    background: var(--gray-50);
}

.settings-manager-search-item:not(:last-child) {
    border-bottom: 1px solid var(--gray-100);
}

.settings-manager-search-item .settings-manager-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.settings-manager-search-item .settings-manager-name {
    font-size: var(--text-sm);
}

.settings-manager-search-item .settings-manager-position {
    font-size: 0.75rem;
}

.settings-manager-search-empty {
    padding: 0.75rem;
    text-align: center;
    color: var(--gray-400);
    font-size: var(--text-sm);
}

.settings-manager-search-selected {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: #059669;
    font-size: var(--text-sm);
    font-weight: 500;
}

.settings-manager-search-custom {
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.settings-manager-search-custom .settings-manager-position {
    font-style: italic;
}

/* Settings GM Section */
.settings-gm-section {
    background: linear-gradient(135deg, var(--primary-lighter) 0%, #f0f4ff 100%);
    border: 1px solid var(--primary-light);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.settings-gm-section .settings-managers-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    border-bottom-color: var(--primary-light);
    text-transform: none;
    letter-spacing: normal;
    font-size: var(--text-body);
}

.settings-gm-section .settings-managers-section-title svg {
    stroke: var(--primary);
}

.settings-gm-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.settings-gm-editor .settings-gm-manual-divider {
    text-align: center;
    margin: 1.25rem 0;
    color: var(--gray-400);
    font-size: var(--text-body);
    position: relative;
}

.settings-gm-editor .settings-gm-manual-divider::before,
.settings-gm-editor .settings-gm-manual-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--gray-200);
}

.settings-gm-editor .settings-gm-manual-divider::before {
    left: 0;
}

.settings-gm-editor .settings-gm-manual-divider::after {
    right: 0;
}

.settings-gm-editor .settings-gm-manual-input {
    margin-bottom: 1.5rem;
}

.settings-gm-editor .settings-gm-manual-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
    margin-bottom: 0.35rem;
}

.settings-gm-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Upload Zone */

.upload-zone-icon {
    margin-bottom: 1rem;
}

.upload-zone-text {
    font-size: var(--text-base);
    color: var(--gray-700);
    margin-bottom: 0.25rem;
}

.upload-zone-hint {
    font-size: var(--text-body);
    color: var(--gray-400);
}

.upload-progress {
    text-align: center;
}

/* Team Form */

/* Invites List */

.invite-email {
    font-size: var(--text-body);
    color: var(--gray-700);
}

/* Summary */

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
}

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

.summary-item.completed {
    background: var(--success-lighter);
}

.summary-item.skipped {
    background: #fefce8;
}

.summary-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-body);
    flex-shrink: 0;
}

.summary-item.completed .summary-icon {
    background: var(--brand-green-500);
    color: white;
}

.summary-item.skipped .summary-icon {
    background: var(--brand-amber-400);
    color: white;
}

.summary-label {
    flex: 1;
    font-size: var(--text-body);
    color: var(--gray-700);
}

.summary-status {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.summary-item.completed .summary-status {
    color: var(--brand-green-600);
}

.summary-item.skipped .summary-status {
    color: var(--brand-amber-600);
}

/* Next Steps */

/* ============================================
   Billing & Invoicing Styles
   ============================================ */

/* Billing tab content - hidden by default, shown when active */
#billing-view .tab-content {
    display: none;
}

#billing-view .tab-content.active {
    display: block;
}

/* Billing Toolbar */
.billing-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.billing-filters {
    display: flex;
    gap: 0.75rem;
    flex: 1;
}

/* Table panel (.table-panel; .billing-table-wrapper is Billing's older name for it):
   a white bordered panel round a .data-table, scrolling sideways on a narrow screen */
.billing-table-wrapper,
.table-panel {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    overflow-x: auto;
    width: 100%;
}

/* An empty state or callout inside a table wrapper keeps the wrapper's padding */
.billing-table-wrapper > .empty-state,
.billing-table-wrapper > .card-callout,
.billing-table-wrapper > .wave-loader,
.table-panel > .empty-state,
.table-panel > .card-callout,
.table-panel > .wave-loader {
    margin: 1rem;
}

.billing-filters {
    flex-wrap: wrap;
    align-items: center;
}

.billing-filters .search-bar {
    min-width: 220px;
    max-width: 320px;
    flex: 1;
}

/* The status pills keep their words on one line; the search takes what is left */
.billing-filters .filter-pill {
    white-space: nowrap;
}

#invoice-status-pills {
    flex: 0 0 auto;
    max-width: 100%;
    overflow-x: auto;
}

.billing-account-filter {
    margin-bottom: 0.75rem;
}

/* Figures per currency (never summed across currencies) */
.billing-stats {
    margin-bottom: 1.5rem;
}

.billing-stats-currency + .billing-stats-currency {
    margin-top: 1rem;
}

.billing-stats-label {
    margin: 0 0 0.5rem;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-600);
}

/* Invoice window: the facts are .f-row rows above the line items */
.billing-detail-rows {
    margin-bottom: 1.25rem;
}

.billing-account-list {
    margin: 0.25rem 0 1rem;
    padding-left: 1.25rem;
    font-size: var(--text-body);
    color: var(--gray-700);
}

#subscription-notice > *,
#settings-sub-notice > * {
    margin-bottom: 1rem;
}

/* A card's actions sit in its header on the right, as on Settings' cards */
.s-card-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}
.s-card-header-actions[hidden] {
    display: none;
}

/* An action inside a callout (Try again, Reactivate, Undo) is a button on its own line */
.billing-callout-actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* The cancel confirm's two choices sit apart from the sentences around them */
#confirm-html-body .radio-stack {
    margin: 0.75rem 0;
}

/* Billing sits on the gray page, not a white drill: its strip tiles are white so they read */
#billing-stats .l1-metric,
#clients-figures .l1-metric {   /* id: the strip's own rule comes later in the file */
    background: var(--white);
    border-color: var(--gray-200);
}

/* A quiet aside after a value: "· on the first invoice", "Not given" (.text-quiet;
   .billing-muted is Billing's older name for it) */
.billing-muted,
.text-quiet {
    color: var(--gray-500);
}

/* The refetch pill sits over the table while it scrolls sideways */
.billing-table-wrapper.salary-card-refetching,
.table-panel.salary-card-refetching {
    min-height: 4rem;
}

#invoice-detail-actions {
    flex-wrap: wrap;
}

/* ============================================
   Clients (the superuser Accounts view; docs/accounts-redesign-plan.md)
   Approved elements only; the layout below is grid/flex around them.
   ============================================ */
.clients-figures { margin-bottom: 1.25rem; }
.clients-toolbar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1rem; }
#clients-search-slot { flex: 1; min-width: 220px; max-width: 320px; }
.clients-toolbar .btn-primary { margin-left: auto; }
.clients-toolbar .filter-pill { white-space: nowrap; }

/* The approved strip's link variant (.l1-metric--link): a figure that filters the list */
.clients-figures .l1-metric--link .l1-metric-subtext a,
.billing-stats .l1-metric--link .l1-metric-subtext a { color: var(--primary-color); text-decoration: none; }
.clients-figures .l1-metric--link .l1-metric-subtext a:hover,
.clients-figures .l1-metric--link .l1-metric-subtext a:focus-visible { text-decoration: underline; }

.client-record-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0.25rem 0 0.75rem; }
.client-record-head h3 { margin: 0; font-size: var(--text-lg); }
.client-tab-panel { margin-top: 1rem; }
#client-record #account-tab-subscription.active { margin-top: 1rem; }
.client-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.client-table-wrap { overflow-x: auto; }
.client-status-sentence { margin: 0 0 0.25rem; color: var(--gray-800); }
.client-status-note { margin: 0.5rem 0 0; font-size: var(--text-sm); color: var(--gray-500); }
.client-contact { display: inline-flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: baseline; }
@media (max-width: 860px) {
    .client-grid { grid-template-columns: 1fr; }
}

/* Row action — approved 2026-10-14 (docs/ui-elements.md § Clients): a
   .btn-outline.btn-sm at the end of an .f-row, inside .f-value. The older
   .f-edit link shows only on hover. */
.f-row-action { margin-left: auto; flex-shrink: 0; }

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

    .billing-filters .search-bar {
        max-width: none;
    }

}

.billing-table-wrapper .data-table,
.table-panel .data-table {
    margin: 0;
    border: none;
    border-radius: 0;
    width: 100%;
}

.billing-table-wrapper .data-table th,
.table-panel .data-table th {
    background: var(--gray-50);
    border-top: none;
}

.billing-table-wrapper .data-table th:first-child,
.billing-table-wrapper .data-table td:first-child,
.table-panel .data-table th:first-child,
.table-panel .data-table td:first-child {
    padding-left: 1.25rem;
}

.billing-table-wrapper .data-table th:last-child,
.billing-table-wrapper .data-table td:last-child,
.table-panel .data-table th:last-child,
.table-panel .data-table td:last-child {
    padding-right: 1.25rem;
}

.empty-cell {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
    font-size: var(--text-body);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}

.stat-label {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-900);
}

.stat-value.stat-danger {
    color: var(--danger-color);
}

/* Invoice line items in modal */

/* Cluster tier field visibility */
.cluster-tier-only {
    display: none;
}

#pricing-plan-per-hotel-row .form-hint {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Delete Plan Modal */

#migrate-accounts-btn {
    margin-top: 0.75rem;
}

/* Invoice Detail Modal */

/* Button icon variant */
.btn-icon {
    padding: 0.4rem;
    min-width: auto;
    background: transparent;
    border: 1px solid transparent;
}

.btn-icon:hover {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

.btn-icon.btn-danger:hover {
    background: var(--danger-light);
    color: var(--danger-color);
}

/* Small button */
.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: var(--text-body);
}

/* Modal medium size */
/* Modal size utility classes (applied to .modal element) */
.modal-medium .modal-content {
    width: 60vw;
    max-width: 60vw;
}

.modal-large .modal-content {
    width: 80vw;
    max-width: 80vw;
}

/* ========================================
   Mobile & Tablet Optimization
   Comprehensive responsive styles for mobile (≤480px) and tablet (≤768px)
   ======================================== */

/* -----------------------------------------
   Table Responsive Wrapper
   ----------------------------------------- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
}

/* -----------------------------------------
   Utility Classes
   ----------------------------------------- */
/* Hide on mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Mobile-only full width */
@media (max-width: 768px) {
    .mobile-full-width {
        width: 100% !important;
    }
}

/* -----------------------------------------
   Phase 1: Analytics Grid Responsiveness
   ----------------------------------------- */
@media (max-width: 768px) {
    /* Turnover metrics - already has 1fr override, keeping for reference */

    /* Retirement tabs - already has 2 cols override at 768px */

    /* Attrition tabs */
    .attrition-tabs {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Performance metrics grid */
    .perf-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Month buttons grid - more columns on tablet */
    .month-buttons-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.35rem;
    }

    .month-btn {
        padding: 0.5rem 0.25rem;
        font-size: var(--text-sm);
    }

    .month-btn .data-indicator {
        font-size: var(--text-xs);
    }

    /* Mappings cards grid */
    .mappings-cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    /* Retirement tabs - single column */
    .retirement-tabs {
        grid-template-columns: 1fr;
    }

    /* Attrition tabs - single column */
    .attrition-tabs {
        grid-template-columns: 1fr;
    }

    /* Overview metrics - single column (already set at 768px) */

    /* Overview key numbers - single column */
    .overview-key-numbers {
        grid-template-columns: 1fr;
    }

    /* Performance metrics - single column */
    .perf-metrics-grid {
        grid-template-columns: 1fr;
    }

    /* Month buttons grid - 4 columns on small mobile */
    .month-buttons-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.25rem;
    }

    .month-btn {
        padding: 0.4rem 0.2rem;
        font-size: var(--text-xs);
    }
}

/* -----------------------------------------
   Phase 2: Modal Optimization
   ----------------------------------------- */
@media (max-width: 768px) {
    /* Modal sizing improvements - full width on mobile */
    .modal-content {
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        margin: 0.5rem;
        border-radius: 0.5rem;
    }

    .modal-content.modal-sm,
    .modal-content.modal-small {
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
    }

    .modal-content.modal-large,
    .modal-content.modal-lg,
    .modal-content.modal-xl {
        width: calc(100vw - 1rem);
        max-width: calc(100vw - 1rem);
    }

    .modal-body {
        max-height: calc(100vh - 10rem);
        overflow-y: auto;
    }

    /* Form section collapsible */
    .form-section-collapsible.collapsed .form-section-content {
        display: none;
    }

    .form-section-header {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem;
        background: var(--gray-50);
        border-radius: 0.25rem;
        margin-bottom: 0.5rem;
    }

    .form-section-header h4 {
        margin: 0;
        font-size: var(--text-body);
    }

    .form-section-header .collapse-icon {
        width: 20px;
        height: 20px;
        transition: transform 0.2s;
    }

    .form-section-collapsible.collapsed .collapse-icon {
        transform: rotate(-90deg);
    }
}

@media (max-width: 480px) {
    /* Full screen modals on small mobile */
    .modal-content,
    .modal-content.modal-large,
    .modal-content.modal-sm {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }

    .modal-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background: white;
        border-bottom: 1px solid var(--gray-200);
    }

    /* Modal footer button stacking */
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* -----------------------------------------
   Phase 3: Data Table Mobile Treatment
   ----------------------------------------- */
@media (max-width: 768px) {
    /* Table responsive wrapper styling */
    .table-responsive {
        border: 1px solid var(--gray-200);
        border-radius: 0.25rem;
        margin: 0 -0.5rem;
        padding: 0;
    }

    /* Force horizontal scroll for data tables */
    .table-responsive .data-table {
        min-width: 600px;
    }

    /* Compact table styling */
    .data-table th,
    .data-table td {
        padding: 0.5rem;
        font-size: var(--text-sm);
    }

    .data-table .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: var(--text-xs);
    }

    /* Status badges smaller */
    .data-table .status-badge {
        font-size: var(--text-xs);
        padding: 0.15rem 0.4rem;
    }
}

/* -----------------------------------------
   Phase 4: Touch Target Sizing
   ----------------------------------------- */
@media (max-width: 768px) {
    /* Form inputs - min 44px touch target */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    select,
    textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Buttons - min 44px touch target */
    .btn {
        min-height: 44px;
        padding: 0.625rem 1rem;
    }

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

    /* Checkboxes and radios - larger touch targets */
    .facility-checkbox label,
    input[type="checkbox"] + label,
    input[type="radio"] + label {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    input[type="checkbox"],
    input[type="radio"] {
        width: 20px;
        height: 20px;
        margin-right: 0.5rem;
    }

    /* Nav links */
    .nav-link {
        min-height: 44px;
    }
}

/* -----------------------------------------
   Phase 5: Tab Interface Optimization
   ----------------------------------------- */
@media (max-width: 768px) {
    /* Generic tabs - horizontal scroll */
    .security-tabs,
    .hotel-sub-tabs,
    .ticket-filter-tabs,
    .profile-type-tabs,
    .hotel-data-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 0;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .security-tabs::-webkit-scrollbar,
    .hotel-sub-tabs::-webkit-scrollbar,
    .ticket-filter-tabs::-webkit-scrollbar,
    .profile-type-tabs::-webkit-scrollbar,
    .hotel-data-tabs::-webkit-scrollbar,
    .results-tabs::-webkit-scrollbar {
        display: none;
    }

    /* Tab buttons */
    .account-tab,
    .security-tab,
    .hotel-sub-tab,
    .ticket-filter-tab,
    .profile-type-tab,
    .hotel-data-tab,
    .results-tab {
        flex-shrink: 0;
        white-space: nowrap;
        font-size: var(--text-body);
        padding: 0.5rem 0.75rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .account-tab,
    .security-tab,
    .hotel-sub-tab,
    .ticket-filter-tab {
        font-size: var(--text-sm);
        padding: 0.5rem;
    }
}

/* -----------------------------------------
   Phase 6: View Header & Action Buttons
   ----------------------------------------- */
@media (max-width: 768px) {
    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .view-header h2 {
        font-size: var(--text-lg);
    }

    .view-header .btn {
        width: 100%;
    }

    /* Search + filter rows */

    .accounts-search-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .accounts-search-row input,
    .accounts-search-row select {
        width: 100%;
    }

    /* Filter groups */
    .accounts-filter-group {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .accounts-filter-group select {
        width: 100%;
    }
}

/* -----------------------------------------
   Phase 7: Benchmark Management Modal
   ----------------------------------------- */
@media (max-width: 768px) {
    /* Benchmark filters already handled at 768px breakpoint */

    /* Benchmark tags */
    .modal-benchmark-tags{
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .modal-benchmark-tags .benchmark-peer-tag{
        font-size: var(--text-xs);
        padding: 0.15rem 0.35rem;
    }

    /* Current benchmarks section */
    .current-benchmarks-grid {
        grid-template-columns: 1fr;
    }

    /* Benchmark matches grid */
    .benchmark-matches-grid {
        grid-template-columns: 1fr;
    }
}

/* -----------------------------------------
   Phase 8: Charts & Visualizations
   ----------------------------------------- */
@media (max-width: 768px) {
    .chart-container {
        min-height: 250px;
        max-height: 300px;
    }

    /* Ensure canvas responsive */
    .chart-container canvas {
        max-width: 100%;
        height: auto !important;
    }

    /* Chart legends - smaller on mobile */
    .chart-legend {
        font-size: var(--text-sm);
    }
}

@media (max-width: 480px) {
    .chart-container {
        min-height: 200px;
        max-height: 250px;
    }
}

/* -----------------------------------------
   Phase 10: Learning Centre Optimization
   ----------------------------------------- */
@media (max-width: 768px) {
    .guide-card-body {
        padding: 1rem;
    }

    .guide-table {
        display: block;
        overflow-x: auto;
    }

    .guide-metrics-grid {
        grid-template-columns: 1fr;
    }

    .guide-steps {
        flex-direction: column;
    }

    .guide-diagram svg {
        max-width: 100%;
        height: auto;
    }

    /* Learning category headers */
    .learning-category-header {
        padding: 0.75rem;
    }

    .learning-category-header h3 {
        font-size: var(--text-base);
    }
}

/* -----------------------------------------
   Phase 11: Login & Password Reset Screens
   ----------------------------------------- */
@media (max-width: 480px) {
    .login-card {
        margin: 1rem;
        padding: 1.5rem;
        border-radius: 0.5rem;
    }

    .login-card h1 {
        font-size: var(--text-xl);
    }

    .login-footer {
        flex-direction: column;
        gap: 0.5rem;
    }

    .login-footer a {
        text-align: center;
    }
}

/* -----------------------------------------
   Additional Mobile Optimizations
   ----------------------------------------- */

/* Insights selectors mobile override removed — now in top bar */

/* Analytics card responsiveness */
@media (max-width: 768px) {
    .analytics-card,
    .insight-card {
        padding: 1rem;
    }

    .analytics-card-header,
    .insight-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .analytics-card-header h3,
    .insight-card-header h3 {
        font-size: var(--text-base);
    }

    .analytics-card-actions,
    .insight-card-actions {
        width: 100%;
        display: flex;
        gap: 0.5rem;
    }

    .analytics-card-actions .btn,
    .insight-card-actions .btn {
        flex: 1;
        font-size: var(--text-sm);
    }
}

/* Support ticket cards mobile */
@media (max-width: 768px) {
    .support-ticket-card,
    .my-ticket-card {
        padding: 1rem;
    }

    .ticket-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .ticket-meta {
        flex-wrap: wrap;
    }
}

/* Stats cards mobile */
@media (max-width: 768px) {
    .stats-grid,
    .overview-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid,
    .overview-stats {
        grid-template-columns: 1fr;
    }
}

/* Session cards mobile */
@media (max-width: 768px) {

    .session-info {
        width: 100%;
    }
}

/* Audit log table mobile */
@media (max-width: 768px) {
    .audit-filters {
        flex-direction: column;
        gap: 0.5rem;
    }

    .audit-filters select,
    .audit-filters input {
        width: 100%;
    }
}

/* Impersonation banner mobile */
@media (max-width: 768px) {
    .impersonation-banner {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .impersonation-banner .btn {
        width: 100%;
    }
}

/* Profile completeness modal mobile */
@media (max-width: 768px) {
    .profile-completeness-list {
        padding: 0.75rem;
    }

    .completeness-item {
        padding: 0.5rem 0;
    }
}

/* Drilldown modal mobile */
@media (max-width: 768px) {
    .drilldown-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .drilldown-filters {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .drilldown-filters select {
        width: 100%;
    }
}

/* Recommendation popup mobile */
@media (max-width: 768px) {
    .attrition-rec-content {
        padding: 0.75rem;
    }

    .attrition-rec-item {
        padding: 0.75rem;
    }

    .attrition-rec-heading {
        font-size: var(--text-body);
    }

    .attrition-rec-summary-text,
    .attrition-rec-item-text {
        font-size: var(--text-sm);
    }
}

/* Data upload section mobile */
@media (max-width: 768px) {
    .upload-zone {
        padding: 1.5rem 1rem;
    }

    .upload-zone h3 {
        font-size: var(--text-base);
    }

    .upload-zone p {
        font-size: var(--text-body);
    }

    .upload-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .upload-actions .btn {
        width: 100%;
    }
}

/* Column mapping wizard mobile */
@media (max-width: 768px) {
    .mapping-wizard-content {
        padding: 1rem;
    }
}

/* Helpdesk form mobile */
@media (max-width: 768px) {
    .support-ticket-form-card {
        padding: 1rem;
    }

    .ticket-form-actions {
        flex-direction: column;
    }

    .ticket-form-actions .btn {
        width: 100%;
    }
}

/* Accounts table mobile */

/* My profile tabs mobile - form optimization */
@media (max-width: 768px) {

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

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

/* Insights card grid mobile */
@media (max-width: 768px) {
    .insights-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Benchmark view mobile */

/* ============================================
   CARD HIERARCHY DESIGN SYSTEM
   L1 = Key Metrics, L2 = Collapsible Sections, L3 = Callouts
   ============================================ */

/* === L1: Metrics Row === */
.card-metrics-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.card-metric {
    flex: 1;
    min-width: 100px;
    padding: 0.75rem 1rem;
    background: var(--gray-100);
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--gray-200);
}

/* Canonical L1 metric card typography (spec lock 2026-06-22).
   Three-line hierarchy: VALUE / Label / subtext.
   - Value: large, bold, primary colour
   - Label: clear secondary line, sentence case (no uppercase, no <br>)
   - Subtext/sublabel: small muted line for functional context
   `display: block` is set so the rule works regardless of whether cards use
   <span> or <div> children — some cards do one, some the other.
   See look-and-feel SKILL.md §2.2 + docs/ui-elements.md "L1 metric card". */
.card-metric-value {
    display: block;
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--gray-900);
    line-height: 1.2;
}

.card-metric-label {
    display: block;
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    color: var(--gray-700);
    line-height: 1.3;
    margin-top: 0.35rem;
    /* No uppercase, no letter-spacing — sentence case for clarity. */
}

.card-metric-sublabel,
.card-metric-subtext {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-normal);
    color: var(--gray-500);
    line-height: 1.4;
    margin-top: 0.15rem;
}

/* Metric status variants — token-aliased, no raw hex. */
.card-metric.metric-green .card-metric-value { color: var(--brand-green-500); }
.card-metric.metric-amber .card-metric-value { color: var(--brand-amber-500); }
.card-metric.metric-red   .card-metric-value { color: var(--brand-red-500); }
.card-metric.metric-female .card-metric-value { color: var(--gender-female); }
.card-metric.metric-male   .card-metric-value { color: var(--gender-male); }

/* Turnover metrics row - two-line centered labels */
.turnover-metrics-row .card-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}

.turnover-metrics-row .card-metric-label {
    line-height: 1.3;
    text-align: center;
}

/* Attrition card metrics row - consistent height */
.attrition-metrics-row .card-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}

.attrition-metrics-row .card-metric-label {
    line-height: 1.3;
    text-align: center;
}

/* EoS metrics row - consistent with turnover */
.eos-metrics-row .card-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 90px;
}

.eos-metrics-row .card-metric-label {
    line-height: 1.3;
    text-align: center;
}

.eos-card-body {
    padding: 1rem;
}

.eos-card-body .card-metrics-row {
    margin-bottom: 1rem;
}

/* Compression card metrics row - consistent height */
.compression-metrics-row .card-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}

.compression-metrics-row .card-metric-label {
    line-height: 1.3;
    text-align: center;
}

/* (Old `.card-metric-subtext` override removed 2026-06-22 — see canonical
   rule above that consolidates .card-metric-sublabel + .card-metric-subtext.) */

/* Metric card tooltips */
.card-metric.has-tooltip {
    position: relative;
    cursor: help;
}

/* Deprecated 2026-06-12: .metric-tooltip replaced by canonical .tooltip.tooltip-sm.
   See docs/ui-elements.md → Tooltips. */

/* === L2: Collapsible Subsections === */
.card-subsection {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    background: #fff;
    overflow: visible;
}

.card-subsection-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    background: var(--gray-50);
    border-bottom: 1px solid transparent;
    border-radius: var(--radius) var(--radius) 0 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}

/* When subsection is collapsed, fully round the header */
.card-subsection:not(.expanded) .card-subsection-header {
    border-radius: var(--radius);
}

.card-subsection-header:hover {
    background: var(--gray-100);
}

.card-subsection.expanded .card-subsection-header {
    border-bottom-color: var(--gray-200);
}

/* Status dot - flat single color */
.card-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.card-status-dot.status-green { background: #22c55e; }
.card-status-dot.status-amber { background: #f59e0b; }
.card-status-dot.status-red { background: #ef4444; }
.card-status-dot.status-gray { background: #9ca3af; }

/* Chevron icon */
.card-subsection-chevron {
    width: 16px;
    height: 16px;
    color: var(--gray-400);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.card-subsection.expanded .card-subsection-chevron {
    transform: rotate(180deg);
}

/* Title — class or bare <h4>/<h5> both styled the same */
.card-subsection-title,
.card-subsection-header h4,
.card-subsection-header h5 {
    flex: 1;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    margin: 0;
}

/* Preview stat - shown when collapsed */
.card-subsection-preview {
    font-size: var(--text-body);
    color: var(--gray-500);
    margin-left: auto;
}

.card-subsection.expanded .card-subsection-preview {
    display: none;
}

/* Recommendation button [?] */
/* Legacy alias — matches .insights-btn--lens. New code should use the canonical class. */
.card-subsection-rec-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    background: #fff;
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.card-subsection-rec-btn:hover {
    background: var(--gray-50);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Collapsible content body */
.card-subsection-body {
    display: none;
    padding: 1rem;
}

.card-subsection.expanded .card-subsection-body {
    display: block;
}

/* === L3: Simple Expandable Sections === */
.card-l3-section {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.card-l3-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    transition: background 0.15s ease;
}

.card-l3-header:hover {
    filter: brightness(0.97);
}

.card-l3-header .card-l3-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.card-l3-section.expanded .card-l3-chevron {
    transform: rotate(180deg);
}

.card-l3-header .card-l3-count {
    font-weight: var(--font-normal);
    opacity: 0.8;
}

/* L3 Category variants */
.card-l3-section.l3-high .card-l3-header {
    background: var(--brand-red-50);
    color: var(--brand-red-700);
    border-bottom: 1px solid var(--brand-red-200);
}
.card-l3-section.l3-high .card-l3-chevron { stroke: var(--brand-red-500); }

.card-l3-section.l3-mixed .card-l3-header {
    background: var(--brand-amber-50);
    color: var(--brand-amber-700);
    border-bottom: 1px solid var(--brand-amber-200);
}
.card-l3-section.l3-mixed .card-l3-chevron { stroke: var(--brand-amber-500); }

.card-l3-section.l3-healthy .card-l3-header {
    background: var(--brand-green-50);
    color: var(--brand-green-700);
    border-bottom: 1px solid var(--brand-green-200);
}
.card-l3-section.l3-healthy .card-l3-chevron { stroke: var(--brand-green-500); }

/* L3 Tenure bucket variants (for Early Attrition) */
.card-l3-section.l3-90day .card-l3-header {
    background: var(--brand-red-50);
    color: var(--brand-red-700);
    border-bottom: 1px solid var(--brand-red-200);
}
.card-l3-section.l3-90day .card-l3-chevron { stroke: var(--brand-red-500); }

.card-l3-section.l3-180day .card-l3-header {
    background: var(--brand-amber-50);
    color: var(--brand-amber-700);
    border-bottom: 1px solid var(--brand-amber-200);
}
.card-l3-section.l3-180day .card-l3-chevron { stroke: var(--brand-amber-500); }

.card-l3-section.l3-1year .card-l3-header {
    background: var(--brand-indigo-50);
    color: var(--brand-indigo-700);
    border-bottom: 1px solid var(--brand-indigo-200);
}
.card-l3-section.l3-1year .card-l3-chevron { stroke: var(--brand-indigo-500); }

.card-l3-section.l3-2year .card-l3-header {
    background: var(--gray-100);
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}
.card-l3-section.l3-2year .card-l3-chevron { stroke: var(--gray-500); }

.card-l3-section.l3-neutral .card-l3-header {
    background: var(--gray-100);
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}
.card-l3-section.l3-neutral .card-l3-chevron { stroke: var(--gray-500); }

/* L3 Body */
.card-l3-body {
    display: none;
    padding: 0.75rem;
    background: #fff;
}

.card-l3-section.expanded .card-l3-body {
    display: block;
}

/* L3 Manager grid */
.card-l3-mgr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

/* Landing digest page chrome (flagged) — layout only, tokens only. */
.home-digest-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.home-eyebrow { margin: 0 0 .4rem; font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--gray-500); }
.home-sub { margin: .4rem 0 0; font-size: 12.5px; color: var(--gray-500); }
.home-digest .lens-section { margin-top: 1.25rem; }

/* The base card makes NO interaction claim. Roughly half of this family's
   instances are read-only lists — the people in a retention-risk department
   drawer, SPOF departments, employees due for promotion — and the base
   carried `cursor: pointer` plus a lift-and-shadow hover for every one of
   them. A card that rises to meet the pointer and then does nothing is a
   promise the interface cannot keep, and the reader stops trusting the ones
   that ARE clickable. `.gc-clickable` was already a symptom: someone built an
   honest modifier without taking the claim off the base, so those cards were
   getting two competing hover treatments at once. */
.card-l3-mgr-card {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    min-height: 90px;
    min-width: 0;
    overflow: hidden;
    position: relative;
}
/* Compact list-row variant — approved for the landing digest 2026-08-03
   (ui-elements.md § item cards). The base card's min-height: 90px is sized for
   the narrow grid columns it lives in; at full digest width that renders as a
   mostly-empty card, so the variant removes the floor and changes nothing else.
   MUST FOLLOW the base rule: equal specificity means source order decides, and
   the first version of this variant sat above the base and silently lost. */
.card-l3-mgr-card--row { min-height: 0; }

/* The affordance, on cards that have somewhere to go. Pairs with
   `role="button"`/`role="link"` + `tabindex="0"` on the element — the
   delegated keydown handler in app.js operates them from the keyboard. */
.card-l3-mgr-card--clickable { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }

.card-l3-mgr-card--clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: white;
}

.card-l3-mgr-card--clickable:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.card-l3-mgr-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.3rem;
}

.card-l3-mgr-dot.dot-high { background: #ef4444; }
.card-l3-mgr-dot.dot-mixed { background: #f59e0b; }
.card-l3-mgr-dot.dot-healthy { background: #22c55e; }
.card-l3-mgr-dot.dot-gray { background: #9ca3af; }

.card-l3-mgr-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    min-width: 0;
    flex: 1;
}

.card-l3-mgr-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.card-l3-mgr-meta {
    font-size: var(--text-xs);
    color: var(--gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* L3 card detail lines and tooltip */
.card-l3-detail {
    font-size: var(--text-xs);
    color: var(--gray-500);
    line-height: 1.4;
}

.card-l3-detail strong {
    color: var(--gray-700);
    font-weight: var(--font-semibold);
}

/* Deprecated 2026-06-12: .card-l3-tooltip replaced by canonical .tooltip.tooltip-sm.tooltip-arrow.
   See docs/ui-elements.md → Tooltips. */

/* Show More Button for L3 Grids */
.card-show-more-btn {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-600);
    font-size: var(--text-body);
    font-weight: var(--font-medium);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.card-show-more-btn:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

/* Disabled L3 Card (no data) */
/* `.disabled` is "this card WOULD open something and can't" — it dims. It is
   not the way to render a plain informational list; those simply omit
   `--clickable`, and read at full contrast because there is nothing wrong
   with them. */
.card-l3-mgr-card.disabled {
    cursor: default;
    opacity: 0.6;
}

.card-l3-mgr-card.disabled:hover {
    transform: none;
    box-shadow: none;
    background: var(--gray-50);
}

/* Career Growth Department Card */
.cg-dept-card {
    justify-content: space-between;
}

.cg-dept-count {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-700);
    flex-shrink: 0;
}

/* Empty category state */
.card-l3-empty {
    font-size: var(--text-sm);
    color: var(--gray-400);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

/* No performance data note */
.card-l3-note {
    font-size: var(--text-xs);
    color: var(--gray-500);
    font-style: italic;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

/* === L3: Callouts === */
.card-callout {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-top: 0.75rem;
    font-size: var(--text-body);
    line-height: 1.5;
}

.card-callout-recommendation {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    color: #1e40af;
}

.card-callout-data-required {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    color: #92400e;
}

.card-callout-summary {
    background: var(--gray-50);
    border-left: 3px solid var(--gray-300);
    color: var(--gray-700);
}

.card-callout-title {
    font-weight: var(--font-semibold);
    margin-bottom: 0.25rem;
}

/* === Card Section Divider === */
.card-section-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 1rem 0;
}

/* === Responsive === */
@media (max-width: 640px) {
    .card-metrics-row {
        gap: 0.5rem;
    }

    .card-metric {
        min-width: 80px;
        padding: 0.5rem 0.75rem;
    }

    .card-metric-value {
        font-size: var(--text-lg);
    }

    .card-subsection-header {
        padding: 0.625rem 0.75rem;
    }

    .card-subsection-preview {
        display: none;
    }

    .velocity-category-cards {
        flex-direction: column;
        gap: 0.5rem;
    }

    .velocity-category-card {
        padding: 0.5rem 0.75rem;
    }

    .velocity-category-value {
        font-size: var(--text-lg);
    }
}

/* ============================================
   Upload results (upload audit package 3, 2026-10-10)
   Built by client/upload-flow.js from approved parts: status dots, the L1
   metrics row, .card-subsection accordions, .data-table-compact, .radio,
   .form-group. Replaced the uppercase, raw-hex validation styles.
   ============================================ */

/* The status line: an approved status dot and a sentence */
.upload-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-900);
    padding: 0.25rem 0 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 1rem;
}
.upload-status .card-status-dot { flex: none; }
.upload-status small { font-weight: 400; color: var(--gray-500); margin-left: auto; font-size: var(--text-sm); }

/* The file against the previous uploaded month, under the status line */
.upload-compare { margin: -0.25rem 0 1rem; }
.upload-metrics-row { margin-bottom: 1rem; }
.upload-metrics-row .card-metric { min-height: 90px; }

#validation-results .card-subsection { margin-bottom: 0.75rem; }
#validation-results .card-subsection-body .upload-muted:first-child { margin-top: 0; }
.upload-list { margin: 0.25rem 0 0; padding-left: 1.1rem; color: var(--gray-700); font-size: var(--text-sm); }
.upload-list li { margin-bottom: 0.3rem; }
.upload-fix-group { margin: 0.5rem 0 0.25rem; font-size: var(--text-sm); color: var(--gray-700); }
.upload-done-title { margin: 0 0 0.5rem; font-weight: var(--font-semibold); color: var(--gray-800); }

/* Previously erased at this property (erased-reupload-plan §2) */
.upload-erased-table td { vertical-align: top; }
.upload-erased-table td:nth-child(3) { white-space: nowrap; }
.upload-keep-note { margin: 0.5rem 0 0; max-width: 420px; }
.upload-reason { margin: 0.5rem 0 0; max-width: 360px; }

/* Stacked radios — approved 2026-10-10: one option per line, for sentence
   labels in a narrow place such as a table cell */
.radio-stack { display: grid; gap: 0.35rem; }

/* Modal footer gate — approved 2026-10-10 (ux-patterns 3.4): the
   acknowledgement and what still blocks the action, on a full-width row
   above the buttons */
.modal-footer:has(.modal-footer-gate:not(.hidden)) { flex-wrap: wrap; row-gap: 0.75rem; }
.modal-footer-gate { display: grid; gap: 0.2rem; flex: 1 1 100%; min-width: 0; }
#upload-modal .modal-footer .btn { white-space: nowrap; }

@media (max-width: 1024px) {
    .employee-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .employee-info-grid {
        grid-template-columns: 1fr;
    }
}

/* Individual Info Cards */
.employee-info-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.875rem;
    transition: transform 0.15s, box-shadow 0.15s;
}

.employee-info-card.has-history {
    cursor: pointer;
}

.employee-info-card.has-history:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: white;
}

.employee-info-card-title {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.employee-info-card-title .history-indicator {
    font-size: var(--text-xs);
    color: var(--primary);
    font-weight: var(--font-medium);
    text-transform: none;
}

.employee-info-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.employee-info-label {
    color: var(--gray-500);
}

.employee-info-value {
    font-weight: var(--font-semibold);
    color: var(--gray-800);
    text-align: right;
}

.employee-info-value.masked {
    font-family: monospace;
    letter-spacing: 1px;
    color: var(--gray-400);
}

.employee-info-value.positive {
    color: var(--brand-green-600);
}

.employee-info-value.negative {
    color: var(--danger);
}

.employee-info-value.warning {
    color: var(--brand-amber-600);
}

/* Risk Factors List */
.risk-factors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.25rem;
}

.risk-factor-tag {
    font-size: var(--text-xs);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    background: var(--brand-amber-100);
    color: var(--brand-amber-700);
}

.risk-factor-tag.high {
    background: var(--danger-lighter);
    color: var(--danger);
}

/* Responsive */
@media (max-width: 640px) {
    .validation-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .validation-progress-steps {
        gap: 0.25rem;
    }

    .validation-step .step-label {
        font-size: var(--text-xs);
    }
}

/* ============================================
   Disaster Recovery Settings Tab
   ============================================ */

.dr-url-section {
    margin-bottom: 1rem;
}

.dr-url-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.dr-url-box code {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: var(--text-body);
    color: var(--gray-700);
}

.dr-url-box .btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.dr-requirements h4 {
    color: var(--gray-700);
    font-weight: var(--font-semibold);
}

/* ============================================
   Disaster Recovery Module Styles
   ============================================ */

/* Hide all app chrome when in DR mode */
body.dr-mode .sidebar,
body.dr-mode .main-content,
body.dr-mode .mobile-header,
body.dr-mode .sidebar-overlay,
body.dr-mode .screen,
body.dr-mode .impersonation-banner {
    display: none !important;
}

body.dr-mode .dr-recovery-view {
    display: flex !important;
}

body.dr-mode {
    background: #0f172a;
    overflow: hidden;
}

.dr-recovery-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.dr-recovery-container {
    width: 100%;
    max-width: 600px;
    padding: 1rem;
}

/* DR Steps */
.dr-step {
    display: none;
}

.dr-step-active {
    display: block;
}

/* DR Auth Card */
.dr-auth-card {
    background: #1e293b;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #334155;
}

.dr-auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.dr-auth-header svg {
    margin-bottom: 1rem;
}

.dr-auth-header h2 {
    color: #f1f5f9;
    font-size: var(--text-xl);
    margin: 0 0 0.5rem 0;
}

.dr-auth-subtitle {
    color: #94a3b8;
    font-size: var(--text-body);
    margin: 0;
}

/* DR Auth Factors */
.dr-auth-factor {
    background: #0f172a;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #334155;
}

.dr-factor-badge {
    display: inline-block;
    background: #4f46e5;
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dr-auth-card .form-group {
    margin-bottom: 1rem;
}

.dr-auth-card .form-group:last-child {
    margin-bottom: 0;
}

.dr-auth-card label {
    display: block;
    color: #e2e8f0;
    font-size: var(--text-body);
    margin-bottom: 0.375rem;
}

.dr-auth-card input {
    width: 100%;
    padding: 0.75rem;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #f1f5f9;
    font-size: var(--text-base);
}

.dr-auth-card input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.dr-auth-card input::placeholder {
    color: #64748b;
}

.dr-auth-card .form-hint {
    color: #64748b;
    font-size: var(--text-sm);
    margin-top: 0.375rem;
}

.dr-auth-card .error-message {
    color: #f87171;
    font-size: var(--text-body);
    margin-bottom: 1rem;
    text-align: center;
}

.dr-auth-submit {
    width: 100%;
    padding: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    background: #dc2626;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dr-auth-submit:hover:not(:disabled) {
    background: #b91c1c;
}

.dr-auth-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* DR Content Card */
.dr-content-card {
    background: #1e293b;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #334155;
}

.dr-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.dr-step-header h3 {
    color: #f1f5f9;
    font-size: var(--text-lg);
    margin: 0;
}

/* DR Session Timer */
.dr-session-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #0f172a;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: #94a3b8;
    font-size: var(--text-body);
    font-family: monospace;
}

.dr-session-timer.dr-timer-warning {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* DR Backup List */
.dr-backup-list {
    max-height: 400px;
    overflow-y: auto;
}

.dr-backup-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.dr-backup-item:hover {
    border-color: #475569;
    background: #1e293b;
}

.dr-backup-item.dr-backup-selected {
    border-color: #4f46e5;
    background: rgba(79, 70, 229, 0.1);
}

.dr-backup-icon {
    color: #94a3b8;
    flex-shrink: 0;
}

.dr-backup-details {
    flex: 1;
    min-width: 0;
}

.dr-backup-name {
    color: #f1f5f9;
    font-weight: var(--font-medium);
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.dr-backup-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: var(--text-sm);
    color: #94a3b8;
}

.dr-backup-meta span {
    padding: 0.125rem 0.375rem;
    background: #334155;
    border-radius: 4px;
}

/* DR-specific decorative radio indicator (DR backup list — visual only, no native input.
   Click handler on the parent row updates state and toggles .dr-backup-selected which
   paints the indigo fill below.). */

.dr-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #475569;
    border-radius: 50%;
    transition: border-color 0.2s;
}

.dr-backup-selected .dr-radio {
    border-color: #4f46e5;
    background: #4f46e5;
    box-shadow: inset 0 0 0 3px #1e293b;
}

/* DR Step Footer */
.dr-step-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #334155;
}

.dr-step-footer .btn-secondary {
    background: #334155;
    color: #e2e8f0;
    border: none;
}

.dr-step-footer .btn-secondary:hover {
    background: #475569;
}

.dr-step-footer .btn-primary,
.dr-step-footer .btn-danger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* DR Impact Assessment */
.dr-impact-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dr-impact-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #0f172a;
    border-radius: 8px;
    border: 1px solid #334155;
}

.dr-impact-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #334155;
    border-radius: 8px;
    flex-shrink: 0;
    color: #94a3b8;
}

.dr-impact-icon.dr-impact-warning {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.dr-impact-content {
    flex: 1;
}

.dr-impact-label {
    font-size: var(--text-sm);
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.dr-impact-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: #f1f5f9;
    margin-bottom: 0.25rem;
}

.dr-impact-desc {
    font-size: var(--text-body);
    color: #64748b;
}

/* DR Confirmation Section */
.dr-confirmation-section {
    margin-top: 1.5rem;
}

.dr-warning-box {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.dr-warning-box svg {
    flex-shrink: 0;
}

.dr-warning-box strong {
    color: #f87171;
    display: block;
    margin-bottom: 0.25rem;
}

.dr-warning-box p {
    color: #fca5a5;
    font-size: var(--text-body);
    margin: 0;
}

.dr-confirm-phrase-display {
    background: #0f172a;
    padding: 0.75rem;
    border-radius: 6px;
    font-family: monospace;
    font-size: var(--text-base);
    color: #f97316;
    text-align: center;
    margin-bottom: 0.75rem;
    border: 1px dashed #475569;
}

.dr-confirmation-section label {
    display: block;
    color: #e2e8f0;
    font-size: var(--text-body);
    margin-bottom: 0.5rem;
}

.dr-confirmation-section input {
    width: 100%;
    padding: 0.75rem;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #f1f5f9;
    font-family: monospace;
    font-size: var(--text-base);
}

.dr-confirmation-section input:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

/* DR Progress Stages */
.dr-progress-stages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dr-stage {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #0f172a;
    border-radius: 8px;
    border: 1px solid #334155;
    opacity: 0.5;
    transition: opacity 0.3s, border-color 0.3s;
}

.dr-stage-active {
    opacity: 1;
    border-color: #4f46e5;
}

.dr-stage-complete {
    opacity: 1;
    border-color: #22c55e;
}

.dr-stage-error {
    opacity: 1;
    border-color: #ef4444;
}

.dr-stage-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dr-stage-icon svg {
    color: #64748b;
}

.dr-stage-active .dr-stage-icon svg {
    color: #4f46e5;
}

.dr-stage-content {
    flex: 1;
}

.dr-stage-name {
    color: #f1f5f9;
    font-weight: var(--font-medium);
    font-size: var(--text-body);
}

.dr-stage-desc {
    color: #64748b;
    font-size: var(--text-sm);
}

.dr-progress-message {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #0f172a;
    border-radius: 8px;
    color: #94a3b8;
    font-size: var(--text-body);
    text-align: center;
}

/* DR Rollback Status */
.dr-rollback-status {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
}

.dr-rollback-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fbbf24;
    font-weight: var(--font-semibold);
    margin-bottom: 0.75rem;
}

.dr-rollback-progress {
    height: 8px;
    background: #334155;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.dr-rollback-bar {
    height: 100%;
    width: 0%;
    background: #f59e0b;
    border-radius: 4px;
    transition: width 0.3s;
}

.dr-rollback-message {
    color: #fcd34d;
    font-size: var(--text-body);
}

/* DR Complete */
.dr-complete-header {
    text-align: center;
    padding: 2rem 0;
}

.dr-complete-icon {
    margin-bottom: 1.5rem;
}

.dr-complete-header h2 {
    color: #f1f5f9;
    font-size: var(--text-xl);
    margin: 0 0 0.5rem 0;
}

.dr-complete-header p {
    color: #94a3b8;
    margin: 0;
}

/* DR Validation Results */
.dr-validation-results h4 {
    color: #e2e8f0;
    font-size: var(--text-base);
    margin: 0 0 1rem 0;
}

.dr-validation-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dr-validation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #0f172a;
    border-radius: 6px;
    border: 1px solid #334155;
}

.dr-validation-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dr-validation-name {
    flex: 1;
    color: #e2e8f0;
    font-size: var(--text-body);
}

.dr-validation-status {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dr-validation-passed .dr-validation-status {
    color: #22c55e;
}

.dr-validation-failed .dr-validation-status {
    color: #ef4444;
}

/* DR Empty/Error States */
.dr-empty,
.dr-error {
    padding: 2rem;
    text-align: center;
    color: #94a3b8;
}

.dr-error {
    color: #f87171;
}

/* DR Responsive */
@media (max-width: 640px) {
    .dr-recovery-container {
        padding: 0.5rem;
    }

    .dr-auth-card,
    .dr-content-card {
        padding: 1rem;
    }

    .dr-impact-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .dr-step-footer {
        flex-direction: column;
    }

    .dr-step-footer .btn {
        width: 100%;
    }
}

/* ============================================
   AI Chatbot Widget
   ============================================ */

#ai-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* .chat-fab — scoped variant. Lives inside #ai-chat-widget (a fixed-position
   wrapper at bottom-right), so it doesn't use the canonical .fab positioning.
   Visual matches the canonical: 56×56 circle, indigo, hover scale. */
.chat-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary, #4f46e5);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.15s ease;
}

.chat-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.5);
    background: var(--primary-hover, #4338ca);
}

.chat-fab:active {
    transform: scale(0.98);
}

/* Chat Panel */
.chat-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.chat-panel.open {
    display: flex;
    animation: chatSlideUp 0.2s ease-out;
}

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: var(--font-semibold);
    font-size: var(--text-body);
}

.chat-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f9fafb;
}

/* Welcome State */
.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
}

.chat-welcome-text {
    color: #374151;
    font-size: var(--text-body);
    line-height: 1.5;
    margin-bottom: 16px;
}

.chat-welcome-wave {
    font-size: var(--text-xl);
    display: block;
    margin-bottom: 8px;
}

.chat-welcome-hint {
    color: #9ca3af;
    font-size: var(--text-body);
    margin-top: 16px;
}

/* Suggestion Pills */
.chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.chat-suggestion-pill {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: var(--text-body);
    color: #374151;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.chat-suggestion-pill:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

/* Chat Messages */
.chat-message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.chat-message-user {
    flex-direction: row-reverse;
}

.chat-message-content {
    max-width: 85%;
}

.chat-message-text {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: var(--text-body);
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message-assistant .chat-message-text {
    background: white;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-top-left-radius: 4px;
}

.chat-message-user .chat-message-text {
    background: #4f46e5;
    color: white;
    border-top-right-radius: 4px;
}

/* Typing Indicator */
.chat-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.chat-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: chatTyping 1.4s infinite;
}

.chat-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes chatTyping {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Tool Indicator */
.chat-tool-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #eef2ff;
    border-radius: 8px;
    font-size: var(--text-body);
    color: #4f46e5;
    margin-bottom: 8px;
}

/* Chat Error */
.chat-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: var(--text-body);
    margin-top: 8px;
}

/* Chat Input Area */
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.chat-input {
    flex: 1;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: var(--text-body);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.chat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.chat-input:disabled {
    background: #f9fafb;
    color: #9ca3af;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #4f46e5;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #4338ca;
}

.chat-send-btn:disabled {
    background: #c7d2fe;
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #ai-chat-widget {
        bottom: 16px;
        right: 16px;
    }

    .chat-panel {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .chat-fab {
        width: 48px;
        height: 48px;
    }
}

/* Hide chat widget during DR mode */
body.dr-mode #ai-chat-widget {
    display: none;
}

/* ============================================
   Helpdesk Agent UI (Admin)
   ============================================ */

/* Agent Draft Section in Ticket Modal */
.ticket-agent-section {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
}

.agent-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.confidence-high {
    background: #dcfce7;
    color: #166534;
}

.confidence-medium {
    background: #fef3c7;
    color: #92400e;
}

.confidence-low {
    background: #fee2e2;
    color: #991b1b;
}

.agent-draft-content {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    font-size: var(--text-body);
    line-height: 1.6;
    color: #374151;
    white-space: pre-wrap;
}

.agent-reasoning,
.agent-kb-articles {
    margin-top: 12px;
}

.agent-reasoning summary,
.agent-kb-articles summary {
    font-size: var(--text-body);
    color: #6b7280;
    cursor: pointer;
    user-select: none;
}

.agent-reasoning summary:hover,
.agent-kb-articles summary:hover {
    color: #374151;
}

.agent-reasoning > div,
.agent-kb-articles > ul {
    margin-top: 8px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: var(--text-body);
    color: #4b5563;
}

.agent-kb-articles ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.agent-kb-articles li {
    padding: 4px 0;
}

.agent-approval-controls {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.agent-approval-controls .btn {
    flex: 1;
    min-width: 100px;
}

/* Agent Status Badge in Ticket List */
.ticket-agent-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
}

.ticket-agent-status.drafted {
    background: #dcfce7;
    color: #166534;
}

.ticket-agent-status.escalated {
    background: #fef3c7;
    color: #92400e;
}

.ticket-agent-status.processing {
    background: #e0e7ff;
    color: #3730a3;
}

/* AI Drafts Tab Badge */
.ai-drafts-badge {
    background: #22c55e;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    margin-left: 4px;
}

/* Process with Agent Button */
#process-agent-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Peer Group Meta (Progressive Relaxation Transparency) */
.peer-group-meta-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.peer-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.peer-meta-label {
    flex: 0 0 120px;
    font-size: var(--text-body);
    color: var(--gray-500);
    font-weight: var(--font-medium);
}

.peer-meta-value {
    flex: 1;
    font-size: var(--text-body);
    color: var(--gray-800);
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.peer-filter-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.peer-filter-applied {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.peer-filter-relaxed {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.peer-filter-none {
    background: var(--gray-100);
    color: var(--gray-500);
    border: 1px solid var(--gray-200);
}
.mini-bar-track {
    position: relative;
    flex: 1;
    height: 10px;
    border-radius: 5px;
    display: flex;
    overflow: visible;
}

.mini-bar-zone {
    height: 100%;
}

.mini-bar-zone:first-child {
    border-radius: 5px 0 0 5px;
}

.mini-bar-zone:last-of-type {
    border-radius: 0 5px 5px 0;
}

.mini-bar-zone.zone-green {
    background: #22c55e;
}

.mini-bar-zone.zone-light-green {
    background: #86efac;
}

.mini-bar-zone.zone-amber {
    background: #fbbf24;
}

.mini-bar-zone.zone-red {
    background: #ef4444;
}

.mini-bar-you {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #1f2937;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.mini-bar-you.zone-green {
    background: #22c55e;
}

.mini-bar-you.zone-light-green {
    background: #86efac;
}

.mini-bar-you.zone-amber {
    background: #fbbf24;
}

.mini-bar-you.zone-red {
    background: #ef4444;
}

.mini-bar-tick {
    position: absolute;
    top: -2px;
    width: 1px;
    height: 14px;
    background: rgba(0, 0, 0, 0.3);
    transform: translateX(-50%);
    z-index: 1;
}

.mini-bar-value {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
    white-space: nowrap;
    min-width: 36px;
    text-align: right;
}

.mini-bar-na {
    color: var(--gray-400);
    font-size: var(--text-sm);
    font-style: italic;
}
/* Responsive */

/* ========================================
   HC Distribution Chart Card
   ======================================== */

.hc-dist-chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hc-dist-metric-toggles {
    display: flex;
    gap: 0.35rem;
}

.hc-dist-metric-toggle {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: white;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    color: #374151;
    transition: all 0.15s;
}

.hc-dist-metric-toggle.active {
    background: var(--primary-color, #4f46e5);
    color: white;
    border-color: var(--primary-color, #4f46e5);
}

.hc-dist-metric-toggle:hover:not(.active) {
    background: #f3f4f6;
}

.hc-dist-division-nav {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.hc-dist-division-pill {
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: white;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.15s;
}

.hc-dist-division-pill.active {
    background: #1f2937;
    color: white;
    border-color: #1f2937;
}

.hc-dist-division-pill:hover:not(.active) {
    background: #f3f4f6;
    color: #374151;
}

.hc-dist-chart-container {
    position: relative;
    height: 320px;
    margin-bottom: 0.5rem;
}

.hc-dist-modal-chart-container {
    height: 400px;
}

/* Chart measure tooltip (docs/ui-elements.md): headcount on top, salary below; the
   selected measure is the larger and the other is faded. Colour is backed by an icon
   on the verdict and the name on the chip. */
.chart-tip {
    position: absolute;
    top: 4px;
    z-index: 30;
    box-sizing: border-box;
    width: 318px;
    max-width: 100%;
    padding: 0.75rem 0.9rem;
    background: var(--gray-800);
    color: var(--text-inverse);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 11px;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}
.chart-tip-name {
    margin-bottom: 0.35rem;
    font-size: 13px;
    font-weight: var(--font-semibold);
}
.chart-tip-measure + .chart-tip-measure {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(255,255,255,0.12);
}
.chart-tip-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0.1rem 0;
}
.chart-tip-verdict { font-size: 13px; font-weight: var(--font-medium); line-height: 1.2; }
.chart-tip-verdict.is-in { color: color-mix(in srgb, var(--brand-green-300) 40%, var(--gray-400)); }
.chart-tip-verdict.is-warn { color: color-mix(in srgb, var(--brand-amber-300) 40%, var(--gray-400)); }
.chart-tip-verdict.is-off { color: color-mix(in srgb, var(--brand-red-300) 40%, var(--gray-400)); }
.chart-tip-verdict.is-none { color: var(--gray-400); }
.chart-tip-proof { color: var(--gray-400); }
.chart-tip-chip {
    flex: 0 0 auto;
    padding: 0 0.35rem;
    background: transparent;
    border: 1px solid;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
}
.chart-tip-chip.hc {
    color: color-mix(in srgb, var(--brand-teal-300) 50%, var(--gray-400));
    border-color: color-mix(in srgb, var(--brand-teal-300) 35%, var(--gray-600));
}
.chart-tip-chip.sal {
    color: color-mix(in srgb, var(--brand-amber-300) 50%, var(--gray-400));
    border-color: color-mix(in srgb, var(--brand-amber-300) 35%, var(--gray-600));
}
.chart-tip-measure.is-selected .chart-tip-verdict { font-size: 17px; font-weight: var(--font-bold); }
.chart-tip-measure.is-selected .chart-tip-verdict.is-in { color: var(--brand-green-300); }
.chart-tip-measure.is-selected .chart-tip-verdict.is-warn { color: var(--brand-amber-300); }
.chart-tip-measure.is-selected .chart-tip-verdict.is-off { color: var(--brand-red-300); }
.chart-tip-measure.is-selected .chart-tip-proof { font-size: var(--text-sm); color: var(--gray-300); }
.chart-tip-measure.is-selected .chart-tip-chip {
    padding: 0.1rem 0.4rem;
    border-color: transparent;
    color: var(--gray-900);
    font-weight: var(--font-bold);
}
.chart-tip-measure.is-selected .chart-tip-chip.hc { background: var(--brand-teal-300); }
.chart-tip-measure.is-selected .chart-tip-chip.sal { background: var(--brand-amber-300); }
@media (max-width: 640px) {
    .chart-tip-measure.is-selected .chart-tip-verdict { font-size: 15px; }
}

.hc-dist-chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    font-size: 0.72rem;
    color: #6b7280;
    padding: 0.5rem 0;
    border-top: 1px solid #f3f4f6;
    flex-wrap: wrap;
}

.hc-dist-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Bar + line for one metric read as one thing, so their fade is one thing too.
   The old rule faded per item, which halved a bar while its market line stayed
   bright — the same wrong signal the chart's own opacities were emitting. */
.hc-dist-legend-group {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    transition: opacity 0.2s, background 0.2s;
}
.hc-dist-legend-group-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gray-500);
}
.hc-dist-legend-group.hc-dist-legend-faded {
    opacity: 0.35;
}
/* Kept for the two remaining call sites (span-of-control, benchmark HR)
   that toggle this class on a single item rather than a group. */
.hc-dist-legend-item.hc-dist-legend-faded {
    opacity: 0.35;
}

.hc-dist-legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.hc-dist-legend-line {
    display: inline-block;
    width: 20px;
    height: 3px;
    border-radius: 2px;
    vertical-align: middle;
}

/* Side-by-side layout */
.hc-dist-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.hc-dist-left-panel {
    min-width: 0;
}

.hc-dist-right-panel {
    min-width: 0;
    border-left: 1px solid #e5e7eb;
    padding-left: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
}

.hc-dist-panel-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.hc-dist-panel-body {
    /* Always visible — no accordion needed */
}

/* Summary text box */
.hc-dist-summary-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3px solid var(--primary-color, #4f46e5);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #334155;
}

.hc-dist-summary-box p {
    margin-bottom: 0.5rem;
}

.hc-dist-summary-box p:last-child {
    margin-bottom: 0;
}

/* Expanded modal header */
#hc-dist-expanded-modal .modal-header {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    color: #312e81;
}

#hc-dist-expanded-modal .modal-header h3 {
    color: #312e81;
}

#hc-dist-expanded-modal .modal-close {
    color: #4338ca;
    opacity: 0.8;
}

#hc-dist-expanded-modal .modal-close:hover {
    opacity: 1;
}

#hc-dist-expanded-modal .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}
@media (max-width: 900px) {
    .hc-dist-layout {
        grid-template-columns: 1fr;
    }
    .hc-dist-right-panel {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #e5e7eb;
        padding-top: 1rem;
        max-height: none;
    }
}

@media (max-width: 640px) {
    .hc-dist-chart-controls {
        flex-direction: column;
    }

}

/* ========================================
   Outlet Profile Settings
   ======================================== */

/* Modal: 80% viewport */
.outlet-profile-modal-content {
    width: 80vw !important;
    max-width: 80vw !important;
    max-height: 90vh;
}

.outlet-profile-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 130px);
}

/* Form layout */
.outlet-profile-modal-body .form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.outlet-profile-modal-body .form-group {
    margin-bottom: 1rem;
}

.outlet-profile-modal-body .form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: var(--text-body);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.outlet-profile-modal-body .required {
    color: var(--danger-color);
}

.outlet-profile-modal-body .checkbox-group {
    display: flex;
    gap: 1.5rem;
    padding: 0.5rem 0;
}

.outlet-profile-modal-body .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: var(--text-body);
    font-weight: var(--font-normal);
    color: var(--gray-700);
    cursor: pointer;
}

.outlet-profile-modal-body .form-help-text {
    margin-top: 0.35rem;
    font-size: var(--text-sm);
    color: var(--gray-500);
    font-style: italic;
}

/* OCS Display */
.outlet-ocs-display {
    margin-top: 1.25rem;
    padding: 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

.outlet-ocs-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.outlet-ocs-label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
}

.outlet-ocs-value {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.outlet-ocs-value #outlet-ocs-score {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--gray-800);
}

.outlet-ocs-max {
    font-size: var(--text-base);
    color: var(--gray-400);
    font-weight: var(--font-medium);
}

.outlet-ocs-band {
    margin-left: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
}

.outlet-ocs-band.ocs-low {
    background: #fee2e2;
    color: #991b1b;
}

.outlet-ocs-band.ocs-medium {
    background: #fef3c7;
    color: #92400e;
}

.outlet-ocs-band.ocs-high {
    background: #dcfce7;
    color: #166534;
}

/* Outlet table */
.outlet-profiles-table {
    width: 100%;
    margin-top: 1rem;
}

.outlet-profiles-table th {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    font-weight: var(--font-semibold);
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--gray-200);
    text-align: left;
}

.outlet-profiles-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: var(--text-body);
    color: var(--gray-700);
    vertical-align: middle;
}

.outlet-profiles-table tr:hover {
    background: var(--gray-50);
}

.outlet-name-cell {
    font-weight: var(--font-semibold);
    color: var(--gray-800) !important;
}

.ocs-band {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    margin-left: 0.25rem;
    vertical-align: middle;
}

.ocs-band.ocs-low {
    background: #fee2e2;
    color: #991b1b;
}

.ocs-band.ocs-medium {
    background: #fef3c7;
    color: #92400e;
}

.ocs-band.ocs-high {
    background: #dcfce7;
    color: #166534;
}

/* Summary row */
.outlet-summary-row {
    margin-bottom: 1rem;
}

.outlet-summary-row .card-metric {
    min-height: auto;
    padding: 0.75rem 1rem;
}

/* Warning button style */
.btn-warning {
    background: #f59e0b;
    color: white;
    border: none;
}

.btn-warning:hover {
    background: #d97706;
}

/* Responsive */
@media (max-width: 768px) {
    .outlet-profile-modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
    }

    .outlet-profile-modal-body .form-row-2col {
        grid-template-columns: 1fr;
    }
}

/* Upload Flow: Outlet Modal */
.outlet-upload-modal-content {
    width: 600px;
    max-width: 90vw;
}

.outlet-upload-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.outlet-upload-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

.outlet-upload-item-name {
    flex: 1;
    font-weight: var(--font-semibold);
    font-size: var(--text-body);
    color: var(--gray-800);
    min-width: 120px;
}

.outlet-upload-item-fields {
    display: flex;
    gap: 0.5rem;
}

.outlet-upload-item-fields .form-control-sm {
    padding: 0.3rem 0.5rem;
    font-size: var(--text-body);
    min-width: 130px;
}

/* Unprofiled Outlet Banner */
.outlet-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.outlet-banner-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--text-body);
    color: #92400e;
}

.outlet-banner-content svg {
    flex-shrink: 0;
    color: #d97706;
}

.outlet-banner-content a {
    color: var(--primary-color);
    font-weight: var(--font-semibold);
    white-space: nowrap;
}

.outlet-banner-dismiss {
    background: none;
    border: none;
    color: #92400e;
    font-size: var(--text-lg);
    cursor: pointer;
    padding: 0 0.25rem;
    opacity: 0.6;
}

.outlet-banner-dismiss:hover {
    opacity: 1;
}

@media (max-width: 640px) {
    .outlet-upload-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .outlet-upload-item-fields {
        flex-direction: column;
        width: 100%;
    }

    .outlet-upload-item-fields .form-control-sm {
        min-width: auto;
        width: 100%;
    }
}

/* F&B Benchmark Footnotes */
.fb-benchmark-footnotes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.fb-benchmark-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: var(--text-body);
    line-height: 1.4;
}

.fb-benchmark-note svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.fb-benchmark-note a {
    font-weight: var(--font-semibold);
}

.fb-note-fallback {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.fb-note-fallback svg {
    color: #3b82f6;
}

.fb-note-suppressed {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.fb-note-suppressed svg {
    color: #ef4444;
}

.fb-note-limited {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.fb-note-limited svg {
    color: #d97706;
}

.fb-note-widened {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.fb-note-widened svg {
    color: #d97706;
}

.fb-note-branded {
    background: var(--gray-50);
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
}

.fb-note-branded svg {
    color: var(--gray-400);
}

/* ========================================
   Internal Benchmarking (Corporate Accounts)
   ======================================== */

/* Visibility — corporate-only items visible for corporate accounts or superusers */
.corporate-only { display: none !important; }
body.is-corporate .corporate-only { display: flex !important; }
body.is-superuser .corporate-only { display: flex !important; }
.corporate-only.nav-link { display: none !important; }
body.is-corporate .corporate-only.nav-link { display: flex !important; }
body.is-superuser .corporate-only.nav-link { display: flex !important; }

/* Multi-dot percentile scale */
.internal-percentile-scale {
    margin: 0.5rem 0;
}

.internal-percentile-scale .percentile-bar-container {
    position: relative;
    height: 52px;
    margin: 0.25rem 0;
}

/* Drill-down panel */
.internal-drilldown-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 0;
}

.internal-drilldown-panel.expanded {
    max-height: 600px;
    overflow: auto;
    margin-top: 0.75rem;
}

.internal-drilldown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 6px 0 0;
    font-size: 0.875rem;
}

.internal-drilldown-body {
    padding: 0.75rem;
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 6px 6px;
}

/* Internal Benchmark — Market Toggle Button */
.ib-market-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.ib-market-toggle:hover {
    border-color: #9ca3af;
}
.ib-market-toggle.active {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}
.ib-market-toggle-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #9ca3af;
    background: transparent;
    transition: all 0.15s ease;
}
.ib-market-toggle.active .ib-market-toggle-dot {
    border-color: #22c55e;
    background: #22c55e;
}
.ib-market-toggle.loading {
    opacity: 0.6;
    cursor: wait;
    pointer-events: none;
}
.ib-market-toggle.loading .ib-market-toggle-dot {
    border-color: #6366f1;
    background: transparent;
    border-top-color: transparent;
    border-right-color: transparent;
    animation: ib-market-spin 0.7s linear infinite;
}
@keyframes ib-market-spin {
    to { transform: rotate(360deg); }
}

.internal-drilldown-body .simple-table {
    width: 100%;
    border-collapse: collapse;
}

.internal-drilldown-body .simple-table th,
.internal-drilldown-body .simple-table td {
    padding: 0.35rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.internal-drilldown-body .simple-table th {
    font-weight: 600;
    color: var(--gray-500);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.internal-drilldown-body .simple-table td {
    color: var(--gray-700);
}

/* Internal benchmark cards — match insights card format */
#internal-benchmark-view .benchmark-card-indigo {
    border: 2px solid var(--brand-teal-400);
    border-top: 3px solid var(--brand-teal-400);
}

#internal-benchmark-view .benchmark-card-indigo.expanded {
    border: 3px solid var(--brand-teal-400);
}

#internal-benchmark-view .benchmark-card-pink {
    border: 2px solid var(--brand-pink-400);
    border-top: 3px solid var(--brand-pink-400);
}

#internal-benchmark-view .benchmark-card-pink.expanded {
    border: 3px solid var(--brand-pink-400);
}

#internal-benchmark-view .benchmark-card-header-collapsible {
    padding: 1rem 1.25rem;
    min-height: 56px;
}

#internal-benchmark-view .benchmark-card-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

#internal-benchmark-view .benchmark-card-header-left h4 {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: #64748b;
    line-height: 1.4;
}

#internal-benchmark-view .benchmark-card.expanded .benchmark-card-header-left h4 {
    color: var(--brand-indigo-800);
}

#internal-benchmark-view .benchmark-card-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 1rem;
    flex-shrink: 0;
}

#internal-benchmark-view .benchmark-card-period {
    font-size: 0.8rem;
    color: var(--gray-500);
    white-space: nowrap;
}

#internal-benchmark-view .benchmark-card-body {
    padding: 1.25rem;
}

/* Internal benchmark view padding for last card scroll */
#internal-benchmark-view .compare-container {
    padding-bottom: 50vh;
}

/* Portfolio summary card */
.portfolio-summary-card {
    margin-bottom: 1.5rem;
}

.portfolio-summary-card .benchmark-card-body {
    border-top: none;
}

#internal-benchmark-view .portfolio-summary-card {
    border: 2px solid var(--brand-teal-400);
}

#internal-benchmark-view .portfolio-summary-card.expanded {
    border: 3px solid var(--brand-teal-400);
}

#internal-benchmark-view .portfolio-summary-card .benchmark-card-header-left h4 {
    color: white;
}

.portfolio-hotel-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.5rem;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}

.portfolio-hotel-row:hover {
    background: var(--gray-50);
}

.portfolio-hotel-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    white-space: nowrap;
}

/* Portfolio modal table */
.portfolio-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.portfolio-comparison-table th {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: var(--gray-500);
    padding: 0.5rem;
    text-align: center;
    border-bottom: 2px solid var(--gray-200);
}

.portfolio-comparison-table td {
    padding: 0.5rem;
    border-bottom: 1px solid var(--gray-100);
}

/* Corporate hotel picker in wizard */
.wizard-corporate-hotel-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.25rem;
}

.wizard-corporate-hotel-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.1s;
}

.wizard-corporate-hotel-item:hover {
    background: var(--gray-50);
}

.wizard-corporate-hotel-item input[type="checkbox"] {
    flex-shrink: 0;
}

/* ============================================================
   ORG STRUCTURE settings viewer (Phase B)
   Inference-first read-only viewer + collapsible override slot
   ============================================================ */

/* ============================================================
   NEW (2026-06-10): Compact status bar + sub-header + list footer
   Replaces the legacy banner + stats-tiles + GM-summary stack.
   Legacy rules below (.org-structure-banner, .org-structure-stats,
   .org-stat, .org-structure-gm, .org-structure-actions) are now
   unused — kept for now, slated for cleanup.
   ============================================================ */

.org-status-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.625rem 1rem;
    margin-bottom: 1rem;
}
.org-status-bar.warning {
    background: #fffbeb;
    border-color: #fde68a;
}
.org-status-bar .org-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.org-status-bar .org-status-dot.green { background: #22c55e; }
.org-status-bar .org-status-dot.amber { background: #f59e0b; }
.org-status-bar .org-status-dot.red   { background: #ef4444; }
.org-status-bar .org-status-text {
    flex: 1;
    font-size: 13px;
    color: var(--gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.org-status-bar .org-status-text strong { color: var(--gray-900); }
.org-status-bar.warning .org-status-text strong { color: #92400e; }
.org-status-bar .org-status-separator { color: var(--gray-300); margin: 0 0.5rem; }
.org-status-bar .org-status-coverage { color: var(--gray-600); }
.org-status-bar .org-status-coverage strong { color: var(--gray-900); font-weight: 600; }
.org-status-bar .org-status-issues { color: var(--gray-600); }

.org-structure-sub-header {
    font-size: 12px;
    color: var(--gray-500);
    margin: 0 0.25rem 1.25rem;
    line-height: 1.5;
}
.org-structure-sub-header strong { color: var(--gray-700); font-weight: 600; }

.settings-managers-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0.25rem 0;
}
.settings-managers-footer .org-structure-link.danger {
    color: var(--gray-500);
    font-size: 11px;
}
.settings-managers-footer .org-structure-link.danger:hover {
    color: #dc2626;
}

.org-structure-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.org-structure-banner.banner-ok {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}
.org-structure-banner.banner-warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
}
.org-structure-banner svg { flex-shrink: 0; margin-top: 1px; }
.org-structure-banner-content { flex: 1; }
.org-structure-banner-content strong { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.org-structure-banner-content .text-muted { font-size: 0.85rem; color: inherit; opacity: 0.85; }
.org-structure-banner-content ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Stat tiles row */
.org-structure-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.org-stat {
    padding: 0.85rem 1rem;
    background: var(--gray-50);
    border-radius: 8px;
}
.org-stat-num   { font-size: 1.4rem; font-weight: 700; color: var(--gray-900); line-height: 1; }
.org-stat-label { font-size: 0.75rem; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.03em; margin-top: 0.3rem; }
.org-stat-sub   { font-size: 0.75rem; color: var(--gray-500); margin-top: 0.2rem; }

/* GM single-row summary */
.org-structure-gm {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--primary-light, #eef2ff);
    border-radius: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.org-structure-gm.org-structure-gm-missing {
    background: #fee2e2;
}
.org-structure-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-dark, #3730a3);
    flex-shrink: 0;
}
.org-structure-name { font-weight: 600; color: var(--gray-900); }
.org-structure-meta { color: var(--gray-600); font-size: 0.9rem; }

/* Source badges (inferred / override) */
.org-structure-source-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-left: auto;
}
.org-structure-source-badge.source-inferred {
    background: var(--gray-100);
    color: var(--gray-600);
}
.org-structure-source-badge.source-override {
    background: #ede9fe;
    color: #5b21b6;
}

/* Action row — primary buttons on the left, links on the right (separated by spacer). */
.org-structure-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}
.org-structure-actions-spacer {
    flex: 1;
    min-width: 1rem;
}

/* Subtle text-link button — used for "Re-analyse" and "Reset all overrides".
   Visually a link, sized to align with adjacent btn-sm buttons in the same row. */
.org-structure-link {
    background: none;
    border: none;
    color: var(--primary, #4f46e5);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    text-decoration: none;
    line-height: 1.2;
    border-radius: 4px;
    transition: background-color 0.1s, color 0.1s;
}
.org-structure-link:hover {
    color: var(--primary-hover, #4338ca);
    background: var(--primary-light, #eef2ff);
    text-decoration: underline;
}

/* Tree view (collapsed by default; .org-structure-tree[style="display: block"] makes it visible) */
.org-structure-tree {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.org-tree-root .org-tree-node,
.org-tree-root .org-tree-leaf {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    background: white;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}
.org-tree-gm {
    background: var(--primary-light, #eef2ff) !important;
    font-weight: 600;
}
.org-tree-branch { margin-left: 1.5rem; }
.org-tree-leaf { margin-left: 1.5rem; padding-left: 1rem; background: white; }
.org-tree-scope {
    font-weight: 600;
    color: var(--gray-700);
    min-width: 9rem;
}
.org-tree-name { color: var(--gray-900); }
.org-tree-title { color: var(--gray-500); font-size: 0.85rem; }
.org-tree-orphan-header { background: #fef3c7 !important; }

/* Override slot */
.org-structure-override-slot {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}
/* Responsive */
@media (max-width: 768px) {
    .org-structure-stats { grid-template-columns: 1fr; }
    .org-tree-scope { min-width: auto; }
}

/* ============================================================
   END ORG STRUCTURE settings viewer
   ============================================================ */

/* ============================================================
   SETUP PROGRESS — FAB + Side Panel (Phase B FAB design)
   Persistent floating action button bottom-right + slide-in
   right panel that coexists with the main content (push, not
   overlay). Disappears when setup is 100% complete. Mobile
   (<900px) falls back to overlay mode.
   ============================================================ */

/* ══════════════════════════════════════════════════════════════════════════════
   FAB — Family 36 canonical (Floating Action Button)
   - .fab            : base — 56×56 indigo circle, fixed bottom-right
   - .fab-stack-1    : bottom: 24px (lowest in vertical stack)
   - .fab-stack-2    : bottom: 92px (above stack-1, with 12px gap)
   - .fab-stack-3    : bottom: 160px (future)
   - .fab.hidden     : opacity 0, scale 0, pointer-events: none
   - .fab-icon       : 24×24 SVG child
   - .fab-badge      : counter pill, top-right corner
   ══════════════════════════════════════════════════════════════════════════════ */

.fab {
    position: fixed;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary, #4f46e5);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 1499;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.3s ease, right 0.3s ease, background-color 0.15s ease;
}

.fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    background: var(--primary-hover, #4338ca);
}

.fab:focus-visible {
    outline: 3px solid var(--primary-light, #c7d2fe);
    outline-offset: 2px;
}

.fab.hidden {
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

/* Stacking — bottom: 24 + 56 + 12px gap = 92, +56 + 12 = 160 */
.fab.fab-stack-1 { bottom: 24px; }
.fab.fab-stack-2 { bottom: 92px; }
.fab.fab-stack-3 { bottom: 160px; }

/* Explain this (help-buttons skill): words in the round button instead of an icon. */
.fab-text {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
}

/* Every floating button steps aside while a modal is open, so none sits over it. */
body:has(.modal.active) .fab {
    visibility: hidden;
}

.fab-icon {
    width: 24px;
    height: 24px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger-color, #ef4444);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
    line-height: 1.3;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

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

/* When the panel is open on desktop, shift the FAB so it sits at the
   panel's edge rather than being covered by it. */
body.setup-panel-open .setup-fab {
    right: 404px; /* panel width (380) + original gap (24) */
}

/* ════════════════════════════════════════════════════════════════
   Bug / Feedback Report — top-right FAB + slide-in side panel
   Visible on every authenticated view; hidden on the login screen
   via the .hidden class which is removed once the dashboard is shown.
   ════════════════════════════════════════════════════════════════ */

/* Keep aligned with the setup FAB when the setup panel is open
   (setup-fab slides left → bug-fab tracks with it). */
body.setup-panel-open .bug-report-fab {
    right: 404px; /* panel width (380) + gap (24) — matches setup-fab */
}

/* ══════════════════════════════════════════════════════════════════════════════
   DRAWERS — Family 20 canonical (slide-in side panels)
   - .drawer            : base (fixed right, 100vh, slide-in transform)
   - .drawer-sm         : 380px width
   - default            : 420px width
   - .drawer-lg         : 460px width
   - .drawer.open       : slide in (transform translateX(0))
   - Sub-elements: -header, -title, -close, -body, -footer
   - .drawer-backdrop   : dim overlay (optional)
   ══════════════════════════════════════════════════════════════════════════════ */

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 100vw;
    height: 100vh;
    background: white;
    /* Option C — a hairline to separate, plus a wide low-opacity shadow for depth.
       Replaces the original -4px 0 20px rgba(0,0,0,.12). The tight dark shadow claimed
       elevation over content, which is wrong for any drawer that PUSHES rather than
       overlays: there is nothing underneath it to cast onto. Two of the five do push
       (setup-panel via margin-right on .main-content, insights-drawer on split cards),
       and C reads correctly either way. The shadow is on .open only: a closed
       drawer waits just off the right edge, and five of them cast a grey strip
       down every page (2026-10-17). */
    box-shadow: none;
    /* Rounded where it meets the top bar, square everywhere it meets an edge.
       Set here rather than on one member: `.insights-drawer` carried it alone,
       so the L3 and Span drawers squared off against it side by side. */
    border-top-left-radius: var(--radius-lg);
    overflow: hidden;
    z-index: 1500;
    transform: translateX(100%);
    /* Closing: the shadow stays while the drawer slides out, then goes. */
    transition: transform 0.25s ease, box-shadow 0s linear 0.25s;
    display: flex;
    flex-direction: column;
}

.drawer-sm { width: 380px; }
.drawer-lg { width: 460px; }

.drawer.open {
    transform: translateX(0);
    box-shadow: -1px 0 0 var(--gray-200), -16px 0 40px rgba(17, 24, 39, 0.06);
    transition: transform 0.25s ease, box-shadow 0s;
}

.drawer-header {
    flex-shrink: 0;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gray-900);
}

.drawer-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.drawer-close:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.drawer-footer {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--gray-50);
}

.drawer-footer .btn {
    flex: 1;
}

/* Backdrop — optional dim overlay behind a drawer */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.25);
    z-index: 1499;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0s;
}

/* Mobile: full-width drawer on small screens */
@media (max-width: 480px) {
    .drawer { width: 100vw; }
}
.bug-report-context {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
    color: var(--gray-600);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}
.bug-report-context strong {
    color: var(--gray-900);
    font-weight: 600;
}
.bug-report-context-row {
    display: flex;
    gap: 0.5rem;
}
.bug-report-context-row + .bug-report-context-row {
    margin-top: 0.15rem;
}
.bug-report-context-label {
    color: var(--gray-500);
    min-width: 80px;
    flex-shrink: 0;
}
/* Form fields here now use canonical .form-group (per docs/ui-elements.md → Text inputs).
   .bug-report-field-label, .bug-report-select, .bug-report-textarea, .bug-report-error
   deleted 2026-06-11. */
.bug-report-counter {
    font-size: 0.7rem;
    color: var(--gray-500);
    text-align: right;
    margin-top: 0.25rem;
}
/* When the bug panel is open, slide both FABs out from behind it */
body.bug-report-panel-open .bug-report-fab,
body.bug-report-panel-open .setup-fab {
    right: 444px; /* 420 panel + 24 gap */
}

@media (max-width: 480px) {
    .bug-report-panel { width: 100vw; }
    body.bug-report-panel-open .bug-report-fab,
    body.bug-report-panel-open .setup-fab {
        opacity: 0;
        pointer-events: none;
    }
}

/* Bug-metadata block inside the superuser ticket detail modal */
.ticket-bug-metadata-block {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--primary, #4f46e5);
    border-radius: 6px;
    font-size: 0.8rem;
}
.bug-meta-header {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}
.bug-meta-row {
    display: flex;
    gap: 0.75rem;
    padding: 0.2rem 0;
    line-height: 1.5;
}
.bug-meta-label {
    color: var(--gray-500);
    min-width: 100px;
    flex-shrink: 0;
    font-weight: 500;
}
.bug-meta-value {
    color: var(--gray-800);
    word-break: break-all;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 0.78rem;
}

/* Bug-category ticket card on the admin list — subtle left accent */
.admin-ticket-card-bug {
    border-left: 3px solid var(--primary, #4f46e5);
}

/* Setup panel uses canonical .drawer.drawer-sm (Family 20). Only domain-specific
   content classes remain below (progress widget, task/subtask list, etc.). */
.setup-panel-progress {
    /* Now a sibling of .drawer-header (not inside). Needs its own padding +
       gray-50 bg to match the header context. */
    flex-shrink: 0;
    padding: 0.85rem 1.25rem 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}
.setup-panel-progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}
.setup-panel-progress-fill {
    height: 100%;
    background: var(--primary, #4f46e5);
    border-radius: 999px;
    transition: width 0.4s ease;
}
.setup-panel-progress-text {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 500;
}

/* setup-panel-body — overrides canonical .drawer-body padding to match setup
   panel's tighter spacing */
.setup-panel-body {
    padding: 1rem 1.25rem;
    gap: 0;
}
.setup-panel-placeholder {
    color: var(--gray-500);
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem 0;
    font-style: italic;
}

/* ── Main Content Reflow ────────────────────────────────────
   When the panel is open on desktop, the main content area
   shrinks to make room for it. The sidebar (left) is outside
   .main-content so it's unaffected. Modals continue to overlay
   the viewport — they're at a higher z-index than the panel.
   ─────────────────────────────────────────────────────────── */
.main-content {
    transition: margin-right 0.3s ease;
}
body.setup-panel-open .main-content {
    margin-right: 380px;
}

/* ── Mobile / narrow viewports ──────────────────────────────
   Below 900px, the panel becomes a full-width overlay rather
   than pushing the main content (which would squash it to
   unreadable width). The FAB stays at the regular bottom-right
   position regardless of panel state.
   ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .setup-panel {
        width: 100vw;
    }
    body.setup-panel-open .main-content {
        margin-right: 0;
    }
    body.setup-panel-open .setup-fab {
        right: 24px;  /* don't shift on mobile — FAB sits above the overlay */
    }
}

/* ============================================================
   END SETUP PROGRESS — FAB + Side Panel
   ============================================================ */

/* ── Phase 2: Setup Panel — task rows ─────────────────────── */
.setup-panel-group { margin-bottom: 1.25rem; }
.setup-panel-group:last-child { margin-bottom: 0; }
.setup-panel-group-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Small "X / Y" sub-progress indicator next to grouped task titles
   that have multiple sub-tasks (e.g. profile = 4 fields, mappings = 2). */
.setup-panel-task-subprogress {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.4rem;
    background: var(--gray-200);
    color: var(--gray-700);
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 999px;
    vertical-align: middle;
}
.setup-panel-task.complete .setup-panel-task-subprogress {
    background: #bbf7d0;
    color: #166534;
}

.setup-panel-task {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 0.35rem;
    background: var(--gray-50);
    cursor: pointer;
    transition: background-color 0.1s ease, transform 0.05s ease;
    user-select: none;
}
.setup-panel-task:hover:not([aria-disabled="true"]) {
    background: var(--primary-light, #eef2ff);
}
.setup-panel-task:active:not([aria-disabled="true"]) {
    transform: scale(0.99);
}
.setup-panel-task.complete {
    background: #f0fdf4;
}
.setup-panel-task.complete:hover {
    background: #dcfce7;
}

.setup-panel-task-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.setup-panel-task-icon.icon-complete   { background: var(--success-color, #22c55e); color: white; }
.setup-panel-task-icon.icon-incomplete { background: var(--gray-200); color: var(--gray-500); }

.setup-panel-task-content {
    flex: 1;
    min-width: 0;
}
.setup-panel-task-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-900);
    line-height: 1.3;
}
.setup-panel-task.complete .setup-panel-task-title {
    color: var(--gray-600);
    text-decoration: line-through;
    text-decoration-color: var(--gray-400);
}
.setup-panel-task-desc {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 0.2rem;
    line-height: 1.4;
}
.setup-panel-task-arrow {
    flex-shrink: 0;
    color: var(--gray-400);
    font-size: 1.1rem;
    margin-top: 0.1rem;
    transition: color 0.1s, transform 0.1s;
}
.setup-panel-task:hover .setup-panel-task-arrow {
    color: var(--primary);
    transform: translateX(2px);
}

/* ── Phase 3: modal coexistence with the Setup Panel ─────────
   When the Setup Panel is open (right-side, 380px), modals should
   cover ONLY the visible main-content area — not the full viewport.
   Otherwise the modal extends into the panel zone and looks broken.
   The panel's z-index (1500) is higher than the modal's (1000), so
   without this override the panel covers the right portion of the
   modal. We shrink the modal's overlay so it doesn't try to reach
   under the panel.
   On mobile (<900px) the panel becomes an overlay itself, so this
   doesn't apply.
   ─────────────────────────────────────────────────────────── */
@media (min-width: 901px) {
    body.setup-panel-open .modal {
        right: 380px;
        width: calc(100% - 380px);
    }
    /* The modal-content is 90vw wide by default — wider than the visible area
       once the panel takes 380px from the right. Shrink it to 90% of the
       remaining space so it doesn't extend behind the panel. */
    body.setup-panel-open .modal .modal-content {
        width: calc((100vw - 380px) * 0.9);
        max-width: calc((100vw - 380px) * 0.9);
    }
}

/* ===========================================================
   Grade Engine v2 — Pay Comparison frontend
   =========================================================== */

/* v2 marker chip in the card header */
.pay-v2-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.45rem;
    background: #e0e7ff;
    color: #3730a3;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    line-height: 1.3;
    vertical-align: middle;
}

/* Precision badge — the cohort step and sample size, per Pay vs market grade row */
.pay-precision-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: help;
    white-space: nowrap;
    border: 1px solid transparent;
}
.pay-precision-strict {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}
.pay-precision-suppressed {
    background: var(--gray-100, #f3f4f6);
    color: var(--gray-500);
    border-color: var(--gray-300);
    font-style: italic;
}

/* Position label — same RAG palette as the rest of the system */
.pay-v2-position {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}
.pay-v2-position-green { background: #dcfce7; color: #166534; }
.pay-v2-position-amber { background: #fef3c7; color: #92400e; }
.pay-v2-position-red   { background: #fee2e2; color: #991b1b; }
.pay-v2-position-gray  { background: var(--gray-100); color: var(--gray-500); }

/* Market position card in employee detail panel */
.market-position-grid {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.market-position-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}
.market-position-position-row .pay-v2-position {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
}

/* Subtle indicator while the Rewards drill is refetching market data after
   a pill click — slight opacity on the drill content so users see SOMETHING
   is updating, without yanking the whole surface to a loader. The class goes
   on #benchmark-salary-drill itself; the overlay pill is appended to it. */
.salary-card-refetching > *:not(.salary-refetching-overlay) {
    opacity: 0.55;
    transition: opacity 0.15s ease-out;
    pointer-events: none;
}
.salary-card-refetching {
    position: relative;  /* anchor the overlay */
}

/* Overlay pill matches the Internal Benchmarking "Market" button format:
   28px tall, pill-shaped, with a 10px dot on the left that becomes a
   spinning indigo circle via the .ib-market-spin keyframes (defined
   alongside the IB market toggle CSS above). */
.salary-refetching-overlay {
    /* Fixed near the top of the view, not centred on the card: the card is
       taller than the screen, so a centred pill sat below the fold
       (pay vs market review, 2026-10-18). */
    position: fixed;
    top: 84px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 28px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #4b5563;
    font-size: 0.75rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
}
.salary-refetching-overlay-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #6366f1;     /* same indigo as IB market loading state */
    border-top-color: transparent;
    border-right-color: transparent;
    animation: ib-market-spin 0.7s linear infinite;
}

/* ============================
 * People v2 — Phase 1 styles
 * ============================
 * Header: title + Health Score chip + attention count + Cards/Brief toggle + ⌘K hint.
 * Brief mode placeholder until Phase 4 ships AI generation.
 */
.people-v2-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.25rem;
    /* Pulls the title flush with the top of the section. This used to be
       described as cancelling `#insights-people-content`'s 1rem top padding;
       that padding is now 0 on every section, so what it actually cancels is
       part of `.comparison-results`' 2rem — the same cancel
       `.people-v2-drill-mode` takes for the drill-in. Overview and drill-in
       therefore start at the same y. */
    margin-top: -1rem;
}
/* openPeopleDrillIn sets [hidden] on the header when entering a card — the header
   (title, health chip, Brief/Cards toggle) is grid-level and the drill-in has its
   own chrome. Without this companion rule the author `display: flex` above beats
   the UA stylesheet's `[hidden] { display: none }` and the header stays on screen,
   so the Brief/Cards toggle appeared inside cards where it does nothing.
   Same pairing as `.people-v2-drill-mode[hidden]` further down this file. */
.people-v2-header[hidden] {
    display: none;
}
/* (The `padding-top: 0 !important` that used to live here is gone: the shared
   rule above is now 0 for every section, so this only restated it — and an
   !important that does nothing is one someone later deletes the wrong half of.) */
.people-v2-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.005em;
    margin: 0;
}
.people-v2-health {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem 0.3rem 0.55rem;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}
.people-v2-health-green { background: #dcfce7; color: #166534; }
.people-v2-health-amber { background: #fef3c7; color: #92400e; }
.people-v2-health-red { background: #fee2e2; color: #991b1b; }
.people-v2-health-gray { background: var(--gray-100); color: var(--gray-600); }
.people-v2-health-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.people-v2-health-green .people-v2-health-dot { background: #22c55e; }
.people-v2-health-amber .people-v2-health-dot { background: #f59e0b; }
.people-v2-health-red .people-v2-health-dot { background: #ef4444; }
.people-v2-health-gray .people-v2-health-dot { background: var(--gray-400); }
.people-v2-health-num {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}
.people-v2-health-max {
    opacity: 0.7;
    font-weight: 500;
}
.people-v2-attention {
    font-size: 11px;
    color: var(--gray-500);
}
.people-v2-attention strong {
    color: var(--gray-900);
    font-weight: 600;
}
.people-v2-header-spacer { flex: 1; }

.people-v2-mode-toggle {
    background: var(--gray-100);
    padding: 3px;
    border-radius: 999px;
    display: inline-flex;
    gap: 0;
}
.people-v2-mode-btn {
    background: none;
    border: none;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.18s, color 0.18s;
    font-family: inherit;
}
.people-v2-mode-btn:hover { color: var(--gray-900); }
.people-v2-mode-btn.active {
    background: white;
    color: var(--gray-900);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.people-v2-mode-btn.brief-active {
    background: var(--gray-900);
    color: white;
}
.people-v2-mode-icon {
    font-size: 13px;
    line-height: 1;
}

.people-v2-brief-placeholder {
    background: white;
    border: 1px dashed var(--gray-300);
    border-radius: 12px;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--gray-500);
}
.people-v2-brief-placeholder-icon {
    font-size: 36px;
    margin-bottom: 0.85rem;
}
.people-v2-brief-placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}
.people-v2-brief-placeholder-body {
    font-size: 13px;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ============================
 * People v2 — Phase 2 styles
 * ============================
 * Compact card: title · value+unit · delta · inline flag · sparkline.
 * Status drives 4px left-border accent.
 */
.people-v2-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.9rem;
}
.people-v2-grid-sample {
    /* During Phase 2a only one card is in this grid — let it sit at 1/4 width */
    grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 1200px) {
    .people-v2-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .people-v2-grid { grid-template-columns: repeat(2, 1fr); }
}

.people-v2-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem 1.1rem 1rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    outline: none;
}
.people-v2-card:hover,
.people-v2-card:focus-visible {
    border-color: var(--primary-color);
    border-left-color: var(--primary-color);
}
.people-v2-card.amber { border-left-color: #f59e0b; }
.people-v2-card.amber:hover,
.people-v2-card.amber:focus-visible {
    border-color: var(--primary-color);
    border-left-color: #f59e0b;
}
.people-v2-card.red { border-left-color: #ef4444; }
.people-v2-card.red:hover,
.people-v2-card.red:focus-visible {
    border-color: var(--primary-color);
    border-left-color: #ef4444;
}

.people-v2-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
}
.people-v2-card-value-row {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
}
.people-v2-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.people-v2-card-unit {
    font-size: 14px;
    color: var(--gray-500);
    font-weight: 500;
}
.people-v2-card-delta {
    font-size: 11px;
    color: var(--gray-500);
    line-height: 1.4;
}
.people-v2-card-delta strong {
    color: #ef4444;
    font-weight: 600;
}
.people-v2-card-delta.people-v2-card-delta-good strong {
    color: #22c55e;
}
.people-v2-card-delta.people-v2-card-delta-flat strong {
    color: var(--gray-500);
    font-weight: 500;
}
.people-v2-card-flag {
    font-size: 11px;
    color: var(--gray-500);
    font-style: italic;
    line-height: 1.4;
}
.people-v2-card.amber .people-v2-card-flag {
    color: #92400e;
    font-style: normal;
    font-weight: 500;
}
.people-v2-card.red .people-v2-card-flag {
    color: #b91c1c;
    font-style: normal;
    font-weight: 500;
}

/* Sparkline */
.people-v2-card-spark {
    height: 32px;
    margin-top: auto;
    padding-top: 0.5rem;
}
.people-v2-card-spark svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}
.people-v2-spark-line {
    fill: none;
    stroke-width: 1.75;
}
.people-v2-spark-line.healthy { stroke: var(--brand-green-500); }
.people-v2-spark-line.amber { stroke: var(--brand-amber-500); }
.people-v2-spark-line.red { stroke: var(--brand-red-500); }
.people-v2-spark-fill { opacity: 0.08; }
.people-v2-spark-fill.healthy { fill: var(--brand-green-500); }
.people-v2-spark-fill.amber { fill: var(--brand-amber-500); }
.people-v2-spark-fill.red { fill: var(--brand-red-500); }
.people-v2-spark-dot {
    stroke: white;
    stroke-width: 1.5;
}
.people-v2-spark-dot.healthy { fill: var(--brand-green-500); }
.people-v2-spark-dot.amber { fill: var(--brand-amber-500); }
.people-v2-spark-dot.red { fill: var(--brand-red-500); }

/* ============================================================
 * Rewards v2 — overview + drill-in chrome (spec §11)
 * Locked 2026-06-23. Mirrors People v2 chrome.
 * ============================================================ */

/* --- Page header ------------------------------------------------ */
/* Serves the Rewards, Workforce AND HR Metrics overviews. `margin-top` matches
   `.people-v2-header` — see the note there; it cancels part of
   `.comparison-results`' padding so an overview starts at the same y as a
   drill-in, and as People. */
.rewards-v2-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.25rem;
    margin-top: -1rem;
}
/* Rewards had its own `padding-top: 0 !important` here; the shared rule is now 0
   for every section so it is no longer needed. Bottom padding is added to match
   the others, which it never had. */
#insights-rewards-content { padding-bottom: 1rem; }
.rewards-v2-title {
    font-size: var(--text-xl, 22px);
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.005em;
    margin: 0;
}
.rewards-v2-health {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem 0.3rem 0.55rem;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.rewards-v2-health-green { background: var(--brand-green-100); color: var(--brand-green-800); }
.rewards-v2-health-amber { background: var(--brand-amber-100); color: var(--brand-amber-800); }
.rewards-v2-health-red   { background: var(--brand-red-100);   color: var(--brand-red-800); }
.rewards-v2-health-gray  { background: var(--gray-100);        color: var(--gray-600); }
.rewards-v2-health-dot { width: 8px; height: 8px; border-radius: 50%; }
.rewards-v2-health-green .rewards-v2-health-dot { background: var(--brand-green-500); }
.rewards-v2-health-amber .rewards-v2-health-dot { background: var(--brand-amber-500); }
.rewards-v2-health-red   .rewards-v2-health-dot { background: var(--brand-red-500); }
.rewards-v2-health-gray  .rewards-v2-health-dot { background: var(--gray-400); }
.rewards-v2-health-num { font-variant-numeric: tabular-nums; font-weight: 700; }
.rewards-v2-health-max { opacity: 0.7; font-weight: 500; }
.rewards-v2-attention { font-size: 11px; color: var(--gray-500); }
.rewards-v2-attention strong { color: var(--gray-900); font-weight: 600; }
.rewards-v2-header-spacer { flex: 1; }

.rewards-v2-mode-toggle {
    background: var(--gray-100);
    padding: 3px;
    border-radius: 999px;
    display: inline-flex;
}
.rewards-v2-mode-btn {
    background: none;
    border: none;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
}
.rewards-v2-mode-btn:hover { color: var(--gray-900); }
.rewards-v2-mode-btn.active {
    background: white;
    color: var(--gray-900);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.rewards-v2-mode-btn.brief-active { background: var(--gray-900); color: white; }
.rewards-v2-mode-icon { font-size: 13px; line-height: 1; }

/* --- Overview grid + compact cards (mirror .people-v2-card) ----- */
.rewards-v2-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.9rem;
}
@media (max-width: 1200px) { .rewards-v2-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .rewards-v2-grid { grid-template-columns: repeat(2, 1fr); } }

.rewards-v2-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem 1.1rem;
    cursor: pointer;
    transition: border-color 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    outline: none;
}
.rewards-v2-card:hover, .rewards-v2-card:focus-visible {
    border-color: var(--primary-color);
    border-left-color: var(--primary-color);
}
.rewards-v2-card.amber { border-left-color: var(--brand-amber-500); }
.rewards-v2-card.amber:hover { border-color: var(--primary-color); border-left-color: var(--brand-amber-500); }
.rewards-v2-card.red { border-left-color: var(--brand-red-500); }
.rewards-v2-card.red:hover { border-color: var(--primary-color); border-left-color: var(--brand-red-500); }
.rewards-v2-card.gray { border-left-color: var(--gray-200); opacity: 0.65; cursor: default; }
.rewards-v2-card.gray:hover { border-color: var(--gray-200); border-left-color: var(--gray-200); }

.rewards-v2-card-title { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.rewards-v2-card-value-row { display: flex; align-items: baseline; gap: 0.2rem; }
.rewards-v2-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.rewards-v2-card-unit { font-size: 14px; color: var(--gray-500); font-weight: 500; }
.rewards-v2-card-delta { font-size: 11px; color: var(--gray-500); line-height: 1.4; }
.rewards-v2-card-delta strong { color: var(--brand-red-500); font-weight: 600; }
.rewards-v2-card-delta.good strong { color: var(--brand-green-500); }
.rewards-v2-card-delta.flat strong { color: var(--gray-700); }
.rewards-v2-card-flag { font-size: 11px; color: var(--gray-500); font-style: italic; }
.rewards-v2-card.amber .rewards-v2-card-flag { color: var(--brand-amber-600); font-style: normal; font-weight: 500; }
.rewards-v2-card.red .rewards-v2-card-flag { color: var(--brand-red-600); font-style: normal; font-weight: 500; }
.rewards-v2-card-spark { margin-top: auto; padding-top: 0.5rem; }
.rewards-v2-card-spark svg { width: 100%; height: 32px; display: block; overflow: visible; }

/* --- Drill-in chrome (no outer card wrapper) ------------------- */
@keyframes rewardsV2FadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
/* Same 1rem cancel `.people-v2-drill-mode` takes, and for the same reason: the
   grid-level header that used to absorb `.comparison-results`' 2rem top padding
   is hidden inside a drill-in, so without this the drill-in sits 1rem lower than
   People's. This wrapper serves Rewards, Workforce, HR Metrics AND Benchmark, so
   one rule aligns all four. Measured before: People's title sat 24px from the
   container edge, Rewards 40px. */
.rewards-v2-drill-mode { animation: rewardsV2FadeIn 0.2s ease; margin-top: -1rem; }

.drill-nav-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin: 1rem 0 0.9rem;
    flex-wrap: wrap;
}
.drill-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
    background: none;
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}
.drill-back-btn:hover { background: var(--gray-50); color: var(--gray-900); }
.drill-breadcrumb { font-size: 13px; color: var(--gray-500); }
.drill-breadcrumb strong { color: var(--gray-900); font-weight: 600; }
.drill-nav-spacer { flex: 1; }
/* .drill-prev / .drill-next / .drill-current / .drill-picker removed 2026-07-30 with
   the in-drill-in card switcher. People dropped prev/next/picker when it converted to
   the split layout; Rewards and Workforce now match. The .drill-nav-row itself stays for
   Span of Control's ?soc=v5 rollback string path (_drillPlainNavHtml). */

/* .drill-l2-tabs / .drill-l2-tab removed 2026-07-31. The shell hoists the lens tabs into
   `.l2-tabs-center`, which IS the tab row, so the wrapper's own border-bottom and
   1.2rem margin produced a tab bar nested inside a tab bar. `_drillTabsHtml` now emits
   the approved `.l2-modeb-lens-tab` — one lens-tab variant across all four sections
   instead of two. Reachability checked: no emitter in client/ or server/, no window
   export, no onclick, no string dispatch. The copies in docs/archive/mockups/*.html are
   self-contained (inline <style>) and unaffected. */

/* Headline-block — flat eyebrow + verdict + foot, compact-in-place locked 2026-07-08.
   Matches .mode-b-headline compact treatment so Rewards drill-ins and SoC v5
   headlines sit at the same ~50px inner height as People/Workforce cards. Spec §2. */
.rewards-v2-drill-mode .headline-block {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin: 0 0 0.6rem;
    padding: 0.15rem 0 0.5rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--gray-100);
    border-radius: 0;
}
.rewards-v2-drill-mode .headline-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-500);
}
.rewards-v2-drill-mode .headline-verdict {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--brand-amber-600);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.rewards-v2-drill-mode .headline-verdict.green { color: var(--brand-green-600); }
.rewards-v2-drill-mode .headline-verdict.red { color: var(--brand-red-600); }
/* Neutral. `.headline-verdict`'s base colour is amber and .green/.red override
   it, which left nothing for "not computed yet" — so every Awaiting-data
   headline rendered in warning amber, measured rgb(217,119,6). Three cards
   were doing it: reporting-depth, spof, grade-pyramid. Token-aliased. */
.rewards-v2-drill-mode .headline-verdict.neutral { color: var(--gray-500); }
/* A descriptive headline (Total rewards, spec §9 exception): a statement in text colour, not a verdict colour. */
.rewards-v2-drill-mode .headline-verdict.statement { color: var(--gray-900); }
.rewards-v2-drill-mode .headline-verdict .v-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    display: inline-block;
}
.rewards-v2-drill-mode .headline-verdict svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.rewards-v2-drill-mode .headline-foot { font-size: 11.5px; color: var(--gray-700); }
.rewards-v2-drill-mode .headline-foot strong { color: var(--gray-900); font-weight: 700; }
.rewards-v2-drill-mode .headline-foot a {
    color: var(--brand-indigo-600);
    text-decoration: none;
    font-weight: 600;
}
.rewards-v2-drill-mode .headline-foot a:hover { color: var(--brand-indigo-700); text-decoration: underline; }

/* L1 strip — 4–6 metric cells, fills the full content width.
   Track count comes from data-count, which the composer sets from the number of
   metrics a body actually emits. It used to be a flat repeat(6, 1fr) regardless, and
   eight of the ten converted bodies emit four — so a third of the strip rendered as
   dead space, plainly visible on Pay Equity.

   Deliberately NOT repeat(auto-fit, minmax(...)). auto-fit is container-driven, which
   is normally what you want here, but it wraps raggedly: measured on this markup it
   put 6 cells at a 900px pane into 5 + 1, and 4 cells at 600px into 3 + 1. Explicit
   counts keep every row balanced, which is the whole point of a KPI strip.

   Post-split this selector stops carrying the KPI block — it moves to the context
   pane and becomes 2-up under ui-elements hard rule 4 — so the viewport breakpoints
   below are adequate for the full-width form that remains. */
.rewards-v2-drill-mode .l1-strip,
.billing-stats .l1-strip,
.clients-figures .l1-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.7rem;
    margin-bottom: 1rem;
    width: 100%;
}
.rewards-v2-drill-mode .l1-strip[data-count="3"],
.billing-stats .l1-strip[data-count="3"],
.clients-figures .l1-strip[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
.rewards-v2-drill-mode .l1-strip[data-count="4"],
.billing-stats .l1-strip[data-count="4"],
.clients-figures .l1-strip[data-count="4"] { grid-template-columns: repeat(4, 1fr); }
.rewards-v2-drill-mode .l1-strip[data-count="5"],
.billing-stats .l1-strip[data-count="5"],
.clients-figures .l1-strip[data-count="5"] { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) {
    .rewards-v2-drill-mode .l1-strip,
    .rewards-v2-drill-mode .l1-strip[data-count="4"],
    .rewards-v2-drill-mode .l1-strip[data-count="5"],
    .billing-stats .l1-strip,
    .clients-figures .l1-strip,
    .billing-stats .l1-strip[data-count="4"],
    .clients-figures .l1-strip[data-count="4"],
    .billing-stats .l1-strip[data-count="5"],
    .clients-figures .l1-strip[data-count="5"] { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .rewards-v2-drill-mode .l1-strip,
    .rewards-v2-drill-mode .l1-strip[data-count="3"],
    .rewards-v2-drill-mode .l1-strip[data-count="4"],
    .rewards-v2-drill-mode .l1-strip[data-count="5"],
    .billing-stats .l1-strip,
    .clients-figures .l1-strip,
    .billing-stats .l1-strip[data-count="3"],
    .clients-figures .l1-strip[data-count="3"],
    .billing-stats .l1-strip[data-count="4"],
    .clients-figures .l1-strip[data-count="4"],
    .billing-stats .l1-strip[data-count="5"],
    .clients-figures .l1-strip[data-count="5"] { grid-template-columns: repeat(2, 1fr); }
}
.rewards-v2-drill-mode .l1-metric,
.billing-stats .l1-metric,
.clients-figures .l1-metric {
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 0.15rem;
}
.rewards-v2-drill-mode .l1-metric-value,
.billing-stats .l1-metric-value,
.clients-figures .l1-metric-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.rewards-v2-drill-mode .l1-metric-value.green,
.billing-stats .l1-metric-value.green,
.clients-figures .l1-metric-value.green { color: var(--brand-green-600); }
.rewards-v2-drill-mode .l1-metric-value.amber,
.billing-stats .l1-metric-value.amber,
.clients-figures .l1-metric-value.amber { color: var(--brand-amber-600); }
.rewards-v2-drill-mode .l1-metric-value.red,
.billing-stats .l1-metric-value.red,
.clients-figures .l1-metric-value.red { color: var(--brand-red-600); }
.rewards-v2-drill-mode .l1-metric-label,
.billing-stats .l1-metric-label,
.clients-figures .l1-metric-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}
/* An L1 metric whose subtext links to the lens that carries the figure
   (approved 2026-09-18, EoS coverage → Total rewards › Composition). */
.rewards-v2-drill-mode .l1-metric--link .l1-metric-subtext a { color: var(--primary-color); text-decoration: none; }
.rewards-v2-drill-mode .l1-metric--link .l1-metric-subtext a:hover,
.rewards-v2-drill-mode .l1-metric--link .l1-metric-subtext a:focus-visible { text-decoration: underline; }
.rewards-v2-drill-mode .l1-metric-subtext,
.billing-stats .l1-metric-subtext,
.clients-figures .l1-metric-subtext {
    display: block;
    font-size: 11px;
    color: var(--gray-500);
}

/* Narrative card — full-width gray panel with title + sub + caret */
.rewards-v2-drill-mode .narrative-card {
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: 8px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.rewards-v2-drill-mode .narrative-card:hover {
    border-color: var(--brand-indigo-300);
    background: var(--gray-100);
}
.rewards-v2-drill-mode .narrative-card-body {
    flex-basis: 100%;
    width: 100%;
    display: none;
    margin-top: 0.75rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--gray-200);
    font-size: 12.5px;
    color: var(--gray-700);
    line-height: 1.55;
    cursor: default;
}
.rewards-v2-drill-mode .narrative-card-body * { cursor: default; }
.rewards-v2-drill-mode .narrative-card-body p { margin: 0.45rem 0; }
.rewards-v2-drill-mode .narrative-card-body strong { color: var(--gray-900); font-weight: 600; }
.rewards-v2-drill-mode .narrative-card-body ul { margin: 0.4rem 0; padding-left: 1.1rem; }
.rewards-v2-drill-mode .narrative-card-body li { margin: 0.2rem 0; }
.rewards-v2-drill-mode .narrative-card-body h4 { font-size: 13px; font-weight: 600; color: var(--gray-900); margin: 0.6rem 0 0.3rem; }
.rewards-v2-drill-mode .narrative-card.expanded .narrative-card-body { display: block; }
.rewards-v2-drill-mode .narrative-card .lightbulb {
    font-size: 18px;
    color: var(--brand-amber-500);
    flex-shrink: 0;
}
.rewards-v2-drill-mode .narrative-text { flex: 1; }
.rewards-v2-drill-mode .narrative-text-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.1rem;
}
.rewards-v2-drill-mode .narrative-text-sub {
    font-size: 12.5px;
    color: var(--gray-600);
    line-height: 1.5;
}
.rewards-v2-drill-mode .narrative-text-sub strong { color: var(--gray-900); font-weight: 600; }
.rewards-v2-drill-mode .narrative-chev {
    color: var(--gray-400);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.rewards-v2-drill-mode .narrative-card.expanded .narrative-chev { transform: rotate(180deg); }

/* Lens section — title + ? button + body */
.rewards-v2-drill-mode .lens-section { margin-top: 0.4rem; }
.rewards-v2-drill-mode .lens-body { animation: rewardsLensFade 180ms ease; }
@keyframes rewardsLensFade {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}
.rewards-v2-drill-mode .lens-section-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}
.rewards-v2-drill-mode .lens-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}
/* Canonical `.insights-btn--lens` is used; align right inside the lens section head. */
.rewards-v2-drill-mode .lens-section-head .insights-btn--lens { margin-left: auto; }

/* Grade Compression — employee/manager lists (pairs lens reuses .grade-overlap-* from legacy CSS) */
.gc-list { display: flex; flex-direction: column; gap: 0.45rem; }
.gc-list .card-l3-mgr-card { display: grid; grid-template-columns: auto 1fr auto; gap: 0.7rem; }
.gc-emp-right { text-align: right; }
.gc-emp-salary { font-size: 13px; font-weight: 600; color: var(--gray-900); font-variant-numeric: tabular-nums; }
.gc-emp-excess { font-size: 11.5px; color: var(--brand-amber-600); }
.gc-list-foot {
    text-align: center;
    font-size: 11.5px;
    color: var(--gray-500);
    padding: 0.5rem;
}
.gc-clickable {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.gc-clickable:hover {
    background: var(--gray-50);
    border-color: var(--brand-indigo-300);
}
.gc-clickable:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ==========================================================================
   Item card — disclosure state (ui-elements.md § item cards, 2026-08-12)
   A person inside a grouped drawer, opening their own breakdown in place.
   The card becomes a container: a summary BUTTON plus a panel. A real button
   because keyboard operation, focus order and the expanded/collapsed
   announcement come with it — the role="button" div it replaces had none.
   ========================================================================== */
.gc-list--disclosure .card-l3-mgr-card--disclosure {
    display: block;
    padding: 0;
    min-height: 0;   /* the 90px floor is sized for grid columns, not a list */
}
.card-l3-mgr-summary {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: none;
    border: 0;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
}
.card-l3-mgr-summary:hover { background: var(--gray-50); }
.card-l3-mgr-summary:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}
.card-l3-mgr-summary .card-l3-mgr-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
/* The meta WRAPS here, up to two lines. The base card truncates it to one
   because it lives in a grid where every card must be the same height; a
   disclosure row is a list item with vertical room to spare, and in these lists
   the meta IS the content — "Room Attendant → Floor Supervisor · March 2026"
   ellipsised at 150px loses the destination, which is the whole point of a
   list called "Who moved". */
.card-l3-mgr-summary .card-l3-mgr-meta {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}
.it-disc-chev { color: var(--gray-400); transition: transform 0.18s ease; }
.card-l3-mgr-summary[aria-expanded="true"] .it-disc-chev {
    transform: rotate(180deg);
    color: var(--brand-indigo-600);
}
.card-l3-mgr-card--disclosure.is-open { border-color: var(--brand-indigo-200); }
.card-l3-mgr-card--disclosure.is-open .card-l3-mgr-summary { background: var(--brand-indigo-50); }

/* The composition, in the collapsed row. "3 factors" is a count; the strip is
   WHICH three, and it makes the list scannable without opening anything. */
.it-disc-strip { width: 74px; display: block; }
.it-disc-strip .rr-strip { height: 7px; }
.it-disc-value { font-size: var(--text-body); font-weight: 600; }

.card-l3-mgr-panel {
    padding: 0.2rem 0.9rem 1rem;
    border-top: 1px solid var(--gray-100);
    background: white;
}
.card-l3-mgr-panel .l3-drawer-section-title { margin-top: 0.8rem; }
.card-l3-mgr-panel .rr-maths { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
    .it-disc-chev { transition: none; }
}
@media (max-width: 640px) {
    /* The strip is the first thing to go: the score and the chevron are what
       the row is for, and 74px of bar is the widest thing that isn't. */
    .it-disc-strip { display: none; }
    .card-l3-mgr-summary { grid-template-columns: auto 1fr auto auto; }
}
.gc-clickable .gc-chev {
    color: var(--gray-400);
    flex-shrink: 0;
}
.gc-clickable:hover .gc-chev { color: var(--brand-indigo-600); }
.gc-list .card-l3-mgr-card.gc-clickable { grid-template-columns: auto 1fr auto auto; }

/* Pay-band Placement — Distribution lens (beeswarm) + Below/Above tables.
   Builders in client/pay-band-chart.js. Signed off 2026-09-15.
   Chart colour is the RAG palette because in/below/above IS the data semantic
   (same exception the nationality charts use); no indigo on data. */
/* No chrome of its own: the split main pane is already the card, and a bordered
   wrapper inside it read as a box in a box. */
.pbc-wrap { background: transparent; border: none; padding: 0; }
.pbc-svg { width: 100%; height: auto; display: block; font-family: var(--font-sans); }
.pbc-svg text { font-size: 10.5px; fill: var(--gray-500); }
.pbc-svg .pbc-ylabel { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.pbc-svg .pbc-ytick { font-variant-numeric: tabular-nums; }
.pbc-svg .pbc-xlabel { font-size: 11px; fill: var(--gray-700); font-weight: 500; }
.pbc-svg .pbc-xcount { font-size: 9.5px; }
.pbc-svg .pbc-grid { stroke: var(--gray-200); stroke-width: 1; }
/* Same tint as the span-of-control target zone (rgba 34,197,94 @ .12 / .35) so a
   target band reads the same wherever it appears. */
.pbc-svg .pbc-band { fill: var(--zone-target-fill); stroke: var(--zone-target-edge); stroke-width: 1; }
.pbc-svg .pbc-mid { stroke: var(--zone-target-edge); stroke-width: 1; stroke-dasharray: 3 3; }
.pbc-svg .pbc-band-label { font-size: 10px; fill: var(--brand-green-700); font-weight: 600; }
.pbc-dot { stroke: white; stroke-width: 1; transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.pbc-svg .pbc-xlabel, .pbc-svg .pbc-xcount, .pbc-note { transition: opacity 0.18s ease; }
@media (prefers-reduced-motion: reduce) { .pbc-dot, .pbc-svg .pbc-xlabel, .pbc-svg .pbc-xcount, .pbc-note { transition: none; } }
.pbc-dot--in { fill: var(--brand-green-500); }
.pbc-dot--below { fill: var(--brand-amber-500); cursor: pointer; }
.pbc-dot--above { fill: var(--brand-red-500); cursor: pointer; }
.pbc-dot--unscored { fill: var(--gray-400); }
.pbc-dot--below:hover, .pbc-dot--above:hover,
.pbc-dot--below:focus-visible, .pbc-dot--above:focus-visible { stroke: var(--gray-900); stroke-width: 1.5; outline: none; }
.pbc-note { margin: 0.6rem 0 0; font-size: 11.5px; color: var(--gray-500); }
.pbc-note strong { color: var(--gray-700); font-weight: 600; }
.pbc-key { width: 10px; height: 7px; border-radius: 2px; display: inline-block; }
.pbc-key--in { background: var(--brand-green-500); }
.pbc-key--below { background: var(--brand-amber-500); }
.pbc-key--above { background: var(--brand-red-500); }
.pbc-key--unscored { background: var(--gray-400); }

/* The Group-by toggle sits in the lens toolbar slot, immediately left of the
   `?` button. Both carry margin-left:auto by default, which would split the
   free space between them; the toggle takes it and the button follows. */
.pbc-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 0.6rem; margin: 0 0 0.6rem; }
.rewards-v2-drill-mode .lens-section-head .pbc-toolbar { margin: 0 0 0 auto; display: inline-flex; }
.rewards-v2-drill-mode .lens-section-head .pbc-toolbar + .insights-btn--lens { margin-left: 0; }
.pbc-toolbar-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-500); font-weight: 600; }

/* Outlier tables — chrome only, same rule as .tt-*. */
.tt-cell-sub { display: block; font-size: 11px; color: var(--gray-500); font-weight: 400; }
.tt-table td.cell-warn { color: var(--brand-amber-600); font-weight: var(--font-semibold); }

@media (max-width: 640px) {
    .rewards-v2-drill-mode .lens-section-head { flex-wrap: wrap; }
    .rewards-v2-drill-mode .lens-section-head .pbc-toolbar { margin-left: 0; width: 100%; order: 3; }
}
.stat-red { color: var(--brand-red-600); }

/* EoS Liability — by-tenure donut layout + retirement grid */
.eos-tenure-wrap {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 2fr;
    gap: 1.5rem;
    align-items: center;
}
@media (max-width: 800px) { .eos-tenure-wrap { grid-template-columns: 1fr; } }
.eos-tenure-donut { display: flex; align-items: center; justify-content: center; }
.eos-tenure-cohorts { display: flex; flex-direction: column; gap: 0.6rem; }
.eos-cohort {
    background: white;
    border: 1px solid var(--gray-100);
    border-left: 4px solid var(--gray-300);
    border-radius: 8px;
    padding: 0.75rem 0.95rem;
}
.eos-cohort-young { border-left-color: var(--gray-300); }
.eos-cohort-mid { border-left-color: var(--brand-amber-500); }
.eos-cohort-senior { border-left-color: var(--brand-red-500); }
.eos-cohort-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--gray-700); }
.eos-cohort-label { font-weight: 600; color: var(--gray-900); }
.eos-cohort-count { color: var(--gray-500); }
.eos-cohort-amount { font-size: 18px; font-weight: 700; color: var(--gray-900); margin-top: 0.2rem; font-variant-numeric: tabular-nums; }
.eos-cohort-pct { font-size: 11px; color: var(--gray-500); margin-top: 0.1rem; }

.eos-retirement-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.6rem;
    margin: 0.5rem 0 0.75rem;
}
@media (max-width: 800px) { .eos-retirement-grid { grid-template-columns: repeat(3, 1fr); } }
.eos-year-card {
    background: white;
    border: 1px solid var(--gray-100);
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    text-align: center;
}
.eos-year-this { border-color: var(--brand-red-300, var(--brand-red-200)); background: var(--brand-red-50, var(--brand-red-100)); }
.eos-year-next { border-color: var(--brand-amber-300, var(--brand-amber-200)); background: var(--brand-amber-50, var(--brand-amber-100)); }
.eos-year-empty { opacity: 0.55; }
/* EoS › Employee lens: search bar and date field on one baseline; the person line; muted period cells. */
.eos-lookup { display: grid; grid-template-columns: 1fr 220px; gap: 4px 14px; align-items: start; margin-bottom: 14px; }
.eos-lookup .form-group { margin: 0; }
.eos-lookup .form-group .search-bar { margin: 0; }
/* Both controls sit on one row under their labels at the search bar's 38px; the hint runs under the row. */
.eos-lookup input[type="date"] { padding: 8px 12px; font-size: 14px; line-height: 1.4; }
.eos-lookup .form-hint { grid-column: 1 / -1; margin: 0; }
.eos-person { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; font-size: 12.5px; color: var(--gray-600); margin: 4px 0 12px; }
.eos-person .nm { font-size: 15px; font-weight: var(--font-semibold); color: var(--gray-900); }
.eos-person-open { background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.eos-person-open:hover, .eos-person-open:focus-visible { text-decoration: underline; color: var(--primary-color); outline: none; }
.eos-schedule td.muted { color: var(--gray-500); }
@media (max-width: 640px) { .eos-lookup { grid-template-columns: 1fr; } }
/* Neutral emphasis for the current year on the rebuilt (stated, not scored) card: border only, no tint. */
.eos-year-current { border-color: var(--gray-400); }
.eos-year-label { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.eos-year-count { font-size: 11px; color: var(--gray-600); margin: 0.15rem 0; }
.eos-year-amount { font-size: 13px; font-weight: 600; color: var(--gray-900); font-variant-numeric: tabular-nums; }

/* Workforce Headcount — distribution rows */
.hc-list { display: flex; flex-direction: column; gap: 0.5rem; }
.hc-row {
    background: white;
    border: 1px solid var(--gray-100);
    border-radius: 8px;
    overflow: hidden;
}
.hc-row-head {
    display: grid;
    grid-template-columns: 14px 1.4fr 1fr 2fr auto auto auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.65rem 0.9rem;
    cursor: pointer;
    font-size: 12.5px;
}
.hc-row-flat .hc-row-head { cursor: default; }
.hc-row-flat .hc-row-head { grid-template-columns: 1.6fr 1fr 2fr auto auto auto; }
.hc-row-head:hover { background: var(--gray-50); }
.hc-chev { color: var(--gray-400); font-size: 11px; transition: transform 0.15s; }
.hc-row.expanded .hc-chev { transform: rotate(90deg); }
.hc-name { font-weight: 600; color: var(--gray-900); }
.hc-meta { font-size: 11px; color: var(--gray-500); }
.hc-bar { height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; }
.hc-bar-fill { height: 100%; background: var(--brand-indigo-500); border-radius: 3px; }
.hc-bar-sub { background: var(--gray-200); }
.hc-bar-sub .hc-bar-fill { background: var(--brand-indigo-300); }
.hc-num { font-variant-numeric: tabular-nums; color: var(--gray-900); }
.hc-pct { font-variant-numeric: tabular-nums; color: var(--gray-500); font-size: 11.5px; }
.hc-sub-list { display: none; border-top: 1px solid var(--gray-100); background: var(--gray-50); }
.hc-row.expanded .hc-sub-list { display: block; }
.hc-sub-row {
    display: grid;
    grid-template-columns: 1.6fr 2fr auto auto auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.5rem 0.9rem 0.5rem 1.6rem;
    font-size: 12px;
    border-top: 1px solid var(--gray-100);
}
.hc-sub-row:first-child { border-top: none; }
.hc-sub-name { color: var(--gray-700); }

/* Headcount view toggle (List / Sunburst) — sits in the lens-section head. */
.hc-view-toggle {
    display: inline-flex;
    background: var(--gray-100);
    padding: 2px;
    border-radius: 6px;
    margin-left: auto;
    margin-right: 0.5rem;
}
.hc-view-btn {
    background: none;
    border: none;
    padding: 0.35rem 0.75rem;
    font-size: 12px;
    color: var(--gray-600);
    cursor: pointer;
    border-radius: 4px;
    font-family: inherit;
    font-weight: 500;
}
.hc-view-btn:hover { color: var(--gray-900); }
.hc-view-btn.active {
    background: white;
    color: var(--gray-900);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* Reporting Depth — By layer horizontal bars */
.rd-layer-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.rd-layer-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.35rem 0;
}
.rd-layer-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
}
.rd-layer-bar-track {
    height: 22px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}
.rd-layer-bar-fill {
    height: 100%;
    background: var(--brand-indigo-500);
    border-radius: 4px;
    transition: width 0.25s ease;
}
.rd-layer-count {
    font-size: 12px;
    color: var(--gray-700);
    font-variant-numeric: tabular-nums;
    min-width: 100px;
    text-align: right;
}
.rd-layer-count strong {
    color: var(--gray-900);
    font-weight: 700;
}

/* Grade Pyramid tier colours — senior tapering to line */
.rd-layer-bar-fill.gp-fill-senior { background: var(--brand-indigo-600); }
.rd-layer-bar-fill.gp-fill-mid    { background: var(--brand-indigo-400); }
.rd-layer-bar-fill.gp-fill-line   { background: var(--brand-indigo-300); }
.gp-list .rd-layer-row { padding: 0.3rem 0; }

/* Headcount Sunburst — 3-col grid: explanation · chart · legend */
.hc-sb-metric-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}
.hc-sb-metric-toggle {
    display: inline-flex;
    background: var(--gray-100);
    padding: 2px;
    border-radius: 6px;
}
.hc-sb-metric-btn {
    background: none;
    border: none;
    padding: 0.35rem 0.85rem;
    font-size: 12px;
    color: var(--gray-600);
    cursor: pointer;
    border-radius: 4px;
    font-family: inherit;
    font-weight: 500;
}
.hc-sb-metric-btn:hover { color: var(--gray-900); }
.hc-sb-metric-btn.active {
    background: white;
    color: var(--gray-900);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
/* Explainer rail · chart · info rail.
   The rails were hard 240px each, so they ate a fixed 480px of whatever pane they
   were in. At a 900px evidence pane that leaves the chart ~380px; with the insights
   drawer open and the pane near 600px it leaves ~80px, and the viewport media query
   below never fires because the WINDOW has not changed size. Proportional rails with
   a 150px floor mean the chart keeps the majority of the pane at every width. */
.hc-sunburst-wrap {
    display: grid;
    grid-template-columns: minmax(150px, 0.75fr) minmax(0, 2fr) minmax(150px, 0.75fr);
    gap: 1.25rem;
    align-items: start;
}
@media (max-width: 1100px) { .hc-sunburst-wrap { grid-template-columns: 1fr; } }
.hc-sb-explain {
    font-size: 12.5px;
    color: var(--gray-700);
    line-height: 1.55;
}
.hc-sb-explain-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.5rem;
}
.hc-sb-explain p { margin: 0.5rem 0; }
.hc-sb-explain strong { color: var(--gray-900); font-weight: 600; }
.hc-sb-explain-fact {
    margin-top: 0.75rem;
    padding: 0.55rem 0.7rem;
    background: var(--brand-indigo-50);
    border-left: 2px solid var(--brand-indigo-400);
    border-radius: 4px;
    font-size: 12px;
    color: var(--gray-800);
}
.hc-sb-explain-fact strong { color: var(--brand-indigo-700); }
.hc-sunburst {
    width: 100%;
    /* Raised from 480px now the rails shrink and the centre column can actually get
       wide. Still capped — a donut past this size adds diameter, not information. */
    max-width: 560px;
    height: auto;
    margin: 0 auto;
    display: block;
}
.hc-sunburst path { transition: opacity 0.15s; }
.hc-sunburst:hover path { opacity: 0.7; }
.hc-sunburst path:hover { opacity: 1 !important; }
.hc-sunburst text { transition: opacity 0.2s ease-out; }
.hc-sunburst text.hc-sb-fade-out { opacity: 0; }
/* Right-side info card (replaces legend) */
.hc-sb-info {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 1rem 1.1rem;
    align-self: start;
}
.hc-sb-info-empty {
    font-size: 12.5px;
    color: var(--gray-500);
    text-align: center;
    padding: 2rem 0.5rem;
}
.hc-sb-info-eyebrow {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 0.25rem;
}
.hc-sb-info-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 0.85rem;
    letter-spacing: -0.005em;
}
.hc-sb-info-section {
    padding-top: 0.7rem;
    margin-top: 0.7rem;
    border-top: 1px solid var(--gray-100);
}
.hc-sb-info-section:first-of-type { padding-top: 0; margin-top: 0; border-top: none; }
.hc-sb-info-section-head {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.25rem;
}
.hc-sb-info-big {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.hc-sb-info-pct { font-size: 14px; color: var(--gray-500); font-weight: 500; margin-left: 0.15rem; }
.hc-sb-info-raw {
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 0.15rem;
}
.hc-sb-info-raw strong { color: var(--gray-900); font-weight: 600; }
.hc-sb-info-narrative {
    font-size: 11.5px;
    color: var(--gray-600);
    margin-top: 0.4rem;
    line-height: 1.5;
}
.hc-sb-info-narrative strong { color: var(--gray-900); font-weight: 600; }

/* ============================================================
 * Workforce — Span of Control v2 chrome (spec §11 dept-detail pattern)
 * ============================================================ */

/* Division dropdown + dept chip strip */
.rewards-v2-drill-mode .soc-filter-row { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.rewards-v2-drill-mode .soc-filter-label { font-size: 11.5px; color: var(--gray-500); font-weight: 500; }
.rewards-v2-drill-mode .soc-filter-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; flex: 1; }
.rewards-v2-drill-mode .soc-chip {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.75rem; border-radius: 999px;
    background: white; border: 1px solid var(--gray-200);
    font-size: 12.5px; color: var(--gray-700); cursor: pointer;
    transition: all 0.15s; font-family: inherit;
}
.rewards-v2-drill-mode .soc-chip:hover { border-color: var(--brand-indigo-300); background: var(--gray-50); }
.rewards-v2-drill-mode .soc-chip.active { background: var(--brand-indigo-600); color: white; border-color: var(--brand-indigo-600); }
.rewards-v2-drill-mode .soc-chip.active .soc-chip-dot { box-shadow: 0 0 0 2px white; }
.rewards-v2-drill-mode .soc-chip-dot { width: 8px; height: 8px; border-radius: 50%; }
.rewards-v2-drill-mode .soc-chip-dot.green { background: var(--brand-green-500); }
.rewards-v2-drill-mode .soc-chip-dot.amber { background: var(--brand-amber-500); }
.rewards-v2-drill-mode .soc-chip-dot.red   { background: var(--brand-red-500); }
.rewards-v2-drill-mode .soc-chip-dot.gray  { background: var(--gray-400); }

/* Selected dept header */
.rewards-v2-drill-mode .soc-dept-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 0.85rem; flex-wrap: wrap; }
.rewards-v2-drill-mode .soc-dept-name { font-size: 20px; font-weight: 700; color: var(--gray-900); letter-spacing: -0.005em; }
.rewards-v2-drill-mode .soc-dept-name-meta { font-size: 12.5px; color: var(--gray-500); font-weight: 500; margin-left: 0.45rem; }
.rewards-v2-drill-mode .soc-dept-status {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.3rem 0.75rem; border-radius: 999px;
    font-size: 11.5px; font-weight: 600;
}
.rewards-v2-drill-mode .soc-dept-status.red   { background: var(--brand-red-100);   color: var(--brand-red-800); }
.rewards-v2-drill-mode .soc-dept-status.amber { background: var(--brand-amber-100); color: var(--brand-amber-800); }
.rewards-v2-drill-mode .soc-dept-status.green { background: var(--brand-green-100); color: var(--brand-green-800); }
.rewards-v2-drill-mode .soc-dept-status.gray  { background: var(--gray-100);        color: var(--gray-700); }

/* Distribution + stats row */
.rewards-v2-drill-mode .soc-dept-row {
    display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; margin-bottom: 1.2rem;
}
@media (max-width: 900px) { .rewards-v2-drill-mode .soc-dept-row { grid-template-columns: 1fr; } }
.rewards-v2-drill-mode .soc-dist-card,
.rewards-v2-drill-mode .soc-stats-card,
.rewards-v2-drill-mode .soc-card-title {
    font-size: 11.5px; color: var(--gray-500); font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 0.55rem;
}
.rewards-v2-drill-mode .soc-dist-bar { display: flex; height: 30px; border-radius: 6px; overflow: hidden; border: 1px solid var(--gray-200); }
.rewards-v2-drill-mode .soc-dist-seg { display: flex; align-items: center; justify-content: center; color: white; font-size: 12px; font-weight: 600; }
.rewards-v2-drill-mode .soc-dist-seg.green  { background: var(--brand-green-500); }
.rewards-v2-drill-mode .soc-dist-seg.amber  { background: var(--brand-amber-500); }
.rewards-v2-drill-mode .soc-dist-seg.orange { background: #f97316; }
.rewards-v2-drill-mode .soc-dist-seg.red    { background: var(--brand-red-500); }
.rewards-v2-drill-mode .soc-dist-legend { display: flex; gap: 0.85rem; margin-top: 0.55rem; font-size: 11px; color: var(--gray-600); flex-wrap: wrap; }
.rewards-v2-drill-mode .soc-dist-legend-dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 0.25rem; vertical-align: middle; }
.rewards-v2-drill-mode .soc-stats-card { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.rewards-v2-drill-mode .soc-stat { display: flex; flex-direction: column; gap: 0.1rem; }
.rewards-v2-drill-mode .soc-stat-label { font-size: 10.5px; color: var(--gray-500); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.rewards-v2-drill-mode .soc-stat-value { font-size: 18px; font-weight: 700; color: var(--gray-900); font-variant-numeric: tabular-nums; }
.rewards-v2-drill-mode .soc-stat-value.green { color: var(--brand-green-600); }
.rewards-v2-drill-mode .soc-stat-value.amber { color: var(--brand-amber-600); }
.rewards-v2-drill-mode .soc-stat-value.red   { color: var(--brand-red-600); }

/* Org chart */

/* Simulator panel */
.rewards-v2-drill-mode .soc-opp-list { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.45rem; }
.rewards-v2-drill-mode .soc-opp-row {
    background: var(--gray-50); border: 1px solid var(--gray-100);
    border-radius: 6px; padding: 0.65rem 0.85rem;
    display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem; align-items: center;
    font-size: 12.5px; color: var(--gray-700);
}
.rewards-v2-drill-mode .soc-opp-row strong { color: var(--gray-900); font-weight: 600; }
.rewards-v2-drill-mode .soc-opp-icon { color: var(--brand-amber-500); font-size: 14px; }

/* Recommended actions card */
.rewards-v2-drill-mode .soc-actions-card {
    background: var(--brand-amber-50, #fffbeb); border: 1px solid var(--brand-amber-100);
    border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1.2rem;
}
.rewards-v2-drill-mode .soc-actions-head { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.65rem; }
.rewards-v2-drill-mode .soc-actions-title { font-size: 14px; font-weight: 600; color: var(--gray-900); margin: 0; }
.rewards-v2-drill-mode .soc-actions-list { display: flex; flex-direction: column; gap: 0.55rem; list-style: none; padding: 0; margin: 0; }
.rewards-v2-drill-mode .soc-actions-item { display: grid; grid-template-columns: 24px 1fr; gap: 0.6rem; align-items: flex-start; font-size: 12.5px; color: var(--gray-700); line-height: 1.55; }
.rewards-v2-drill-mode .soc-actions-item strong { color: var(--gray-900); font-weight: 600; }
.rewards-v2-drill-mode .soc-actions-num { width: 22px; height: 22px; border-radius: 50%; background: var(--brand-amber-500); color: white; font-size: 11px; font-weight: 700; display: grid; place-items: center; margin-top: 0.05rem; }

/* By-manager list row */
.rewards-v2-drill-mode .soc-list { display: flex; flex-direction: column; gap: 0.45rem; }
.rewards-v2-drill-mode .soc-row {
    background: white; border: 1px solid var(--gray-200); border-radius: 8px;
    padding: 0.7rem 0.9rem;
    display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 0.7rem; align-items: center;
    cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.rewards-v2-drill-mode .soc-row:hover { border-color: var(--brand-indigo-300); background: var(--gray-50); }
.rewards-v2-drill-mode .soc-row-dot { width: 10px; height: 10px; border-radius: 50%; }
.rewards-v2-drill-mode .soc-row-dot.green  { background: var(--brand-green-500); }
.rewards-v2-drill-mode .soc-row-dot.amber  { background: var(--brand-amber-500); }
.rewards-v2-drill-mode .soc-row-dot.orange { background: #f97316; }
.rewards-v2-drill-mode .soc-row-dot.red    { background: var(--brand-red-500); }
.rewards-v2-drill-mode .soc-row-name { font-weight: 600; color: var(--gray-900); font-size: 13.5px; }
.rewards-v2-drill-mode .soc-row-meta { font-size: 11.5px; color: var(--gray-500); margin-top: 0.1rem; }
.rewards-v2-drill-mode .soc-row-stat {
    font-size: 13px; font-weight: 600; color: var(--gray-900); font-variant-numeric: tabular-nums;
    background: var(--gray-100); padding: 0.25rem 0.5rem; border-radius: 4px;
}
.rewards-v2-drill-mode .soc-row-stat.green { background: var(--brand-green-100); color: var(--brand-green-800); }
.rewards-v2-drill-mode .soc-row-stat.amber { background: var(--brand-amber-100); color: var(--brand-amber-800); }
.rewards-v2-drill-mode .soc-row-stat.red   { background: var(--brand-red-100);   color: var(--brand-red-800); }
.rewards-v2-drill-mode .soc-row-chev { color: var(--gray-400); }

/* Darker box backgrounds across Rewards drill-ins — applied to card-shaped surfaces.
   Note: .headline-block is intentionally excluded — it's flat by design as of 2026-07-08
   (spec §2 compact headline). Keeping it here would re-add the card chrome. */
.rewards-v2-drill-mode .l1-metric,
.rewards-v2-drill-mode .narrative-card,
.rewards-v2-drill-mode .eos-cohort,
.rewards-v2-drill-mode .eos-year-card,
.rewards-v2-drill-mode .gc-list .card-l3-mgr-card {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

/* ════════════════════════════════════════════════════════════════════
 * Span of Control v4 — Phase 2: prerequisite gate
 * Setup wall (.soc-v4-setup-wall) + soft-warn banner (.soc-v4-soft-warn-banner).
 * Approved as new variants 2026-06-26. To be registered in docs/ui-elements.md
 * and docs/ux-patterns.md at Phase 8.
 * ════════════════════════════════════════════════════════════════════ */

.rewards-v2-drill-mode .soc-v4-setup-wall,
.people-v2-drill-mode .soc-v4-setup-wall {
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 1.5rem 1.75rem;
    max-width: 720px;
    margin: 1rem auto;
}
.rewards-v2-drill-mode .soc-v4-setup-head,
.people-v2-drill-mode .soc-v4-setup-head {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.rewards-v2-drill-mode .soc-v4-setup-icon,
.people-v2-drill-mode .soc-v4-setup-icon {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--brand-amber-50);
    color: var(--brand-amber-600);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.rewards-v2-drill-mode .soc-v4-setup-title,
.people-v2-drill-mode .soc-v4-setup-title {
    font-size: 1rem; font-weight: 600; color: var(--gray-900);
}
.rewards-v2-drill-mode .soc-v4-setup-sub,
.people-v2-drill-mode .soc-v4-setup-sub {
    font-size: 0.8rem; color: var(--gray-600);
    margin-top: 2px;
}
.rewards-v2-drill-mode .soc-v4-setup-list,
.people-v2-drill-mode .soc-v4-setup-list {
    display: flex; flex-direction: column; gap: 0.55rem;
}
.rewards-v2-drill-mode .soc-v4-check-row,
.people-v2-drill-mode .soc-v4-check-row {
    display: grid;
    grid-template-columns: 26px 1fr auto;
    gap: 0.65rem; align-items: center;
    padding: 0.85rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
}
.rewards-v2-drill-mode .soc-v4-check-row.blocks,
.people-v2-drill-mode .soc-v4-check-row.blocks {
    background: var(--brand-red-50);
    border-color: var(--brand-red-100);
}
.rewards-v2-drill-mode .soc-v4-check-row.degrades,
.people-v2-drill-mode .soc-v4-check-row.degrades {
    background: var(--brand-amber-50);
    border-color: var(--brand-amber-100);
}
.rewards-v2-drill-mode .soc-v4-check-icon,
.people-v2-drill-mode .soc-v4-check-icon {
    width: 24px; height: 24px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; color: white;
    background: var(--gray-400);
}
.rewards-v2-drill-mode .soc-v4-check-row.blocks .soc-v4-check-icon,
.people-v2-drill-mode .soc-v4-check-row.blocks .soc-v4-check-icon { background: var(--brand-red-500); }
.rewards-v2-drill-mode .soc-v4-check-row.degrades .soc-v4-check-icon,
.people-v2-drill-mode .soc-v4-check-row.degrades .soc-v4-check-icon { background: var(--brand-amber-500); }
.rewards-v2-drill-mode .soc-v4-check-body,
.people-v2-drill-mode .soc-v4-check-body { line-height: 1.4; }
.rewards-v2-drill-mode .soc-v4-check-label,
.people-v2-drill-mode .soc-v4-check-label {
    font-size: 0.82rem; font-weight: 600; color: var(--gray-900);
}
.rewards-v2-drill-mode .soc-v4-check-tag,
.people-v2-drill-mode .soc-v4-check-tag {
    display: inline-block; margin-left: 0.4rem;
    font-size: 0.58rem; font-weight: 700;
    padding: 1px 6px; border-radius: 9px; color: white;
    letter-spacing: 0.04em;
}
.rewards-v2-drill-mode .soc-v4-check-tag.blocks,
.people-v2-drill-mode .soc-v4-check-tag.blocks { background: var(--brand-red-500); }
.rewards-v2-drill-mode .soc-v4-check-tag.degrades,
.people-v2-drill-mode .soc-v4-check-tag.degrades { background: var(--brand-amber-500); }
.rewards-v2-drill-mode .soc-v4-check-sub,
.people-v2-drill-mode .soc-v4-check-sub {
    font-size: 0.72rem; color: var(--gray-600);
    margin-top: 2px;
}
.rewards-v2-drill-mode .soc-v4-check-cta,
.people-v2-drill-mode .soc-v4-check-cta {
    background: var(--gray-900); color: white;
    padding: 5px 11px;
    border-radius: 4px;
    font-size: 0.74rem; font-weight: 600;
    border: none; cursor: pointer;
    white-space: nowrap;
}
.rewards-v2-drill-mode .soc-v4-check-cta:hover,
.people-v2-drill-mode .soc-v4-check-cta:hover { background: var(--gray-700); }

/* Soft-warn banner (one per warn item, stacked above the analysis) */
.rewards-v2-drill-mode .soc-v4-soft-warn-banner {
    display: flex; align-items: center; gap: 0.55rem;
    background: var(--brand-amber-50);
    border: 1px solid var(--brand-amber-100);
    border-left: 3px solid var(--brand-amber-500);
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    margin-bottom: 0.6rem;
    font-size: 0.82rem; color: var(--gray-700);
}
.rewards-v2-drill-mode .soc-v4-soft-warn-banner svg {
    color: var(--brand-amber-600); flex-shrink: 0;
}
.rewards-v2-drill-mode .soc-v4-soft-warn-banner strong {
    color: var(--gray-900); font-weight: 600;
}
.rewards-v2-drill-mode .soc-v4-soft-warn-cta {
    margin-left: auto;
    color: var(--brand-amber-600); font-weight: 600;
    cursor: pointer; text-decoration: none;
    white-space: nowrap;
}
.rewards-v2-drill-mode .soc-v4-soft-warn-cta:hover { text-decoration: underline; }

/* ──────── SoC v4 Phase 4 — overview dept cards ──────── */
.rewards-v2-drill-mode .soc-v4-dept-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.rewards-v2-drill-mode .soc-v4-dept-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem 1rem 0.85rem;
    text-align: left;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    font-family: inherit;
}
.rewards-v2-drill-mode .soc-v4-dept-card:hover {
    border-color: var(--gray-400);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.rewards-v2-drill-mode .soc-v4-dept-card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.rewards-v2-drill-mode .soc-v4-dept-name {
    font-size: 0.95rem; font-weight: 600; color: var(--gray-900);
}
.rewards-v2-drill-mode .soc-v4-dept-target {
    font-size: 0.7rem; color: var(--gray-500);
    margin-bottom: 0.55rem;
}
.rewards-v2-drill-mode .soc-v4-dept-dots {
    display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
    margin-bottom: 0.45rem;
    min-height: 14px;
}
.rewards-v2-drill-mode .soc-v4-dot {
    width: 10px; height: 10px; border-radius: 50%;
    display: inline-block;
    background: var(--gray-300);
}
.rewards-v2-drill-mode .soc-v4-dot.in-range { background: var(--brand-green-500); }
.rewards-v2-drill-mode .soc-v4-dot.below    { background: var(--brand-amber-500); }
.rewards-v2-drill-mode .soc-v4-dot.above    { background: var(--brand-amber-500); }
.rewards-v2-drill-mode .soc-v4-dot.critical { background: var(--brand-red-500); }
.rewards-v2-drill-mode .soc-v4-dot-overflow {
    font-size: 0.65rem; color: var(--gray-500);
    font-weight: 500; margin-left: 4px;
}
.rewards-v2-drill-mode .soc-v4-dept-stats {
    display: flex; justify-content: space-between;
    font-size: 0.72rem; color: var(--gray-600);
    padding: 0.4rem 0; margin-bottom: 0.35rem;
    border-top: 1px solid var(--gray-100);
    border-bottom: 1px solid var(--gray-100);
}
.rewards-v2-drill-mode .soc-v4-dept-stats strong { color: var(--gray-900); font-weight: 600; }
.rewards-v2-drill-mode .soc-v4-dept-headline {
    font-size: 0.8rem; color: var(--gray-700); margin-bottom: 0.35rem;
}
.rewards-v2-drill-mode .soc-v4-dept-headline strong { color: var(--gray-900); font-weight: 600; }
.rewards-v2-drill-mode .soc-v4-dept-headline.soc-v4-dept-healthy {
    color: var(--brand-green-600); font-weight: 500;
}
.rewards-v2-drill-mode .soc-v4-savings { color: var(--brand-green-600); font-weight: 600; }
.rewards-v2-drill-mode .soc-v4-dept-tiers {
    display: flex; gap: 4px; flex-wrap: wrap;
}
.rewards-v2-drill-mode .soc-v4-tier-pill {
    font-size: 0.62rem; font-weight: 700; padding: 1px 6px; border-radius: 9px;
    color: white;
}
.rewards-v2-drill-mode .soc-v4-tier-pill.t1 { background: var(--brand-green-500); }
.rewards-v2-drill-mode .soc-v4-tier-pill.t2 { background: var(--brand-amber-500); }
.rewards-v2-drill-mode .soc-v4-tier-pill.t25 { background: var(--brand-amber-600); }
.rewards-v2-drill-mode .soc-v4-tier-pill.t3 { background: var(--brand-teal-500); }
.rewards-v2-drill-mode .soc-v4-dept-chevron {
    position: absolute; bottom: 8px; right: 10px;
    color: var(--gray-400); font-size: 1.1rem; line-height: 1;
    pointer-events: none;
}

/* ──────── SoC v4 Phase 5 — per-dept drill-in chrome ──────── */
.rewards-v2-drill-mode .soc-v4-drill-head {
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 1rem;
}
.rewards-v2-drill-mode .soc-v4-drill-title {
    font-size: 0.9rem; font-weight: 600; color: var(--gray-700);
}
.rewards-v2-drill-mode .soc-v4-drill-body {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.25rem;
    margin-top: 1rem;
}
@media (max-width: 1100px) {
    .rewards-v2-drill-mode .soc-v4-drill-body {
        grid-template-columns: 1fr;
    }
}
.rewards-v2-drill-mode .soc-v4-drill-tree-wrap {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    position: relative;
    overflow-x: auto;
    min-height: 480px;
}
.rewards-v2-drill-mode .soc-v4-drill-tree {
    display: flex; flex-direction: column;
    justify-content: center; align-items: stretch;
    min-height: 100%;
}
.rewards-v2-drill-mode .soc-v4-arrows {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 5;
}
.rewards-v2-drill-mode .soc-v4-drill-side {
    display: flex; flex-direction: column; gap: 0.85rem;
}

/* ──────── .soc-card-ribbon (approved new variant 2026-06-26) ──────── */
.rewards-v2-drill-mode .soc-org-card.has-ribbon {
    height: auto;
    min-height: 94px;
    padding-top: 26px;
    position: relative;
}
.rewards-v2-drill-mode .soc-card-ribbon {
    position: absolute; top: 0; left: 0; right: 0;
    height: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; font-weight: 700;
    color: white;
    letter-spacing: 0.04em;
}
.rewards-v2-drill-mode .soc-card-ribbon.t1 { background: var(--brand-green-500); }
.rewards-v2-drill-mode .soc-card-ribbon.t2 { background: var(--brand-amber-500); }
.rewards-v2-drill-mode .soc-card-ribbon.t25 { background: var(--brand-amber-600); }
.rewards-v2-drill-mode .soc-card-ribbon.t3 { background: var(--brand-teal-500); }
.rewards-v2-drill-mode .soc-card-ribbon.removed { background: var(--gray-500); }
.rewards-v2-drill-mode .soc-org-card.is-removed {
    background: var(--gray-50);
    border-color: var(--gray-300);
    opacity: 0.78;
}
.rewards-v2-drill-mode .soc-org-card.is-removed .soc-card-name {
    color: var(--gray-600);
}

/* ──────── SoC v4 Phase 6 — view toggle + flow view + trace ──────── */
.rewards-v2-drill-mode .soc-v4-drill-head-spacer { flex: 1; }
.rewards-v2-drill-mode .soc-v4-view-toggle {
    display: inline-flex; gap: 2px; padding: 2px;
    background: var(--gray-100); border-radius: 14px;
}
.rewards-v2-drill-mode .soc-v4-view-toggle button {
    border: none; background: transparent;
    padding: 5px 14px; border-radius: 12px;
    font-size: 0.72rem; font-weight: 500;
    color: var(--gray-600); cursor: pointer;
    transition: all 0.15s;
}
.rewards-v2-drill-mode .soc-v4-view-toggle button.active {
    background: white; color: var(--gray-900);
    box-shadow: var(--shadow-xs);
    font-weight: 600;
}
.rewards-v2-drill-mode .soc-v4-export {
    font-size: 0.78rem; padding: 0.4rem 0.85rem;
}

/* — Flow view (sankey-style left/right columns) — */
.rewards-v2-drill-mode .soc-v4-flow-wrap {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 480px;
}
.rewards-v2-drill-mode .soc-v4-flow-cols {
    display: grid;
    grid-template-columns: 1fr 80px 1fr;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1.5rem;
}
.rewards-v2-drill-mode .soc-v4-flow-col {
    display: flex; flex-direction: column; gap: 4px;
}
.rewards-v2-drill-mode .soc-v4-flow-col-head {
    font-size: 0.75rem; font-weight: 600; color: var(--gray-600);
    margin-bottom: 0.45rem;
}
.rewards-v2-drill-mode .soc-v4-flow-block {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 0.65rem;
    background: white;
    border: 1px solid var(--gray-300);
    border-left: 3px solid var(--gray-400);
    border-radius: 4px;
    font-size: 0.78rem;
    transition: transform 0.2s;
}
.rewards-v2-drill-mode .soc-v4-flow-block.healthy { border-left-color: var(--brand-green-500); background: var(--brand-green-50); }
.rewards-v2-drill-mode .soc-v4-flow-block.amber   { border-left-color: var(--brand-amber-500); background: var(--brand-amber-50); }
.rewards-v2-drill-mode .soc-v4-flow-block.red     { border-left-color: var(--brand-red-500); background: var(--brand-red-50); }
.rewards-v2-drill-mode .soc-v4-flow-block.removed {
    background: var(--gray-100); border-color: var(--gray-300);
    opacity: 0.5;
}
.rewards-v2-drill-mode .soc-v4-flow-block.grew {
    box-shadow: 0 0 0 2px var(--brand-green-100);
}
.rewards-v2-drill-mode .soc-v4-flow-name {
    font-weight: 600; color: var(--gray-800);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1; min-width: 0;
}
.rewards-v2-drill-mode .soc-v4-flow-span {
    font-size: 0.7rem; font-weight: 700; color: var(--gray-700);
    margin-left: 0.5rem;
}
.rewards-v2-drill-mode .soc-v4-flow-arrows {
    display: flex; align-items: center; justify-content: center;
    padding-top: 26px;
}
.rewards-v2-drill-mode .soc-v4-flow-arrows svg { width: 100%; height: 100%; }

.rewards-v2-drill-mode .soc-v4-flow-moves {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 0.85rem 1rem;
}
.rewards-v2-drill-mode .soc-v4-flow-moves-head {
    font-size: 0.78rem; font-weight: 600; color: var(--gray-800);
    margin-bottom: 0.55rem;
}
.rewards-v2-drill-mode .soc-v4-flow-move-row {
    display: grid;
    grid-template-columns: 22px 32px 1fr auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.4rem 0.55rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.78rem; color: var(--gray-700);
}
.rewards-v2-drill-mode .soc-v4-flow-move-row:last-child { border-bottom: 0; }
.rewards-v2-drill-mode .soc-v4-flow-move-num {
    width: 22px; height: 22px;
    background: var(--gray-900); color: white;
    border-radius: 50%; font-size: 0.66rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.rewards-v2-drill-mode .soc-v4-flow-move-tier {
    font-size: 0.62rem; font-weight: 700; padding: 1px 6px; border-radius: 9px;
    color: white; text-align: center;
}
.rewards-v2-drill-mode .soc-v4-flow-move-row.tier-t1 .soc-v4-flow-move-tier { background: var(--brand-green-500); }
.rewards-v2-drill-mode .soc-v4-flow-move-row.tier-t2 .soc-v4-flow-move-tier { background: var(--brand-amber-500); }
.rewards-v2-drill-mode .soc-v4-flow-move-row.tier-t25 .soc-v4-flow-move-tier { background: var(--brand-amber-600); }
.rewards-v2-drill-mode .soc-v4-flow-move-row.tier-t3 .soc-v4-flow-move-tier { background: var(--brand-teal-500); }
.rewards-v2-drill-mode .soc-v4-flow-move-body strong { color: var(--gray-900); font-weight: 600; }
.rewards-v2-drill-mode .soc-v4-flow-move-meta { font-size: 0.7rem; color: var(--gray-500); white-space: nowrap; }
.rewards-v2-drill-mode .soc-v4-flag {
    font-size: 0.66rem;
    color: var(--brand-amber-600); margin-left: 0.4rem;
    background: var(--brand-amber-50); padding: 1px 5px; border-radius: 3px;
}
.rewards-v2-drill-mode .soc-v4-flow-empty {
    text-align: center; padding: 2rem;
    font-size: 0.85rem; color: var(--brand-green-600); font-weight: 500;
}

/* Side-title with `?` button row */
.rewards-v2-drill-mode .soc-side-title-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 0.2rem;
}
.rewards-v2-drill-mode .soc-side-title-row .soc-side-title { margin: 0; }

/* SoC v4 — persistent framing disclaimer (structural signals, not a hiring decision) */
.rewards-v2-drill-mode .soc-v4-disclaimer {
    background: var(--brand-blue-50, #eff6ff);
    border: 1px solid var(--brand-blue-100, #dbeafe);
    border-left: 3px solid var(--brand-blue-500, #3b82f6);
    padding: 0.7rem 0.9rem;
    border-radius: 6px;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--gray-700);
    margin: 0.85rem 0;
}
.rewards-v2-drill-mode .soc-v4-disclaimer strong { color: var(--gray-900); font-weight: 600; }

/* SoC v4 — "What this doesn't factor in" collapsible in sidebar */
.rewards-v2-drill-mode .soc-side-notfactored {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 0.55rem 0.85rem;
    font-size: 0.76rem;
    color: var(--gray-600);
}
.rewards-v2-drill-mode .soc-side-notfactored summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--gray-800);
    padding: 0.2rem 0;
    outline: none;
}
.rewards-v2-drill-mode .soc-side-notfactored summary:hover { color: var(--gray-900); }
.rewards-v2-drill-mode .soc-side-notfactored[open] summary { margin-bottom: 0.35rem; }
.rewards-v2-drill-mode .soc-side-notfactored ul {
    margin: 0; padding-left: 1.1rem;
    line-height: 1.5;
}
.rewards-v2-drill-mode .soc-side-notfactored li { margin-bottom: 0.35rem; }
.rewards-v2-drill-mode .soc-side-notfactored strong { color: var(--gray-800); font-weight: 600; }

/* ──────── L3 drawer — v4 plan state colouring ──────── */
/* Eyebrow renders as a coloured pill matching the chart ribbon */
#l3-drawer.l3-drawer-v4-victim .l3-drawer-eyebrow,
#l3-drawer.l3-drawer-v4-absorber .l3-drawer-eyebrow,
#l3-drawer.l3-drawer-v4-rebalance-to .l3-drawer-eyebrow,
#l3-drawer.l3-drawer-v4-rebalance-from .l3-drawer-eyebrow {
    display: inline-block !important;
    color: white;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 9px;
    margin-bottom: 0.4rem;
}
#l3-drawer.l3-drawer-v4-victim .l3-drawer-eyebrow { background: var(--gray-500); }
#l3-drawer.l3-drawer-v4-absorber .l3-drawer-eyebrow { background: var(--brand-green-500); }
#l3-drawer.l3-drawer-v4-rebalance-to .l3-drawer-eyebrow,
#l3-drawer.l3-drawer-v4-rebalance-from .l3-drawer-eyebrow { background: var(--brand-teal-500); }

/* Candidate victim — fade the title to match `is-removed` org card (no strike-through — not a decision yet) */
#l3-drawer.l3-drawer-v4-victim .l3-drawer-title {
    color: var(--gray-600);
}

/* ════════════════════════════════════════════════════════════════════
 * Span of Control v3 — dept org tree, simulator, variance chart
 * Scoped under .rewards-v2-drill-mode (the v2 drill-in chrome).
 * ════════════════════════════════════════════════════════════════════ */

/* — Tree wrap (two-column grid: org tree | sidebar stack) — */
.rewards-v2-drill-mode .soc-tree-wrap {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 1.5rem 1rem;
    min-height: 540px;
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    margin-bottom: 1rem;
}
.rewards-v2-drill-mode .soc-tree-grid {
    display: grid;
    grid-template-columns: 1fr 248px;
    gap: 1rem;
    align-items: start;
    min-height: 100%;
}
.rewards-v2-drill-mode .soc-tree-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    min-height: 500px;
    overflow-x: auto;
}
.rewards-v2-drill-mode .soc-tree-side {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
@media (max-width: 1100px) {
    .rewards-v2-drill-mode .soc-tree-wrap { min-height: 0; }
    .rewards-v2-drill-mode .soc-tree-grid { grid-template-columns: 1fr; }
}

/* — Sim panel (now lives in sidebar stack, not absolutely positioned) — */

/* — Sidebar cards (variance distribution + recommended actions) — */
.rewards-v2-drill-mode .soc-side-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    padding: 0.7rem 0.85rem 0.85rem;
}
.rewards-v2-drill-mode .soc-side-title {
    font-size: 0.78rem; font-weight: 600; color: var(--gray-800);
    margin-bottom: 0.2rem;
}
.rewards-v2-drill-mode .soc-side-sub {
    font-size: 0.66rem; color: var(--gray-500);
    margin-bottom: 0.55rem;
}
/* Mini span-distribution bar */
.rewards-v2-drill-mode .soc-mini-bar {
    display: flex; gap: 2px;
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    background: var(--gray-100);
    margin-bottom: 0.5rem;
}
.rewards-v2-drill-mode .soc-mini-seg { height: 100%; min-width: 8px; }
.rewards-v2-drill-mode .soc-mini-seg.seg-green { background: var(--brand-green-500); }
.rewards-v2-drill-mode .soc-mini-seg.seg-amber { background: var(--brand-amber-500); }
.rewards-v2-drill-mode .soc-mini-seg.seg-red   { background: var(--brand-red-500); }
.rewards-v2-drill-mode .soc-mini-counts {
    display: flex; flex-direction: column; gap: 4px;
    font-size: 0.66rem; color: var(--gray-700);
}
.rewards-v2-drill-mode .soc-mini-counts span { display: inline-flex; align-items: center; gap: 5px; }
.rewards-v2-drill-mode .soc-mini-dot {
    width: 8px; height: 8px; border-radius: 2px; display: inline-block;
}
.rewards-v2-drill-mode .soc-mini-dot.seg-green { background: var(--brand-green-500); }
.rewards-v2-drill-mode .soc-mini-dot.seg-amber { background: var(--brand-amber-500); }
.rewards-v2-drill-mode .soc-mini-dot.seg-red   { background: var(--brand-red-500); }
/* Recommended actions list */
.rewards-v2-drill-mode .soc-side-actions-list {
    margin: 0; padding-left: 1.1rem;
    font-size: 0.7rem; color: var(--gray-700); line-height: 1.45;
}
.rewards-v2-drill-mode .soc-side-actions-list li { margin-bottom: 0.5rem; }
.rewards-v2-drill-mode .soc-side-actions-list strong { color: var(--gray-900); font-weight: 600; }

/* — L3 drawer: sim-preview banners + team-row highlights — */
.soc-drawer-banner {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 12.5px;
    line-height: 1.4;
    margin: 0.5rem 0;
    border-left: 3px solid;
}
.soc-drawer-banner.consolidate {
    background: var(--brand-amber-50);
    border-left-color: var(--brand-amber-500);
    color: var(--gray-800);
}
.soc-drawer-banner.absorb {
    background: var(--brand-green-50);
    border-left-color: var(--brand-green-500);
    color: var(--gray-800);
}
.soc-drawer-team-list { display: flex; flex-direction: column; gap: 0.35rem; }
.soc-drawer-team-row {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 12.5px; color: var(--gray-700);
    padding: 0.4rem 0.55rem;
    background: var(--gray-50);
    border-radius: 6px;
    border-left: 3px solid transparent;
}
.soc-drawer-team-row strong { color: var(--gray-900); font-weight: 600; }
.soc-drawer-team-pos { color: var(--gray-500); flex: 1; font-size: 11.5px; }
.soc-drawer-team-row.moving-out {
    background: var(--brand-amber-50);
    border-left-color: var(--brand-amber-500);
    text-decoration: line-through;
    text-decoration-color: var(--brand-amber-600);
    opacity: 0.78;
}
.soc-drawer-team-row.moving-in {
    background: var(--brand-green-50);
    border-left-color: var(--brand-green-500);
}
.soc-drawer-tag {
    font-size: 10.5px; font-weight: 600;
    padding: 1px 6px; border-radius: 9px;
    background: var(--brand-amber-500); color: white;
    white-space: nowrap;
}
.soc-drawer-tag.tag-in { background: var(--brand-green-500); }
.soc-drawer-tag.tag-removed { background: var(--gray-500); }
.soc-drawer-tag.tag-rebalance { background: var(--brand-teal-500); }

/* v4 — victim (consolidation candidate) manager appearing in absorber's team list */
.soc-drawer-team-row.is-removed {
    background: var(--gray-100);
    border-left-color: var(--gray-500);
    opacity: 0.82;
}
.soc-drawer-team-row.is-removed strong {
    color: var(--gray-600);
}
.soc-drawer-team-row.is-removed .soc-drawer-team-pos {
    color: var(--gray-500);
}
/* v4 — T3 rebalance-from manager appearing in recipient's team list */
.soc-drawer-team-row.is-rebalance-from {
    background: var(--brand-teal-50, #f0fdfa);
    border-left-color: var(--brand-teal-500);
}
/* (sim panel is no longer absolutely positioned — lives in the sidebar grid) */

/* — Dropdown selector row — */
.rewards-v2-drill-mode .soc-dept-row {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    margin-bottom: 1rem;
}
.rewards-v2-drill-mode .soc-dept-wrap { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.72rem; }
.rewards-v2-drill-mode .soc-dept-label { color: var(--gray-500); font-weight: 500; }
.rewards-v2-drill-mode .soc-dept-select {
    appearance: none; -webkit-appearance: none;
    background-color: white;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    background-size: 10px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    padding: 0.35rem 1.75rem 0.35rem 0.65rem;
    font-size: 0.72rem;
    color: var(--gray-800);
    cursor: pointer;
    min-width: 160px;
}
.rewards-v2-drill-mode .soc-dept-select-primary { border-color: var(--gray-400); font-weight: 600; min-width: 220px; }
.rewards-v2-drill-mode .soc-dept-select:hover { border-color: var(--gray-400); }
.rewards-v2-drill-mode .soc-dept-select:focus { outline: none; border-color: var(--gray-600); box-shadow: 0 0 0 2px rgba(0,0,0,0.05); }

/* — CSS tree (ul/li with ::before/::after connectors) — */
.rewards-v2-drill-mode .org-tree,
.rewards-v2-drill-mode .org-tree ul {
    list-style: none; margin: 0; padding: 0;
    display: flex; align-items: flex-start; justify-content: center;
}
.rewards-v2-drill-mode .org-tree li {
    flex: 0 0 auto;
    text-align: center;
    position: relative;
    padding: 32px 8px 0;
}
.rewards-v2-drill-mode .org-tree li::before,
.rewards-v2-drill-mode .org-tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 1.5px solid var(--gray-300);
    width: 50%; height: 32px;
}
.rewards-v2-drill-mode .org-tree li::after { right: auto; left: 50%; border-left: 1.5px solid var(--gray-300); }
.rewards-v2-drill-mode .org-tree li:only-child::after,
.rewards-v2-drill-mode .org-tree li:only-child::before { display: none; }
.rewards-v2-drill-mode .org-tree li:only-child { padding-top: 32px; }
.rewards-v2-drill-mode .org-tree li:first-child::before,
.rewards-v2-drill-mode .org-tree li:last-child::after { border: 0 none; }
.rewards-v2-drill-mode .org-tree li:last-child::before { border-right: 1.5px solid var(--gray-300); border-radius: 0 5px 0 0; }
.rewards-v2-drill-mode .org-tree li:first-child::after { border-radius: 5px 0 0 0; }
.rewards-v2-drill-mode .org-tree > li:first-child::before,
.rewards-v2-drill-mode .org-tree > li:only-child::before { display: none; }
.rewards-v2-drill-mode .org-tree li > ul::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    width: 1.5px; height: 32px;
    background: var(--gray-300);
}
.rewards-v2-drill-mode .org-tree li:has(> ul) > .soc-org-card::after {
    content: '';
    position: absolute;
    bottom: -32px; left: 50%;
    width: 1.5px; height: 32px;
    background: var(--gray-300);
    transform: translateX(-50%);
}
.rewards-v2-drill-mode .org-tree ul { padding-top: 32px; position: relative; }

/* — Wide card — */
.rewards-v2-drill-mode .soc-org-card {
    display: inline-flex; flex-direction: column;
    text-align: left;
    width: 188px; height: 76px;
    padding: 8px 10px 8px 12px;
    background: white;
    border: 1px solid var(--gray-200);
    border-left: 3px solid var(--gray-300);
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: opacity 0.35s, transform 0.35s, background 0.35s, border-color 0.35s, box-shadow 0.15s;
    overflow: hidden;
    position: relative;
}
.rewards-v2-drill-mode .soc-org-card:hover {
    background-color: var(--gray-50);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round'><polyline points='9 18 15 12 9 6'/></svg>");
    background-repeat: no-repeat;
    background-position: right 6px top 6px;
    background-size: 9px;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.rewards-v2-drill-mode .soc-org-card.healthy { border-left-color: var(--brand-green-500); }
.rewards-v2-drill-mode .soc-org-card.amber   { border-left-color: var(--brand-amber-500); }
.rewards-v2-drill-mode .soc-org-card.red     { border-left-color: var(--brand-red-500); }
.rewards-v2-drill-mode .soc-org-card.neutral { border-left-color: var(--gray-400); }
.rewards-v2-drill-mode .soc-org-card.cross-dept {
    border-style: dashed; border-color: var(--brand-amber-500);
    background: var(--brand-amber-50);
}
.rewards-v2-drill-mode .soc-org-card.dept-head { border-width: 1.5px; border-color: var(--gray-900); border-left-width: 4px; }
.rewards-v2-drill-mode .soc-org-card.div-head  {
    border: 1.5px solid var(--gray-600);
    background: var(--gray-100);
    border-left: 4px solid var(--gray-600);
}
.rewards-v2-drill-mode .soc-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; line-height: 1.2; }
.rewards-v2-drill-mode .soc-card-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1; min-width: 0;
}
.rewards-v2-drill-mode .soc-card-span {
    font-size: 0.66rem; font-weight: 700; padding: 1px 5px; border-radius: 9px;
    color: white; flex-shrink: 0;
}
.rewards-v2-drill-mode .soc-card-span.healthy { background: var(--brand-green-500); }
.rewards-v2-drill-mode .soc-card-span.amber   { background: var(--brand-amber-500); }
.rewards-v2-drill-mode .soc-card-span.red     { background: var(--brand-red-500); }
.rewards-v2-drill-mode .soc-card-span.neutral { background: var(--gray-400); }
.rewards-v2-drill-mode .soc-card-title { font-size: 0.7rem; color: var(--gray-500); line-height: 1.3; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rewards-v2-drill-mode .soc-card-meta { font-size: 0.68rem; color: var(--gray-600); line-height: 1.3; margin-top: 2px; display: flex; gap: 4px; align-items: center; white-space: nowrap; overflow: hidden; }
.rewards-v2-drill-mode .soc-card-grade { color: var(--gray-700); font-weight: 500; }
.rewards-v2-drill-mode .soc-card-dept-inline {
    background: var(--brand-amber-50); color: var(--brand-amber-600);
    font-weight: 600; font-size: 0.62rem;
    padding: 0 5px; border-radius: 3px; line-height: 1.4;
}
.rewards-v2-drill-mode .soc-card-perf {
    margin-left: auto;
    background: var(--gray-100); color: var(--gray-700);
    padding: 0 4px; border-radius: 3px;
    font-size: 0.65rem; font-weight: 600;
    display: none;
}
.rewards-v2-drill-mode.show-perf .soc-card-perf { display: inline-block; }
.rewards-v2-drill-mode .soc-card-perf.high { background: var(--brand-green-100); color: var(--brand-green-700); }
.rewards-v2-drill-mode .soc-card-perf.mid  { background: var(--gray-100); color: var(--gray-700); }
.rewards-v2-drill-mode .soc-card-perf.low  { background: var(--brand-amber-50); color: var(--brand-amber-600); }

/* — Sim DOM-swap (Maya moves from Rashid branch → Marco branch) — */
@keyframes socFadeInUp {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* — Sim morph states on cards — */

/* — Move overlay (curved paths + flying employee dots) — */

/* — Variance bar chart — */
.rewards-v2-drill-mode .soc-variance-wrap {
    margin-top: 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 1rem 1.25rem 0.85rem;
    position: relative;
}
.rewards-v2-drill-mode .soc-variance-svg { width: 100%; height: 92px; display: block; }
.rewards-v2-drill-mode .soc-variance-svg .span-dot {
    cursor: pointer;
    stroke: white;
    stroke-width: 1.5;
    transition: cx 0.35s ease, opacity 0.35s ease, fill 0.35s ease;
}
.rewards-v2-drill-mode .soc-variance-svg .span-dot.dot-healthy  { fill: var(--brand-green-500); }
.rewards-v2-drill-mode .soc-variance-svg .span-dot.dot-amber    { fill: var(--brand-amber-500); }
.rewards-v2-drill-mode .soc-variance-svg .span-dot.dot-red      { fill: var(--brand-red-500); }
.rewards-v2-drill-mode .soc-variance-svg .span-dot.dot-neutral  { fill: var(--gray-600); stroke-width: 2; }
.rewards-v2-drill-mode .soc-variance-svg .span-dot.dot-cross-dept { stroke: var(--brand-amber-500); stroke-dasharray: 2,2; }
.rewards-v2-drill-mode .soc-variance-svg .span-dot.fade { opacity: 0.18; }
.rewards-v2-drill-mode .soc-variance-svg .range-band { fill: var(--brand-green-500); fill-opacity: 0.18; stroke: var(--brand-green-600); stroke-width: 1.2; }
.rewards-v2-drill-mode .soc-variance-svg .range-band-label,
.rewards-v2-drill-mode .soc-variance-svg .range-tick-label { fill: var(--brand-green-600); font-weight: 600; }
.rewards-v2-drill-mode .soc-variance-svg .axis-end-label { fill: var(--gray-400); }
.rewards-v2-drill-mode .soc-variance-svg .bar-track { fill: var(--gray-200); }
.rewards-v2-drill-mode .soc-variance-tip {
    position: absolute;
    background: var(--gray-900); color: white;
    padding: 4px 8px; border-radius: 4px;
    font-size: 0.7rem;
    pointer-events: none;
    transform: translate(-50%, -100%);
    margin-top: -6px;
    display: none;
    white-space: nowrap;
    z-index: 10;
}

/* — Move list (sim-only) — */

/* — Legend — */
.rewards-v2-drill-mode .soc-tree-legend {
    display: flex; gap: 1rem; flex-wrap: wrap;
    margin-top: 0.85rem; padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
    font-size: 0.72rem; color: var(--gray-600);
}
.rewards-v2-drill-mode .soc-tree-legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.rewards-v2-drill-mode .soc-tree-legend-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.rewards-v2-drill-mode .soc-tree-legend-dot.healthy { background: var(--brand-green-500); }
.rewards-v2-drill-mode .soc-tree-legend-dot.amber   { background: var(--brand-amber-500); }
.rewards-v2-drill-mode .soc-tree-legend-dot.red     { background: var(--brand-red-500); }
.rewards-v2-drill-mode .soc-tree-legend-dot.cross   { border: 1.5px dashed var(--brand-amber-500); background: var(--brand-amber-50); }
.rewards-v2-drill-mode .soc-tree-legend-dot.dept    { background: var(--gray-900); }
.rewards-v2-drill-mode .soc-tree-legend-dot.div     { background: var(--gray-600); }

/* ============================
 * People v2 — Phase 3 styles
 * ============================
 * Drill-in analysis view: sub-bar (back · picker · arrows · close) + body.
 * Body reuses existing card renders (L2 accordion intact during transition).
 */
.people-v2-drill-mode {
    display: block;
    animation: peopleV2FadeIn 0.2s ease;
    /* The grid-level `.people-v2-header` carried `margin-top: -1rem` to cancel the
       2rem top padding on `.comparison-results`. Inside a drill-in that header is
       hidden, so nothing cancels it any more and the drill-in sat ~1rem too low.
       Take the cancel here instead — applies to split and legacy drill-ins alike. */
    margin-top: -1rem;
}
.people-v2-drill-mode[hidden] {
    display: none;
}
@keyframes peopleV2FadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.people-v2-subbar {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    position: sticky;
    top: 60px;
    z-index: 5;
}

.people-v2-back-btn {
    background: none;
    border: none;
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.people-v2-back-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.people-v2-subbar-divider {
    width: 1px;
    height: 22px;
    background: var(--gray-200);
}

.people-v2-picker {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 0.4rem 1.85rem 0.4rem 0.75rem;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
}
.people-v2-picker:hover {
    border-color: var(--gray-300);
    background-color: var(--gray-50);
}
.people-v2-picker:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.people-v2-arrow {
    background: white;
    border: 1px solid var(--gray-200);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--gray-600);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    line-height: 1;
}
.people-v2-arrow:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-900);
}

.people-v2-subbar-spacer {
    flex: 1;
}

.people-v2-close-btn {
    background: none;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--gray-500);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    line-height: 1;
}
.people-v2-close-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.people-v2-drill-body {
    /* Inside drill-in we want the card body expanded — override the base
       .rewards-card-collapsible.collapsed { max-height: 0; opacity: 0; overflow: hidden; } */
}
.people-v2-drill-body .rewards-card-collapsible,
.people-v2-drill-body .rewards-card-collapsible.collapsed {
    max-height: none !important;
    opacity: 1 !important;
    overflow: visible !important;
}

/* Legacy card containers (.turnover-analysis-card, .gender-card, etc.) are width: 90%
   with auto margins. Inside the drill-in body we want them flush with the sub-bar. */
.people-v2-drill-body .turnover-analysis-card,
.people-v2-drill-body .retirement-analysis-card,
.people-v2-drill-body .early-attrition-card,
.people-v2-drill-body .gender-card,
.people-v2-drill-body .diversity-card,
.people-v2-drill-body .performance-card,
.people-v2-drill-body .career-growth-card,
.people-v2-drill-body .retention-risk-analysis-card {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
.people-v2-drill-body .rewards-collapsible-header,
.people-v2-drill-body .turnover-card-header,
.people-v2-drill-body .gender-card-header,
.people-v2-drill-body .retirement-card-header,
.people-v2-drill-body .early-attrition-card-header,
.people-v2-drill-body .diversity-card-header,
.people-v2-drill-body .career-growth-card-header,
.people-v2-drill-body .performance-card-header,
.people-v2-drill-body .retention-risk-card-header {
    /* Hide the card-level collapsible header — the sub-bar replaces it */
    display: none !important;
}

.people-v2-drill-empty {
    background: white;
    border: 1px dashed var(--gray-300);
    border-radius: 10px;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
}

/* ============================
 * People v2 — Phase 4 styles
 * ============================
 * AI Brief rendering: hero + chapters + recommendations + skeleton + error.
 */
.people-v2-brief-container {
    min-height: 400px;
}

/* Skeleton state */
.people-v2-brief-skeleton {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 3rem 2.5rem;
    max-width: 1080px;
    margin: 0 auto;
}
.people-v2-brief-skeleton-hero { margin-bottom: 2.5rem; }
.people-v2-brief-skeleton .skel {
    background: linear-gradient(90deg, var(--gray-100) 0%, var(--gray-200) 50%, var(--gray-100) 100%);
    background-size: 200% 100%;
    animation: peopleV2SkelShimmer 1.4s infinite;
    border-radius: 6px;
    margin-bottom: 0.85rem;
}
.people-v2-brief-skeleton .skel-eyebrow { height: 10px; width: 200px; margin-bottom: 1.25rem; }
.people-v2-brief-skeleton .skel-h1 { height: 28px; max-width: 720px; }
.people-v2-brief-skeleton .skel-h2 { height: 20px; max-width: 500px; }
.people-v2-brief-skeleton .skel-p { height: 12px; max-width: 640px; }
.people-v2-brief-skeleton .skel-short { max-width: 480px; }
.people-v2-brief-skeleton .skel-shorter { max-width: 360px; }
.people-v2-brief-skeleton .skel-chapter { padding-top: 2rem; border-top: 1px solid var(--gray-100); }
.people-v2-brief-loading-msg {
    text-align: center;
    margin-top: 2rem;
    font-size: 13px;
    color: var(--gray-500);
    font-style: italic;
    font-family: 'Cormorant Garamond', serif;
}
@keyframes peopleV2SkelShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Error state */
.people-v2-brief-error {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 540px;
    margin: 0 auto;
}
.people-v2-brief-error-icon { font-size: 36px; margin-bottom: 0.85rem; }
.people-v2-brief-error-title { font-size: 16px; font-weight: 600; color: var(--gray-900); margin-bottom: 0.5rem; }
.people-v2-brief-error-body { font-size: 13px; color: var(--gray-500); margin-bottom: 1.5rem; line-height: 1.5; }
.people-v2-brief-retry {
    background: var(--gray-900);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.people-v2-brief-retry:hover { background: var(--gray-800); }

/* Rendered brief */
.people-brief {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
}
.people-brief-hero {
    max-width: 1080px;
    margin: 0 auto;
    padding: 3rem 2.5rem 2rem;
}
.people-brief-eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 0.85rem;
}
.people-brief-tldr {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--gray-900);
    color: white;
    padding: 0.45rem 0.85rem 0.45rem 0.55rem;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.35;
    margin-bottom: 1.1rem;
    max-width: 100%;
}
.people-brief-tldr-label {
    display: inline-block;
    background: white;
    color: var(--gray-900);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 3px 8px;
    border-radius: 999px;
    flex-shrink: 0;
}
.people-brief-tldr-body {
    font-weight: 500;
    color: white;
}
.people-brief-hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 42px;
    font-weight: 500;
    line-height: 1.1;
    color: var(--gray-900);
    margin-bottom: 1rem;
    letter-spacing: -0.005em;
    max-width: 800px;
}
.people-brief-hero-title em {
    font-style: italic;
    color: var(--primary-color);
    font-weight: 400;
}
.people-brief-hero-sub {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 16px;
    color: var(--gray-600);
    font-weight: 400;
    max-width: 720px;
    line-height: 1.4;
}
.people-brief-hero-meta {
    margin-top: 1rem;
    display: flex;
    gap: 1.25rem;
    font-size: 11.5px;
    color: var(--gray-500);
    flex-wrap: wrap;
}
.people-brief-hero-meta strong { color: var(--gray-900); font-weight: 600; }

.people-brief-chapter {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    border-top: 1px solid var(--gray-100);
}
@media (max-width: 900px) {
    .people-brief-chapter { grid-template-columns: 1fr; }
}
.people-brief-ch-num {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 12px;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
}
.people-brief-ch-eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 0.7rem;
}
.people-brief-ch-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 500;
    color: var(--gray-900);
    margin: 0 0 0.85rem;
    letter-spacing: -0.005em;
}
.people-brief-ch-title em {
    font-style: italic;
    color: var(--primary-color);
    font-weight: 400;
}
.people-brief-ch-body { font-size: 14px; line-height: 1.7; color: var(--gray-700); }
.people-brief-ch-body p + p { margin-top: 0.85rem; }
.people-brief-ch-body strong { font-weight: 600; color: var(--gray-900); }
.people-brief-pullquote {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 20px;
    line-height: 1.35;
    color: var(--gray-900);
    margin: 1.25rem 0;
    padding-left: 0.85rem;
    border-left: 3px solid var(--primary-color);
}

.people-brief-aside-card {
    background: var(--gray-900);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
}
.people-brief-aside-eye {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #a5b4fc;
    margin-bottom: 0.65rem;
}
.people-brief-aside-tbl { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.55rem; }
.people-brief-aside-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: baseline;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.people-brief-aside-row:last-child { border-bottom: none; padding-bottom: 0; }
.people-brief-aside-row-n { font-size: 12.5px; color: rgba(255,255,255,0.85); }
.people-brief-aside-row-v {
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.people-brief-recs {
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    padding: 2rem;
}
.people-brief-recs-inner { max-width: 1080px; margin: 0 auto; }
.people-brief-recs-eye {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 0.6rem;
}
.people-brief-recs-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-weight: 500;
    text-align: center;
    color: var(--gray-900);
    max-width: 640px;
    margin: 0 auto 1.5rem;
    line-height: 1.25;
}
.people-brief-recs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}
.people-brief-rec-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.people-brief-rec-num {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 38px;
    line-height: 1;
    color: var(--primary-color);
    font-weight: 400;
    margin-bottom: 0.65rem;
}
.people-brief-rec-title { font-size: 14px; font-weight: 600; color: var(--gray-900); margin-bottom: 0.4rem; }
.people-brief-rec-body { font-size: 12.5px; color: var(--gray-600); line-height: 1.55; }

/* "See the data" link at the bottom of a recommendation card */
.people-brief-rec-link-wrap {
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
/* Push link-wrap to bottom by adding top-margin to it from the body */
.people-brief-rec-body {
    margin-bottom: 1rem;
}
.people-brief-rec-link-lede {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray-500);
}
.people-brief-rec-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    line-height: 1.35;
    transition: color 0.12s;
    align-self: flex-start;
}
.people-brief-rec-link:hover,
.people-brief-rec-link:focus-visible {
    color: var(--gray-900);
    text-decoration: underline;
    text-underline-offset: 2px;
    outline: none;
}
.people-brief-rec-link span {
    transition: transform 0.15s;
    display: inline-block;
}
.people-brief-rec-link:hover span {
    transform: translateX(3px);
}

.people-brief-foot {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1.25rem 2rem 1.75rem;
    text-align: center;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 13px;
    color: var(--gray-500);
}

/* ============================
 * L2 rail/content shell (Phase A)
 * ============================
 * Ported from client/insights-l2-rail-mockup.html. Replaces the legacy
 * vertical-accordion L2 inside the drill-in body. Per-card manifests are
 * added in Phase B; cards without one fall through to legacy renderers.
 *
 *   .l2-l1strip  — full-width L1 metrics row above the content
 *   .l2-shell    — shell wrapper (its 240px grid is inert: every live
 *                  drill-in is .l2-shell-modeb, which overrides to block;
 *                  a future two-column layout needs a new selector)
 *   .l2-content  — pane that swaps when a lens is selected
 * The .l2-rail-* family (left rail) was deleted 2026-08-29 — nothing had
 * emitted it since Mode A switched to horizontal lens tabs on 2026-06-22.
 */
/* L2 L1 strip: wraps the legacy .card-metrics-row so it sits on a card panel
   above the rail/content split. The legacy markup keeps its own styling. */
/* L1 strip — lives INSIDE .l2-content. Hosts the card-level "Insights" button
   on the right, the legacy metrics row on the left. */
.l2-l1strip {
    padding: 0.25rem 0 1rem;
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: start;
}
.l2-l1strip-metrics { min-width: 0; }
.l2-l1strip .card-metrics-row {
    margin: 0;
}

/* ==========================================================================
   L2 SPLIT LAYOUT — two-column People drill-in (opt-in: manifest layout:'split')
   --------------------------------------------------------------------------
   EVERY rule below is scoped to [data-layout="split"] — the OPT-IN attribute,
   not the mode. Do not re-add [data-mode="A"]: Performance is Mode B and opts
   into this same layout, so a mode-scoped rule would skip it entirely while
   looking correct in the stylesheet.

   [data-layout="split"] is emitted by exactly one place — the split branch of
   renderL2Shell — so it is already as tight as a mode selector was. An analysis
   that has not opted in never carries the attribute and is never matched.

   The .l2-split wrapper sits INSIDE .l2-content on purpose: the force-expand
   rules further down this file (.l2-content .card-subsection .card-subsection-body
   { max-height:none !important } etc) and openL3Drawer's global .l2-content
   query both match on that ancestor. Hoisting the split out collapses every
   L3 list in every lens body, with no console error.
   ========================================================================== */

/* Page title — its own row above the navigation. Only element naming the analysis.
   No top padding: the drill-in sits inside `.comparison-results`' padding, which the
   drill's negative margin trims to 8px (header option B, 2026-10-28, below). */
.l2-page-header { padding: 0 0 0.75rem; }
.l2-page-title {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--gray-900);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

/* Back button on the tab row, tabs optically centred. The 1fr rails either side
   are what centre the tabs on the page rather than in the leftover space. */
.l2-modeb-lens-tabs.l2-tabs-split {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: 1rem;
    overflow-x: visible;
}
.l2-tabs-split .l2-tabs-left {
    justify-self: start;
    padding-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.l2-tabs-split .l2-tabs-center {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.l2-tabs-split .l2-tabs-center::-webkit-scrollbar { display: none; }

/* Title row — header option B (approved 2026-10-28; docs/ui-elements.md § Insights L2
   split layout). The verdict sits beside the card's name, its target in grey, and the
   Insights pill at the row's right; the verdict block that sat under the tabs is gone.
   A long statement verdict (EoS, Headcount) wraps inside its own box beside the title;
   the pill keeps the right edge. */
.l2-page-header--verdict {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
}
.l2-page-header--verdict .l2-page-title { flex: 0 0 auto; }
.l2-title-sep { flex: 0 0 auto; width: 1px; height: 20px; background: var(--gray-200); }
/* The verdict grows into the space beside the title and wraps inside its own box, so
   a long statement takes a second line there instead of dropping below the separator. */
.l2-title-verdict {
    flex: 1 1 16rem;
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.15rem 0.5rem;
    min-width: 0;
}
/* Both verdict families (People's .mode-b-headline-text, the sections'
   .headline-verdict) at the headline's 15px, icon and text on one line. */
.l2-title-verdict .mode-b-headline-text,
.l2-title-verdict .headline-verdict,
.l2-title-verdict .bd-verdict-text {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 15px;
    font-weight: var(--font-bold);
    line-height: 1.2;
}
.l2-title-verdict .bd-verdict-text svg { width: 14px; height: 14px; flex-shrink: 0; }
.l2-title-target { font-size: var(--text-sm); color: var(--gray-500); }
.l2-title-insights { margin-left: auto; }
/* Pay vs market is its tab's landing page, so the Brief and Cards switch shares the row. */
.l2-title-insights:has(.rewards-v2-mode-toggle) { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem; }
/* On a phone the verdict wraps under the title; a separator left at the end of the
   title's line points at nothing. */
@media (max-width: 640px) {
    .l2-title-sep { display: none; }
}
/* The verdict's foot, when it adds something the tiles do not: first in the context
   pane, above "How this is measured" (above the method card when stacked). */
.l2-aside-foot {
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--gray-600);
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--gray-100);
    font-variant-numeric: tabular-nums;
}
.l2-aside-foot strong { color: var(--gray-900); font-weight: var(--font-bold); }
.l2-aside-foot a { color: var(--brand-indigo-600); text-decoration: none; }
.drill-stacked-method + .l1-strip, .l2-aside-foot + .drill-stacked-method { margin-top: 0.75rem; }
/* The title higher: the page gap under the top bar 16px → 8px, and the card's padding
   above the title 16px → 8px (2rem padding less the drill's -1.5rem). Scoped to an
   Insights drill that draws its title row (#insights-results; a section's setup wall
   does not); the base margins serve the other places these wrappers appear
   (Benchmark, the cluster cell drawer, the department board). */
#insights-results:has(> .tab-content.active .people-v2-drill-mode:not([hidden]) .l2-page-header, > .tab-content.active .rewards-v2-drill-mode:not([hidden]) > .l2-page-header) { margin-top: -0.5rem; }
#insights-results .people-v2-drill-mode:has(.l2-page-header),
#insights-results .rewards-v2-drill-mode:has(> .l2-page-header) { margin-top: -1.5rem; }
/* Benchmark's tabs on the same title row sit at the same height. */
#benchmark-results:not(.is-gated):has(> .tab-content.active .l2-page-header--verdict) { margin-top: -0.5rem; }
#benchmark-results .rewards-v2-drill-mode:has(> .l2-page-header--verdict) { margin-top: -1.5rem; }
:is(#benchmark-people-content, #benchmark-workforce-new-content, #benchmark-hr-metrics-content):has(> .bd-overview-head) { margin-top: -1rem; }

/* ==========================================================================
   INSIGHTS DRAWER — narrative content, replacing the modal for insights popups.
   Method popups and six wide-table callers keep the modal (see INSIGHTS_MODAL_ONLY).
   ========================================================================== */
/* Rounded top-left only. The other three corners meet a viewport edge, so rounding
   them would just show background through the gap. overflow:hidden is required — the
   header carries its own background and would otherwise square the corner back off;
   the body keeps its own overflow-y so scrolling is unaffected. */
/* Rounding and clipping live on the canonical `.drawer` (Family 20), not here —
   they belong to the whole family, and a second `.drawer { }` block in this file
   is how one class ends up meaning two things. */
.insights-drawer { overflow: hidden; }

.insights-drawer .insights-drawer-headtext { min-width: 0; }
.insights-drawer-eyebrow {
    margin: 0 0 0.15rem;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
}
.insights-drawer .drawer-body p { font-size: 13.5px; color: var(--gray-700); line-height: 1.6; }

/* PUSH IS OPT-IN, and only a split drill-in opts in.
   The drawer overlays by default (Family 20). Pushing globally would squeeze every
   other surface — Benchmark, the section overviews, the legacy accordions — none of
   which have a layout that responds to it. 81 of the ~97 insights callers live there.
   The `:has(.l2-content[data-layout="split"])` guard is what keeps it opt-in: both
   wrapper classes below also render NON-split bodies (Span of Control, the legacy
   People accordions), and those must keep overlaying. */
body.insights-drawer-open .people-v2-drill-mode:has(.l2-content[data-layout="split"]),
body.insights-drawer-open .rewards-v2-drill-mode:has(.l2-content[data-layout="split"]) {
    /* margin-right here, though padding-right would work equally well — this comment
       previously claimed padding-right "does not apply to this element" and that the
       L3 drawer's push was therefore dead. Both claims were wrong, retested
       2026-08-03: padding-right computes correctly on this element, and the L3 push
       worked on People all along. What was actually broken was that the L3 rule named
       only `.people-v2-drill-mode`, so it never matched the Rewards-family wrapper.
       Measuring one surface and generalising to a property is what produced the wrong
       story. margin-right is kept because it works and churn here is not free. */
    /* Gutter between the pushed content and the drawer is set to match the page's own
       left-hand gutter (.main-content's 2rem padding), so the drawer reads as part of
       the page rather than jammed against the content.
       The drill-in already sits inside 2rem of .main-content padding AND 2rem of
       .comparison-results padding, so subtract that 4rem — otherwise the visible gap
       is the drawer offset PLUS both, which measured 80px against a 32px left gutter. */
    margin-right: calc(460px + 2rem - 4rem);
    transition: margin-right 0.25s ease;
}
/* ...and once pushed, the split must STACK. This is class-driven, not a media query:
   a media query keys off the viewport, which does not change when a drawer pushes, so
   the existing 1100px rule would never fire and the two columns would just be crushed. */
body.insights-drawer-open .l2-content[data-layout="split"] .l2-split {
    grid-template-columns: 1fr;
}
body.insights-drawer-open .l2-content[data-layout="split"] .l2-split-aside {
    position: static;
    border-right: none;
    padding-right: 0;
}
/* Stacked, the context pane has full width — two stretched tiles read as empty space. */
body.insights-drawer-open .l2-content[data-layout="split"] .l2-l1strip-metrics .card-metrics-row {
    grid-template-columns: repeat(4, 1fr);
}
/* Below 1100px the drawer covers the content rather than pushing it. */
@media (max-width: 1100px) {
    body.insights-drawer-open .people-v2-drill-mode:has(.l2-content[data-layout="split"]),
    body.insights-drawer-open .rewards-v2-drill-mode:has(.l2-content[data-layout="split"]) {
        margin-right: 0;
    }
}

/* The Cluster tab is the second opt-in (2026-10-05, docs/cluster-drawer-compress-
   plan.md): the view moves aside by the same amount and the grid compresses so all
   its hotel columns stay readable beside the findings. Only from 1280px — below
   that the columns cannot shrink far enough to hold a value, so the drawer
   overlays as before. Class-driven like the split above: the viewport does not
   change when the drawer opens. */
#cluster-overview {
    transition: margin-right 0.25s ease;
}
@media (min-width: 1280px) {
    body.insights-drawer-open #cluster-overview {
        margin-right: calc(460px + 2rem - 4rem);
    }
    /* Last resort: a portfolio too wide even compressed scrolls inside the grid. */
    body.insights-drawer-open #cluster-overview .cluster-l3-grid {
        overflow-x: auto;
    }
    body.insights-drawer-open #cluster-overview .cluster-metric-row,
    body.insights-drawer-open #cluster-overview .cluster-hotel-cards,
    body.insights-drawer-open #cluster-overview .cluster-metric-card {
        gap: 0.25rem;
    }
    /* A flex item's default minimum is its content's width, so the columns box
       would not shrink below eight unbreakable values ("31.8%") side by side. */
    body.insights-drawer-open #cluster-overview .cluster-hotel-cards {
        min-width: 0;
    }
    body.insights-drawer-open #cluster-overview .cluster-metric-label-card {
        width: 150px;
        padding: 0.25rem 0.5rem;
    }
    /* The target stays on the row name's hover and in How this is measured. */
    body.insights-drawer-open #cluster-overview .cluster-metric-label-sub {
        display: none;
    }
    /* 60px: eight columns fit beside the drawer at 1280px without scrolling
       (64px left the grid 38px short); the widest values wrap onto two lines. */
    body.insights-drawer-open #cluster-overview .cluster-metric-card,
    body.insights-drawer-open #cluster-overview .cluster-hotel-header-card {
        min-width: 60px;
        padding: 0.25rem;
    }
    body.insights-drawer-open #cluster-overview .cluster-metric-value {
        font-size: var(--text-sm);
    }
}

/* Insights drawer trigger — generic pill with chevrons that pulse right to left.
   The stagger runs rightmost-first so the motion reads as "a panel arrives from that
   side", rather than "the content moves left", which is the side effect not the action. */
.insights-drawer-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-family: inherit;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    padding: 0.45rem 0.55rem 0.45rem 0.95rem;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-700);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.insights-drawer-trigger:hover {
    background: var(--gray-50);
    border-color: var(--brand-indigo-100);
    color: var(--brand-indigo-700);
}
/* Compact variant — the pulse without the word, for inline placement in a row or
   accordion header where a full "Insights ‹‹‹" pill would repeat 24 times down
   the page. Replaces the `?` button, which read as "help" when the control
   actually opens the insights drawer. Same handler, same drawer; only the
   affordance changes. */
.insights-drawer-trigger--compact {
    padding: 0.3rem 0.5rem;
    gap: 0;
    flex-shrink: 0;
}
.insights-drawer-trigger--compact .chev-run span { font-size: 13px; }

.insights-drawer-trigger .chev-run { display: inline-flex; align-items: center; gap: 1px; }
.insights-drawer-trigger .chev-run span {
    font-size: 14px;
    line-height: 1;
    color: var(--brand-indigo-500);
    animation: insightsChevPulse 1.5s ease-in-out infinite;
}
.insights-drawer-trigger .chev-run span:nth-child(1) { animation-delay: 0.30s; }
.insights-drawer-trigger .chev-run span:nth-child(2) { animation-delay: 0.15s; }
.insights-drawer-trigger .chev-run span:nth-child(3) { animation-delay: 0s; }
@keyframes insightsChevPulse {
    0%, 100% { opacity: 0.25; transform: translateX(2px); }
    50%      { opacity: 1;    transform: translateX(-1px); }
}
/* Open state: stop the pulse and flip the run. Mirroring the whole group turns each
   chevron round AND reverses their visual order, so it reads as "push it back to the
   right" — the inverse of the closed state's "bring it in from the right". One
   transform, no second glyph set to keep in sync. */
body.insights-drawer-open .insights-drawer-trigger .chev-run {
    transform: scaleX(-1);
    transition: transform 0.2s ease;
}
body.insights-drawer-open .insights-drawer-trigger .chev-run span {
    animation: none;
    opacity: 0.55;
}
.insights-drawer-trigger .chev-run { transition: transform 0.2s ease; }
/* The toggle is active while the panel is open — give it the state to match. */
body.insights-drawer-open .insights-drawer-trigger {
    background: var(--brand-indigo-50);
    border-color: var(--brand-indigo-100);
    color: var(--brand-indigo-700);
}
@media (prefers-reduced-motion: reduce) {
    .insights-drawer-trigger .chev-run span { animation: none; opacity: 0.7; }
}

/* Pane separator: hairline on the CONTEXT pane's right edge, box on the evidence pane.
   The rule is anchored to the aside, not to .l2-split-main — a left-border on the main
   pane is overwritten the moment that pane also gets a `border` shorthand for the box,
   leaving one line instead of two. */
.l2-content[data-layout="split"] .l2-split { column-gap: 1.25rem; }
.l2-content[data-layout="split"] .l2-split-aside {
    border-right: 1px solid var(--gray-200);
    padding-right: 1.25rem;
}
.l2-content[data-layout="split"] .l2-split-main {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1rem;
}
/* The lens body already carried card chrome; inside a boxed pane that is a box in a box. */
.l2-content[data-layout="split"] .l2-split-main .l2-lens-body > .lens-card,
.l2-content[data-layout="split"] .l2-split-main > .l2-lens-body { border: none; padding: 0; }

/* The split itself */
.l2-content[data-layout="split"] .l2-split {
    display: grid;
    grid-template-columns: minmax(220px, 25%) 1fr;
    gap: 1.25rem;
    align-items: start;
}
.l2-content[data-layout="split"] .l2-split-aside { min-width: 0; position: sticky; top: 4.5rem; }
.l2-content[data-layout="split"] .l2-split-main { min-width: 0; }

/* Sparse lenses (see BACKLOG) would otherwise sprawl across the full pane.
   Cap the content, don't cap the pane — heavy L3 grids still use the width. */
.l2-content[data-layout="split"] .l2-lens-body { max-width: 1100px; }

/* KPI strip — always two columns, whatever the count. Across the seven Mode A
   analyses that is Gender 3, the middle four 4, Retirement 5, Turnover 6. Odd
   counts leave the last cell empty rather than reflowing, which keeps every card's
   KPI block on the same grid and the same row rhythm — a card that stacked to one
   column would read as a different component. */
.l2-content[data-layout="split"] .l2-l1strip {
    display: block;
    padding: 0;
    margin-bottom: 0.85rem;
    border-bottom: none;
}
.l2-content[data-layout="split"] .l2-l1strip-metrics .card-metrics-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
.l2-content[data-layout="split"] .l2-l1strip-metrics .card-metric {
    flex: none;
    min-width: 0;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
/* Categorical KPI tiles (Performance's per-band counts) carry a colour swatch in the
   subtext. .mode-b-headline-count-sw sizes itself with width/height, which a plain
   `display: inline` span ignores — it only works in the headline because its parent
   .mode-b-headline-count is inline-flex, making the swatch a flex item. Reproduce
   that context here rather than touching the shared class. */
.l2-content[data-layout="split"] .l2-l1strip-metrics .card-metric-subtext {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}
/* Headline trim (Phase 0 decision): the title row drops the analysis-name prefix and
   the foot parts marked as duplicating on-page content (_drillTitleTarget,
   _drillHtmlHead); the People-grid card keeps both. */

/* Narrative opens the insights popup rather than expanding in place — at ~25% the
   pane wraps body copy at ~38 characters, and expanding outgrows the sticky aside.
   Swap the disclosure chevron (▾) for a "goes somewhere" chevron (›), and make sure
   the body can never appear inline even if .expanded gets set by other code. */
.l2-content[data-layout="split"] .mode-b-narrative-body { display: none !important; }
.l2-content[data-layout="split"] .mode-b-narrative-chev { font-size: 0; transform: none; }
.l2-content[data-layout="split"] .mode-b-narrative-chev::after {
    content: '\203A';
    font-size: 16px;
    line-height: 1;
}

/* Method card — the "?" tier. Thin by design: it must not read as a fourth KPI. */
.l2-method-card {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.l2-method-card:hover { background: var(--gray-50); border-color: var(--brand-indigo-100); }
.l2-method-card svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--gray-400); }
.l2-method-card:hover svg { color: var(--brand-indigo-600); }
.l2-method-label { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 500; color: var(--gray-700); }
.l2-method-chev { color: var(--gray-400); font-size: 15px; line-height: 1; }

/* Method popup body (rendered into the shared insights modal) */
.method-def { margin: 0 0 1rem; }
.method-def:last-child { margin-bottom: 0; }
.method-def dt {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.3rem;
}
.method-def dd { margin: 0; font-size: 13.5px; color: var(--gray-700); line-height: 1.6; }

/* The insights modal is shared and sized 90vw x 90vh for chart-heavy popups. Method
   content is a single column of prose, so at that width the text capped to a readable
   measure hugged the left edge with half the dialog empty. Narrow the shell instead of
   centring a column inside it — scoped by :has() so only method popups are affected and
   every other insights popup keeps the full canvas it needs. */
.modal-content:has(.method-content) {
    width: 760px;
    max-width: 90vw;
    height: auto;
    max-height: 85vh;
}
.method-buckets { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.4rem; }
/* First column sizes to the longest label rather than a fixed 104px — Early
   Attrition's bands ("0–90 days") fit that; Career Growth's ("Under 12 months")
   wrapped onto two lines inside it. */
.method-bucket { display: grid; grid-template-columns: minmax(104px, max-content) 1fr; gap: 0.6rem; font-size: 13px; align-items: baseline; }
.method-bucket code {
    background: var(--gray-100);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 11.5px;
    color: var(--gray-700);
    text-align: center;
    /* Band labels are short by design; never break one across two lines. The column
       sizes to the longest, so "Under 12 months" widens it rather than wrapping. */
    white-space: nowrap;
}

/* Below 1100px the aside can't hold a readable measure — stack it back above. */
@media (max-width: 1100px) {
    .l2-content[data-layout="split"] .l2-split { grid-template-columns: 1fr; }
    .l2-content[data-layout="split"] .l2-split-aside { position: static; }
    .l2-content[data-layout="split"] .l2-l1strip-metrics .card-metrics-row {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 820px) {
    .l2-modeb-lens-tabs.l2-tabs-split { display: flex; flex-wrap: wrap; gap: 0.5rem; }
    .l2-tabs-split .l2-tabs-left { padding-bottom: 0.5rem; }
    .l2-tabs-split .l2-tabs-right { display: none; }
    .l2-content[data-layout="split"] .l2-l1strip-metrics .card-metrics-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Lens body header — title + lens-level "?" button on the right */
.l2-lens-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.l2-lens-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

.l2-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1rem;
    align-items: start;
}

.l2-content {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 0.5rem 1.5rem 1.5rem;
}
/* Split content is never a card — the panes inside it carry their own framing.
   People cancelled this via `.l2-shell-modeb .l2-content-modeb`, which is scoped to a
   wrapper the other three sections do not have, so Rewards, Workforce and HR Metrics
   were rendering their split body inside a white bordered box with 8px of top padding
   that People did not have. Scoped on the opt-in ATTRIBUTE so it covers all four. */
.l2-content[data-layout="split"] {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}
.l2-lens-body,
.l2-content {
    transition: opacity 0.15s ease;
}
/* Mode A fades the lens body; Mode B fades the whole content block —
   switchLens puts the class on different elements per mode. */
.l2-lens-body.l2-content-fading,
.l2-content.l2-content-fading { opacity: 0; }

.l2-empty {
    padding: 3rem 2rem;
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
}

/* L3 collapsible sections inside the lens body — force expanded.
   The legacy default-collapsed accordion is incompatible with the new L2 shell
   (the lens picker is already the navigation; nested collapsibles add friction). */
.l2-content .card-l3-section .card-l3-body {
    display: block !important;
    padding: 0.75rem 1rem !important;
}
.l2-content .card-l3-section .card-l3-chevron {
    display: none !important;
}
.l2-content .card-l3-header {
    cursor: default !important;
}
.l2-content .card-l3-header:hover { filter: none !important; }

/* Same override for the older `.card-subsection` markup that some legacy
   renders still emit nested inside lens bodies. */
.l2-content .card-subsection .card-subsection-body {
    max-height: none !important;
    opacity: 1 !important;
    overflow: visible !important;
}
.l2-content .card-subsection .card-subsection-chevron {
    display: none !important;
}
.l2-content .card-subsection-header {
    cursor: default !important;
}

/* Legacy L3 card — selected state while its drawer is open */
.l2-content [data-l3-legacy-fn] {
    cursor: pointer;
}
.l2-content [data-l3-legacy-fn].is-l3-selected {
    box-shadow: 0 0 0 2px var(--primary-color);
    border-radius: 8px;
}

/* ============================
   L3 Drawer — right-side detail panel
   ============================ */
:root {
    --l3-drawer-width: clamp(360px, 30vw, 480px);
}
.l3-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--l3-drawer-width);
    height: 100vh;
    background: white;
    /* Matched to the canonical `.drawer` (Option C, see its comment): a hairline
       to separate, plus a wide low-opacity shadow for depth. The tight dark
       shadow this replaces claimed elevation over content, which is wrong for a
       drawer that PUSHES rather than overlays — there is nothing underneath it
       to cast onto, and this one pushes on every split drill-in. The hairline is
       the shadow's first layer rather than a border, so the two cannot disagree. */
    box-shadow: -1px 0 0 var(--gray-200), -16px 0 40px rgba(17, 24, 39, 0.06);
    border-top-left-radius: var(--radius-lg);
    z-index: 950;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.l3-drawer.is-open {
    transform: translateX(0);
}
/* The push, for BOTH drill-in wrappers.
   It used to name only `.people-v2-drill-mode`, so it silently did nothing on
   Rewards, Workforce, HR Metrics and Benchmark — all of which wrap their drill-in
   in `.rewards-v2-drill-mode`. Measured 2026-08-03 with both wrappers in the same
   DOM: People 376px, Rewards 0px. That is the whole bug.

   It is NOT, as previously recorded, that `padding-right` mysteriously computes to
   0 on this element. It computes correctly; the earlier finding was almost
   certainly measured on a Rewards-family surface, where the selector simply does
   not match, and read as a property-specific fault. `padding-right` is kept here
   rather than switched to `margin-right` for that reason.

   Gated on a split body, matching the insights drawer's opt-in rule above and for
   the same reason: both wrappers also render non-split bodies (Span of Control,
   the legacy People accordions) whose layout cannot respond to being narrowed, and
   those should keep being overlaid. */
body.l3-drawer-open .people-v2-drill-mode:has(.l2-content[data-layout="split"]),
body.l3-drawer-open .rewards-v2-drill-mode:has(.l2-content[data-layout="split"]) {
    padding-right: calc(var(--l3-drawer-width) + 1rem);
    transition: padding-right 0.25s ease;
}
/* Once pushed, the split must stack — otherwise the two columns are crushed into
   the remaining width rather than reflowing. Class-driven, not a media query: the
   viewport does not change when a drawer opens, so a width query would never fire.
   Same three companions the insights drawer needs. */
body.l3-drawer-open .l2-content[data-layout="split"] .l2-split {
    grid-template-columns: 1fr;
}
body.l3-drawer-open .l2-content[data-layout="split"] .l2-split-aside {
    position: static;
    border-right: none;
    padding-right: 0;
}
body.l3-drawer-open .l2-content[data-layout="split"] .l2-l1strip-metrics .card-metrics-row {
    grid-template-columns: repeat(4, 1fr);
}

.l3-drawer-header {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
}
.l3-drawer-titleblock {
    min-width: 0;
}
.l3-drawer-eyebrow {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-500);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.l3-drawer-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.l3-drawer-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.l3-drawer-fullview {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    color: var(--gray-700);
    font-size: 11px;
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.12s ease;
}
.l3-drawer-fullview:hover {
    background: var(--gray-50);
    color: var(--primary-color);
    border-color: var(--gray-300);
}

.l3-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.1rem 1.5rem;
    transition: opacity 0.12s ease;
}
.l3-drawer-body.is-fading {
    opacity: 0;
}
.l3-drawer-empty {
    color: var(--gray-500);
    font-size: 13px;
    padding: 2rem 1rem;
    text-align: center;
}

/* Default key-value renderer (fallback when no per-card renderer registered) */
.l3-drawer-kv-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.l3-drawer-kv {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    padding: 0.4rem 0.55rem;
    border-radius: 6px;
    background: var(--gray-50);
}
.l3-drawer-kv-label {
    font-size: 12px;
    color: var(--gray-600);
}
.l3-drawer-kv-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-900);
    font-variant-numeric: tabular-nums;
}

/* Mobile: drawer takes full width, content area not padded */
@media (max-width: 720px) {
    :root { --l3-drawer-width: 100vw; }
    body.l3-drawer-open .people-v2-drill-mode:has(.l2-content[data-layout="split"]),
    body.l3-drawer-open .rewards-v2-drill-mode:has(.l2-content[data-layout="split"]) {
        padding-right: 0;
    }
}

/* Drawer detail content patterns — reusable inside per-card renderers */
.l3-drawer-section {
    margin-bottom: 1.25rem;
}
.l3-drawer-section:last-child { margin-bottom: 0; }
.l3-drawer-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}
.l3-drawer-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.l3-drawer-stat {
    padding: 0.5rem 0.65rem;
    background: var(--gray-50);
    border-radius: 6px;
}
.l3-drawer-stat-label {
    font-size: 10px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.15rem;
}
.l3-drawer-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    font-variant-numeric: tabular-nums;
}
.l3-drawer-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.l3-drawer-list-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 12px;
}
.l3-drawer-list-row:last-child { border-bottom: none; }
.l3-drawer-list-name { color: var(--gray-700); }
.l3-drawer-list-value {
    color: var(--gray-900);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Leaver list — used by turnover drawers */
.l3-drawer-leaver-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.l3-drawer-leaver-row {
    padding: 0.5rem 0.65rem;
    background: var(--gray-50);
    border-radius: 6px;
    border-left: 2px solid var(--gray-200);
    /* Name + meta on the left, exit-quality badge on the right. `auto` on the
       badge track so a long role never squeezes the label onto two lines, and
       min-width:0 on the text block so it truncates instead of pushing. */
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
    /* Top-aligned, not centred: a long role title wraps the meta line to two,
       and a vertically centred badge then floats level with nothing. */
    align-items: start;
}

/* One line of context above the list: what the row already said, compressed,
   so the drawer opens on new information rather than repeating the table. */
.l3-drawer-context {
    margin: 0 0 0.9rem;
    font-size: 12.5px;
    color: var(--gray-600);
}
.l3-drawer-context strong { color: var(--gray-900); font-weight: 600; }
.l3-drawer-context .tt-over-target { color: var(--danger); }
.l3-drawer-leaver-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.15rem;
}
.l3-drawer-leaver-meta {
    font-size: 11px;
    color: var(--gray-600);
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.l3-drawer-leaver-more {
    text-align: center;
    color: var(--gray-500);
    font-size: 11px;
    padding: 0.4rem 0;
}

/* Diversity drawer — donut chart + nationality bar list */
.diversity-drawer-donut {
    display: flex;
    justify-content: center;
    margin-bottom: 0.85rem;
}
.diversity-drawer-donut svg {
    max-width: 100%;
    height: auto;
}
.diversity-drawer-bars {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.diversity-drawer-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) auto;
    align-items: center;
    gap: 0.55rem;
    font-size: 11px;
}
.diversity-drawer-bar-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}
.diversity-drawer-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.diversity-drawer-bar-name {
    color: var(--gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.diversity-drawer-bar-track {
    background: var(--gray-100);
    border-radius: 4px;
    height: 12px;
    overflow: hidden;
}
.diversity-drawer-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.18s ease;
    min-width: 2px;
}
.diversity-drawer-bar-value {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    color: var(--gray-900);
    font-variant-numeric: tabular-nums;
}
.diversity-drawer-bar-value strong { font-weight: 700; }
.diversity-drawer-bar-pct {
    color: var(--gray-500);
    font-size: 10px;
}
.diversity-drawer-warn {
    background: var(--brand-amber-100);
    color: var(--brand-amber-800);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 11px;
    margin-top: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ============================================================
   MODE B — Performance drill-in (waffle + rating distribution)
   Mockup ref: client/mode-b-performance-mockup.html
   ============================================================ */

/* Semantic Mode B tokens — strictly aliases of existing brand-* tokens.
   No new hex values: every new token resolves through the brand palette. */
:root {
  --verdict-good: var(--brand-green-700);
  --verdict-good-bg: var(--brand-green-100);
  --verdict-warn: var(--brand-amber-600);
  --verdict-warn-bg: var(--brand-amber-100);
  --verdict-bad: var(--brand-red-600);
  --verdict-bad-bg: var(--brand-red-100);
  --verdict-await: var(--gray-500);
  --verdict-await-bg: var(--gray-100);

  --perf-rating-1: var(--brand-red-500);
  --perf-rating-2: var(--brand-amber-500);
  --perf-rating-3: var(--chart-2);
  --perf-rating-4: var(--brand-green-600);
  --perf-rating-5: var(--brand-green-800);
}

/* ============================================================
   Mode B shell — no rail; horizontal drill header + lens tabs
   ============================================================ */
.l2-shell-modeb {
  display: block;
  width: 100%;
  padding: 0;
}
.l2-shell-modeb .l2-content-modeb {
  display: block;
  width: 100%;
  padding: 0;
  background: transparent;
  border: none;
}
.l2-modeb-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.l2-modeb-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.l2-modeb-back:hover {
  background: var(--gray-50);
  border-color: var(--brand-indigo-100);
  color: var(--brand-indigo-600);
}
.l2-modeb-breadcrumb {
  font-size: 13px;
  color: var(--gray-600);
}
.l2-modeb-breadcrumb strong {
  color: var(--gray-900);
  font-weight: 600;
}
.l2-modeb-header-spacer { flex: 1; }
.l2-modeb-arrows {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.l2-modeb-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font-size: 12.5px;
  color: var(--gray-700);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.l2-modeb-arrow:hover {
  background: var(--gray-50);
  border-color: var(--brand-indigo-100);
  color: var(--brand-indigo-600);
}
.l2-modeb-picker {
  appearance: none;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font-size: 12.5px;
  color: var(--gray-700);
  cursor: pointer;
  max-width: 200px;
}
.l2-modeb-lens-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--gray-200);
  overflow-x: auto;
  scrollbar-width: none;
}
.l2-modeb-lens-tabs::-webkit-scrollbar { display: none; }
.l2-modeb-lens-tab {
  background: transparent;
  border: none;
  padding: 0.65rem 0.95rem;
  font-size: 13px;
  color: var(--gray-600);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.l2-modeb-lens-tab:hover {
  color: var(--gray-900);
  background: var(--gray-50);
}
.l2-modeb-lens-tab.active {
  color: var(--brand-indigo-600);
  font-weight: 600;
  border-bottom-color: var(--brand-indigo-600);
}
@media (max-width: 720px) {
  .l2-modeb-header { gap: 0.5rem; padding: 0.4rem 0; }
  .l2-modeb-arrows { width: 100%; justify-content: space-between; }
  .l2-modeb-arrow { padding: 0.5rem 0.6rem; }
  .l2-modeb-picker { flex: 1; max-width: none; }
  .l2-modeb-lens-tab { padding: 0.6rem 0.7rem; font-size: 12.5px; }
}

/* Collapsible narrative panel (Mode B) */
.mode-b-narrative {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  margin-bottom: 0.85rem;
  overflow: hidden;
}
.mode-b-narrative-head {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.mode-b-narrative-head:hover { background: var(--gray-50); }
.mode-b-narrative-icon { font-size: 18px; line-height: 1; }
.mode-b-narrative-titleblock { min-width: 0; }
.mode-b-narrative-title {
  margin: 0 0 0.2rem 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
}
.mode-b-narrative-teaser {
  margin: 0;
  font-size: 12.5px;
  color: var(--gray-600);
  line-height: 1.4;
}
.mode-b-narrative-teaser strong { color: var(--gray-900); font-weight: 600; }
.mode-b-narrative-chev {
  font-size: 14px;
  color: var(--gray-400);
  transition: transform 0.18s;
}
.mode-b-narrative.expanded .mode-b-narrative-chev { transform: rotate(180deg); }
.mode-b-narrative-body {
  display: none;
  padding: 0 1.1rem 1rem 1.1rem;
  border-top: 1px solid var(--gray-100);
  padding-top: 0.85rem;
}
.mode-b-narrative.expanded .mode-b-narrative-body { display: block; }
.mode-b-narrative-body p {
  margin: 0 0 0.7rem 0;
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.55;
}
.mode-b-narrative-body p:last-of-type { margin-bottom: 0.85rem; }
/* Recommended Actions — reuses .card-callout.card-callout-recommendation
   (CLAUDE.md L3 Callouts). Local rules only add the header + numbered list. */
.mode-b-narrative-body .card-callout-recommendation {
  margin-top: 0.5rem;
}
.mode-b-narrative-actions-title {
  margin: 0 0 0.6rem 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  /* color inherits from .card-callout-recommendation */
}
.mode-b-narrative-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.mode-b-narrative-action {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 0.6rem;
  align-items: start;
  font-size: 12.5px;
  color: var(--gray-700);
  line-height: 1.5;
}
.mode-b-narrative-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--brand-indigo-50);
  color: var(--brand-indigo-700);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
}
@media (max-width: 720px) {
  .mode-b-narrative-head { padding: 0.75rem 0.95rem; }
  .mode-b-narrative-body { padding: 0.75rem 0.95rem 0.85rem; }
}

/* Mode A headline verdict — single sentence above the L1 strip.
   Inherits all visual rules from .mode-b-headline so the same component
   styles both modes. Add .l2-modea-headline + .mode-b-headline together. */
.l2-modea-headline { /* alias hook — pairs with .mode-b-headline */ }

/* Headline verdict bar (replaces L1 strip in Mode B; sits above L1 in Mode A)
   Compact-in-place variant locked 2026-07-08 — flat (no card), tight padding,
   ~50px total inner height vs the previous ~120px. Reclaims ~70px per drill-in
   across all People + Rewards + Workforce drill-ins. Spec §2. */
.mode-b-headline {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--gray-100);
  border-radius: 0;
  padding: 0.15rem 0 0.5rem;
  margin: 0 0 0.6rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
}
@media (max-width: 720px) {
  .mode-b-headline { grid-template-columns: 1fr; gap: 0.35rem; padding: 0.15rem 0 0.4rem; }
}
.mode-b-headline-main { min-width: 0; }
.mode-b-headline-label {
  font-size: 10px; font-weight: 600; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.1rem;
}
.mode-b-headline-text {
  font-size: 15px; font-weight: 700; line-height: 1.2;
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.mode-b-headline-text.verdict-good { color: var(--verdict-good); }
.mode-b-headline-text.verdict-warn { color: var(--verdict-warn); }
.mode-b-headline-text.verdict-bad { color: var(--verdict-bad); }
.mode-b-headline-text.verdict-await { color: var(--verdict-await); }
.mode-b-headline-icon { display: inline-flex; width: 14px; height: 14px; flex-shrink: 0; }
.mode-b-headline-icon svg { width: 14px; height: 14px; }
.mode-b-headline-foot {
  font-size: 11.5px; color: var(--gray-600); margin-top: 0.1rem;
  font-variant-numeric: tabular-nums;
}
.mode-b-headline-foot strong { color: var(--gray-900); font-weight: 700; }
.mode-b-headline-counts {
  display: flex; gap: 0.85rem;
  font-size: 11px; color: var(--gray-500);
  flex-wrap: wrap;
}
.mode-b-headline-count {
  display: inline-flex; align-items: center; gap: 0.3rem;
  white-space: nowrap;
}
.mode-b-headline-count-sw { width: 10px; height: 10px; border-radius: 2px; }
.mode-b-headline-count strong {
  color: var(--gray-900); font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Hero card */
.mode-b-hero {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 0.9rem 1rem 1rem;
}

/* View selector pill (Waffle / Rating Distribution) */
.mode-b-view-selector {
  display: inline-flex;
  background: var(--gray-100);
  padding: 3px;
  border-radius: 999px;
  margin-bottom: 0.85rem;
}
.mode-b-view-selector button {
  background: none; border: none;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 11px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  color: var(--gray-600);
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.mode-b-view-selector button.active {
  background: white;
  color: var(--gray-900);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.mode-b-view-selector button svg { width: 14px; height: 14px; }

/* Waffle chart */
.perf-waffle-wrap {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 1rem;
}
@media (max-width: 720px) {
  .perf-waffle-wrap { padding: 0.85rem; }
}
.perf-waffle-legend {
  display: flex; gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  font-size: 11px; color: var(--gray-700);
}
@media (max-width: 720px) {
  .perf-waffle-legend { gap: 0.55rem; font-size: 10.5px; }
}
.perf-waffle-legend-item {
  display: inline-flex; align-items: center; gap: 0.35rem;
  white-space: nowrap;
}
.perf-waffle-legend-sw { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }

.perf-waffle-section {
  background: white;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--gray-200);
}
.perf-waffle-section-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.6rem;
}
@media (max-width: 720px) {
  .perf-waffle-section-head { grid-template-columns: 1fr auto; gap: 0.5rem; }
}
.perf-waffle-section-title {
  font-size: 13px; font-weight: 600; color: var(--gray-900); margin: 0;
}
.perf-waffle-section-stats {
  display: inline-flex; gap: 0.7rem;
  font-size: 11px; color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}
.perf-waffle-section-stats strong { color: var(--gray-900); font-weight: 600; }
.perf-waffle-section-verdict {
  font-size: 11px; font-weight: 600;
  padding: 0.15rem 0.5rem; border-radius: 4px;
}
.perf-waffle-section-verdict.verdict-good { background: var(--verdict-good-bg); color: var(--verdict-good); }
.perf-waffle-section-verdict.verdict-warn { background: var(--verdict-warn-bg); color: var(--verdict-warn); }
.perf-waffle-section-verdict.verdict-bad { background: var(--verdict-bad-bg); color: var(--verdict-bad); }
@media (max-width: 720px) {
  .perf-waffle-section-verdict { grid-column: 1 / -1; }
}

.perf-waffle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 18px);
  gap: 4px;
}
@media (max-width: 720px) {
  .perf-waffle-grid {
    grid-template-columns: repeat(auto-fill, 22px);
    gap: 5px;
  }
}
.perf-waffle-cell {
  width: 18px; height: 18px;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  border: none; padding: 0;
  transition: transform 120ms cubic-bezier(0.4, 0, 0.2, 1);
}
@media (max-width: 720px) {
  .perf-waffle-cell { width: 22px; height: 22px; }
}
.perf-waffle-cell:hover { transform: scale(1.4); z-index: 5; }
.perf-waffle-cell:focus-visible {
  outline: 2px solid var(--brand-indigo-600);
  outline-offset: 1px;
}
.perf-waffle-cell.rating-1 { background: var(--perf-rating-1); }
.perf-waffle-cell.rating-2 { background: var(--perf-rating-2); }
.perf-waffle-cell.rating-3 { background: var(--perf-rating-3); }
.perf-waffle-cell.rating-4 { background: var(--perf-rating-4); }
.perf-waffle-cell.rating-5 { background: var(--perf-rating-5); }

/* Waffle cell tooltip */
.perf-waffle-cell::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--gray-900);
  color: white;
  padding: 0.35rem 0.6rem;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 100ms;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.perf-waffle-cell::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--gray-900);
  opacity: 0;
  transition: opacity 100ms;
  pointer-events: none;
  z-index: 50;
}
.perf-waffle-cell:hover::after,
.perf-waffle-cell:hover::before,
.perf-waffle-cell:focus-visible::after,
.perf-waffle-cell:focus-visible::before { opacity: 1; }

/* Rating distribution mini chart per dept */
.perf-dist-wrap {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 1rem;
}
.perf-dist-legend {
  display: flex; gap: 1rem;
  margin-bottom: 0.85rem;
  font-size: 11px; color: var(--gray-600);
  flex-wrap: wrap;
}
.perf-dist-legend-line {
  width: 20px; height: 2px;
  background: var(--brand-indigo-600);
  display: inline-block; vertical-align: middle;
}
.perf-dist-legend-line.target {
  background: none;
  border-top: 1.5px dashed var(--gray-400);
  height: 0;
  margin-top: 1px;
}
.perf-dist-section {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
}
.perf-dist-section-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}
@media (max-width: 720px) {
  .perf-dist-section-head { grid-template-columns: 1fr auto; gap: 0.5rem; }
}
.perf-dist-section-title { font-size: 13px; font-weight: 600; margin: 0; color: var(--gray-900); }
.perf-dist-section-stats {
  display: inline-flex; gap: 0.7rem;
  font-size: 11px; color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}
.perf-dist-section-stats strong { color: var(--gray-900); font-weight: 600; }
.perf-dist-section-verdict {
  font-size: 11px; font-weight: 600;
  padding: 0.15rem 0.5rem; border-radius: 4px;
}
.perf-dist-section-verdict.verdict-good { background: var(--verdict-good-bg); color: var(--verdict-good); }
.perf-dist-section-verdict.verdict-warn { background: var(--verdict-warn-bg); color: var(--verdict-warn); }
.perf-dist-section-verdict.verdict-bad { background: var(--verdict-bad-bg); color: var(--verdict-bad); }
@media (max-width: 720px) {
  .perf-dist-section-verdict { grid-column: 1 / -1; }
}
/* No max-width. The SVG viewBox is generated at the measured container width
   (_wireModeBDistCharts), so the chart fills whatever pane it is given rather
   than being letterboxed inside a fixed 500-unit box. A cap here would put the
   waste back: preserveAspectRatio="meet" centres the drawing and leaves the
   remainder empty, which is exactly the defect this replaced. */
.perf-dist-chart {
  height: 110px; position: relative;
  margin-top: 0.3rem;
  width: 100%;
}
@media (max-width: 720px) {
  .perf-dist-chart { height: 120px; max-width: 100%; }
}
.perf-dist-chart svg { width: 100%; height: 100%; display: block; }

/* Watchlist rows */
.perf-watchlist-rows { display: flex; flex-direction: column; gap: 0.4rem; }
.perf-watchlist-row {
  background: white; border: 1px solid var(--gray-200);
  border-radius: 6px; padding: 0.7rem 0.85rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem; align-items: center;
  cursor: pointer; font-family: inherit; text-align: left;
}
.perf-watchlist-row:hover { border-color: var(--brand-indigo-300); background: var(--gray-50); }
.perf-watchlist-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.perf-watchlist-dot.rating-1 { background: var(--perf-rating-1); }
.perf-watchlist-dot.rating-2 { background: var(--perf-rating-2); }
.perf-watchlist-name { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.perf-watchlist-name small {
  display: block; font-size: 11px; font-weight: 400; color: var(--gray-500);
}
.perf-watchlist-value {
  font-size: 12px; font-weight: 600;
  color: var(--gray-700);
  background: var(--gray-100); border-radius: 999px;
  padding: 0.15rem 0.6rem;
}

/* Mode B empty state */
.mode-b-empty {
  background: white;
  border: 1px dashed var(--gray-300);
  border-radius: 10px;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--gray-500);
  font-size: 13px;
}

/* Performance drawer — canonical line chart + employee tiles */
.perf-drawer-chart {
    width: 100%;
    overflow: hidden;
}
.perf-drawer-chart .perf-line-container,
.perf-drawer-chart .perf-line-large {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
}
.perf-drawer-chart svg {
    width: 100%;
    height: auto;
    display: block;
}
.perf-drawer-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.perf-drawer-tile {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: white;
    font-family: inherit;
    text-shadow: 0 1px 1px rgba(0,0,0,0.25);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.perf-drawer-tile:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.perf-drawer-tile.is-selected {
    box-shadow: 0 0 0 2px var(--gray-900);
    transform: translateY(-1px);
}
.perf-drawer-tile-more {
    text-align: center;
    font-size: 11px;
    color: var(--gray-500);
    padding-top: 0.4rem;
}

/* Inline 3-year history panel below the tiles */
.perf-drawer-history-panel:empty { display: none; }
.perf-drawer-history-panel { margin-top: 0.85rem; }
.perf-drawer-history {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 0.85rem;
}
.perf-drawer-history-head {
    margin-bottom: 0.75rem;
}
.perf-drawer-history-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
}
.perf-drawer-history-position {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 0.1rem;
}
.perf-drawer-history-cols {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}
.perf-drawer-history-col {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 0.5rem 0.4rem;
    text-align: center;
}
.perf-drawer-history-col-empty {
    background: var(--gray-100);
    border-style: dashed;
}
.perf-drawer-history-year {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 0.35rem;
    letter-spacing: 0.04em;
}
.perf-drawer-history-tile {
    width: 38px;
    height: 38px;
    margin: 0 auto 0.4rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 1px 1px rgba(0,0,0,0.25);
}
.perf-drawer-history-tile-empty {
    background: var(--gray-200);
    color: var(--gray-500);
    text-shadow: none;
    font-weight: 400;
}
.perf-drawer-history-band {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.15rem;
}
.perf-drawer-history-months {
    font-size: 9px;
    color: var(--gray-400);
}
.perf-drawer-history-trend {
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-200);
    font-size: 11px;
    color: var(--gray-700);
    text-align: center;
}
.perf-drawer-history-loading,
.perf-drawer-history-empty,
.perf-drawer-history-error {
    font-size: 11px;
    color: var(--gray-500);
    margin: 0.4rem 0 0;
    text-align: center;
}
.perf-drawer-history-error { color: var(--danger-color); }

/* Turnover perf chart cell — selected state when its drawer is open */
.l2-content .turnover-perf-cell[data-perf-band] {
    cursor: pointer;
    transition: background 0.12s ease, box-shadow 0.12s ease;
}
.l2-content .turnover-perf-cell[data-perf-band]:hover {
    background: rgba(0, 0, 0, 0.025);
}
.l2-content .turnover-perf-cell[data-perf-band].is-selected {
    background: var(--indigo-50, #eef2ff);
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

/* ============================================================
   Total Rewards card (Mode A) — locked 2026-06-22
   Primary lens = median TGC progression by grade.
   ============================================================ */
.tr-hero {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-top: 0.85rem;
}

/* By-grade bars */
.tr-grade-list { display: flex; flex-direction: column; gap: 0.45rem; }
.tr-grade-row {
    display: grid;
    grid-template-columns: 60px 1fr 175px;
    gap: 0.7rem;
    align-items: center;
    font-size: 12.5px;
}
.tr-grade-label { font-weight: 600; color: var(--gray-700); }
.tr-grade-bar {
    height: 22px;
    background: var(--gray-100);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}
.tr-grade-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--brand-indigo-500);
}
.tr-grade-fill.is-weak { background: var(--brand-amber-500); }
.tr-grade-stats {
    text-align: right;
    font-size: 11.5px;
    color: var(--gray-600);
    font-variant-numeric: tabular-nums;
}

/* Composition lens */

/* L1 strip on Total Rewards — consistent min-height with the People cards. */
.total-rewards-metrics-row .card-metric { min-height: 90px; }

/* Pay Equity hero (lens tabs + selected lens body) — mirrors .tr-* pattern. */
.pe-hero {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-top: 0.85rem;
}
.pay-equity-metrics-row .card-metric { min-height: 90px; }

/* ═══════════════════════════════════════════════════════════════════
   SoC v5 — Animated tree + tray + logic drawer
   Ported from client/soc-v5-complex-mockup.html
   Spec: docs/span-of-control-v5-implementation.md
   Replaces v4 drill-in chrome (v4 algorithm + prerequisite gate reused)
   ══════════════════════════════════════════════════════════════════ */

/* Transition duration tokens — manual toggle defaults; is-loop overrides for slower reading */
.socv5-shell {
    --node-transform-dur: 0.7s;
    --pill-transform-dur: 0.75s;
    --dot-transform-dur: 0.9s;
    --tray-transform-dur: 0.55s;
    --link-fade-dur: 0.5s;
    --link-fade-delay: 0.5s;
}
.socv5-shell .stage-diagram-wrap.is-loop {
    --node-transform-dur: 3s;
    --pill-transform-dur: 3s;
    --dot-transform-dur: 3s;
    --tray-transform-dur: 3s;
    --link-fade-dur: 1.5s;
    --link-fade-delay: 1s;
}

/* Stage shell + head + controls */
.socv5-shell {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}
.socv5-stage-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.socv5-stage-toggle {
    display: inline-flex;
    background: var(--gray-100);
    border-radius: 8px;
    padding: 3px;
}
.socv5-stage-toggle button {
    background: transparent;
    border: none;
    padding: 6px 14px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-600);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.socv5-stage-toggle button.active { background: white; color: var(--gray-900); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.socv5-stage-toggle button:hover:not(.active) { color: var(--gray-800); }

/* Diagram + tray two-column grid — tray docks on the right, tree fills the rest */
.socv5-shell .stage-diagram-wrap {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 1rem;
    align-items: flex-start;
}
.socv5-stage-diagram {
    position: relative;
    background: var(--gray-50);
    border-radius: 10px;
    padding: 0.5rem;
    overflow: hidden;
    min-width: 0;
}
.socv5-stage-diagram svg { display: block; width: 100%; height: auto; }
/* Tray column locks to the right of the grid */
.socv5-shell .removed-tray {
    position: sticky;
    top: 1rem;
    grid-column: 2;
}
/* Narrow-viewport fallback: stack tray below tree */
@media (max-width: 900px) {
    .socv5-shell .stage-diagram-wrap {
        grid-template-columns: 1fr;
    }
    .socv5-shell .removed-tray { position: static; grid-column: 1; }
}

/* ═══ Node styles ═══ */
.socv5-shell .node-group {
    transition: transform var(--node-transform-dur) cubic-bezier(0.34, 1.36, 0.64, 1),
                opacity var(--node-transform-dur) ease;
}
.socv5-shell .node-rect { rx: 6; stroke-width: 1.5; fill: white; }
.socv5-shell .node-rect.neutral   { stroke: var(--gray-300); }
.socv5-shell .node-rect.in-range  { stroke: var(--brand-green-500); fill: var(--brand-green-50); }
.socv5-shell .node-rect.outside   { stroke: var(--brand-amber-500); fill: var(--brand-amber-50); }
.socv5-shell .node-rect.critical  { stroke: var(--brand-red-500); fill: var(--brand-red-50); }
.socv5-shell .node-name  { font-size: 15px; font-weight: 700; fill: var(--gray-900); font-family: inherit; }
.socv5-shell .node-title { font-size: 13px; font-weight: 500; fill: var(--gray-600); font-family: inherit; }
.socv5-shell .node-rect { transition: stroke 0.4s ease, fill 0.4s ease; }

/* The target state on the box: its colour follows the proposed span */
.socv5-shell .stage-diagram-wrap.is-proposed .node-group.after-critical .node-rect,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .node-group.after-critical .node-rect { stroke: var(--brand-red-500); fill: var(--brand-red-50); }
.socv5-shell .stage-diagram-wrap.is-proposed .node-group.after-outside .node-rect,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .node-group.after-outside .node-rect { stroke: var(--brand-amber-500); fill: var(--brand-amber-50); }
.socv5-shell .stage-diagram-wrap.is-proposed .node-group.after-in-range .node-rect,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .node-group.after-in-range .node-rect { stroke: var(--brand-green-500); fill: var(--brand-green-50); }

/* will-remove nodes fade + strike in Proposed */
.socv5-shell .stage-diagram-wrap.is-proposed .node-group.will-remove,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .node-group.will-remove {
    opacity: 0.35;
}
.socv5-shell .stage-diagram-wrap.is-proposed .node-group.will-remove .node-name,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .node-group.will-remove .node-name {
    text-decoration: line-through;
}

/* Reporting lines: every line one weight, the new ones green and drawn in on Proposed */
.socv5-shell .link { fill: none; stroke: var(--gray-300); stroke-width: 1.5; }
.socv5-shell .link--ends { transition: opacity var(--link-fade-dur) ease; }
.socv5-shell .stage-diagram-wrap.is-proposed .link--ends,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .link--ends { opacity: 0; }
.socv5-shell .link-new {
    fill: none; stroke: var(--brand-green-600); stroke-width: 1.5;
    stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0;
    transition: stroke-dashoffset 0.7s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s;
}
.socv5-shell .stage-diagram-wrap.is-proposed .link-new,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .link-new {
    stroke-dashoffset: 0; opacity: 1;
    transition: stroke-dashoffset 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.35s, opacity 0.15s 0.35s;
}

/* One readout under each box, the same as a manager's row: the change, then the span */
.socv5-readout { transition: opacity 0.3s ease; }
.socv5-readout text { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; font-family: inherit; }
.socv5-readout--after { opacity: 0; }
.socv5-shell .stage-diagram-wrap.is-proposed .socv5-readout--after,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .socv5-readout--after { opacity: 1; }
.socv5-shell .stage-diagram-wrap.is-proposed .socv5-readout--before,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .socv5-readout--before { opacity: 0; }
.socv5-readout--good rect { fill: var(--brand-green-100); }
.socv5-readout--good .socv5-readout-span { fill: var(--brand-green-800); }
.socv5-readout--warn rect { fill: var(--brand-amber-100); }
.socv5-readout--warn .socv5-readout-span { fill: var(--brand-amber-800); }
.socv5-readout--bad rect { fill: var(--brand-red-100); }
.socv5-readout--bad .socv5-readout-span { fill: var(--brand-red-800); }
.socv5-readout--neutral rect { fill: var(--gray-100); }
.socv5-readout--neutral .socv5-readout-span { fill: var(--gray-700); }
.socv5-readout-change--up { fill: var(--brand-green-700); }
.socv5-readout-change--down { fill: var(--brand-red-600); }


/* ═══ Employee pills (rebalance stream — names visible) ═══ */
.socv5-shell .rebalance-employees { transition: opacity 0.25s; opacity: 1; }
.socv5-shell .employee-pill rect {
    fill: var(--brand-teal-500);
    stroke: white; stroke-width: 1.5;
    filter: drop-shadow(0 1px 2px rgba(20, 184, 166, 0.25));
}
.socv5-shell .employee-pill text {
    fill: white; font-size: 10.5px; font-weight: 600;
    font-family: inherit; pointer-events: none;
}
/* Pill sequence: fade in at source, hold, then translate */
.socv5-shell .employee-pill {
    opacity: 0;
    transition: opacity 0.3s ease,
                transform var(--pill-transform-dur) cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: calc(var(--i, 0) * 90ms),
                      calc(0.8s + var(--i, 0) * 90ms);
}
.socv5-shell .stage-diagram-wrap.is-proposed .employee-pill,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .employee-pill {
    opacity: 1;
    transform: translateX(165px);
}
/* Kitchen + Banquet directional overrides (LEFT slide) */
.socv5-shell .stage-diagram-wrap.is-proposed .kitchen-moves .employee-pill,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .kitchen-moves .employee-pill,
.socv5-shell .stage-diagram-wrap.is-proposed .banquet-moves .employee-pill,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .banquet-moves .employee-pill {
    transform: translateX(-140px);
}

/* ═══ Dots cluster (compact mode) ═══ */
.socv5-shell .dots-cluster,
.socv5-shell .kitchen-cluster,
.socv5-shell .banquet-cluster {
    transition: transform var(--pill-transform-dur) cubic-bezier(0.34, 1.36, 0.64, 1);
    transition-delay: 0.8s;
    opacity: 0;
    pointer-events: none;
}
.socv5-shell .dot-report {
    fill: var(--brand-teal-500);
    stroke: white; stroke-width: 1.2;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.6);
    transform-origin: center;
    transform-box: fill-box;
    transition: fill 0.15s, stroke 0.15s, r 0.15s,
                opacity 0.3s ease,
                transform 0.35s cubic-bezier(0.34, 1.7, 0.64, 1);
}
.socv5-shell .stage-diagram-wrap.is-proposed .dot-report,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .dot-report {
    opacity: 1;
    transform: scale(1);
}
.socv5-shell .dot-report:hover { fill: var(--brand-teal-600); stroke: var(--gray-900); stroke-width: 1.8; }
.socv5-shell .dots-badge { opacity: 0; transition: opacity 0.3s ease; }
.socv5-shell .stage-diagram-wrap.is-proposed .dots-badge,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .dots-badge { opacity: 1; }
.socv5-shell .dots-badge-rect { fill: var(--brand-teal-500); stroke: white; stroke-width: 1.5; }
.socv5-shell .dots-badge-text { fill: white; font-size: 11px; font-weight: 700; text-anchor: middle; }

.socv5-shell .range-dot { transition: fill 0.4s ease, stroke 0.4s ease; }

/* ═══ Range distribution strip ═══ */
.socv5-shell .range-strip {
    margin-bottom: 0.75rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}
.socv5-shell .range-strip-title {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    font-size: 12px; font-weight: 600; color: var(--gray-800); margin-bottom: 0.35rem;
}
.socv5-shell .range-strip-sub { font-size: 11px; font-weight: 500; color: var(--gray-500); }
.socv5-shell .range-axis { stroke: var(--gray-300); stroke-width: 1; }

.socv5-shell .range-dot { transition: cx var(--dot-transform-dur) cubic-bezier(0.34, 1.36, 0.64, 1); }
.socv5-shell .range-dot.critical { fill: var(--brand-red-500); }
.socv5-shell .range-dot.outside  { fill: var(--brand-amber-500); }
.socv5-shell .range-dot.in-range { fill: var(--brand-green-500); }
.socv5-shell .range-label {
    font-size: 9.5px; fill: var(--gray-600); text-anchor: middle; font-family: inherit;
    transition: x var(--dot-transform-dur) cubic-bezier(0.34, 1.36, 0.64, 1);
}

/* ═══ Removed tray + tray slots ═══ */
.socv5-shell .removed-tray {
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: 8px;
    padding: 0.75rem 0.65rem;
    min-height: 240px;
    display: flex; flex-direction: column; gap: 0.55rem;
}
.socv5-shell .removed-tray-title {
    display: flex; align-items: center; gap: 0.35rem;
    font-size: 11px; font-weight: 700; letter-spacing: 0.07em;
    text-transform: uppercase; color: var(--gray-500);
    padding-bottom: 0.5rem; border-bottom: 1px solid var(--gray-200);
    margin-bottom: 0.25rem;
}
.socv5-shell .removed-tray-title-count {
    background: var(--gray-800); color: white;
    border-radius: 999px; padding: 1px 6px;
    font-size: 9.5px; font-weight: 700;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.socv5-shell .stage-diagram-wrap.is-current .removed-tray-title-count { transform: scale(0); }
.socv5-shell .stage-diagram-wrap.is-proposed .removed-tray-title-count,
.socv5-shell .stage-diagram-wrap.is-loop .removed-tray-title-count { transform: scale(1); }

.socv5-shell .tray-slot {
    background: white;
    border: 1px solid var(--gray-300);
    border-left: 4px solid transparent;
    border-radius: 8px;
    padding: 0.65rem 0.65rem 0.65rem 0.75rem;
    opacity: 0;
    visibility: hidden;
    transform: translateX(30px);
    transition: opacity var(--tray-transform-dur) ease,
                visibility var(--tray-transform-dur),
                transform var(--tray-transform-dur) cubic-bezier(0.34, 1.36, 0.64, 1),
                border-left-color 0.5s ease,
                background-color 0.5s ease;
    font-size: 11.5px;
}
.socv5-shell .tray-slot.dot-arrived-critical { border-left-color: var(--brand-red-500); background-color: var(--brand-red-50); }
.socv5-shell .tray-slot.dot-arrived-outside  { border-left-color: var(--brand-amber-500); background-color: var(--brand-amber-50); }
.socv5-shell .stage-diagram-wrap.is-proposed .tray-slot,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .tray-slot { opacity: 1; transform: translateX(0); visibility: visible; }
.socv5-shell .tray-slot-name { font-weight: 600; color: var(--gray-900); }
.socv5-shell .tray-slot-arrow {
    margin-top: 0.4rem; padding-top: 0.4rem;
    border-top: 1px dashed var(--gray-200);
    font-size: 10.5px; color: var(--gray-600);
    display: flex; align-items: center; gap: 0.3rem;
}
.socv5-shell .tray-slot-arrow strong { color: var(--brand-teal-600); font-weight: 600; }
.socv5-shell .tray-slot[data-logic] { cursor: pointer; position: relative; }
.socv5-shell .tray-slot[data-logic]:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.socv5-shell .tray-empty-state {
    font-size: 11px; color: var(--gray-500);
    text-align: center; padding: 1rem 0.4rem;
    font-style: italic; opacity: 1;
    transition: opacity 0.3s;
}

/* ═══ Stage caption + loop progress ═══ */
.socv5-shell .stage-caption {
    margin-top: 1rem;
    background: var(--gray-900); color: white;
    padding: 0.95rem 1.2rem;
    border-radius: 10px;
    font-size: 13px; line-height: 1.5;
    display: flex; gap: 0.9rem; align-items: center;
}
.socv5-shell .stage-caption-tag {
    font-size: 10.5px; font-weight: 700;
    letter-spacing: 0.09em; text-transform: uppercase;
    padding: 3px 9px; border-radius: 999px;
    background: rgba(255,255,255,0.14); color: white;
    white-space: nowrap;
    transition: background 0.4s, color 0.4s;
}
.socv5-shell .stage-diagram-wrap.is-proposed ~ .stage-caption .stage-caption-tag,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed ~ .stage-caption .stage-caption-tag {
    background: var(--brand-teal-500); color: white;
}
.socv5-shell .stage-caption-body { flex: 1; }
.socv5-shell .stage-caption-current, .socv5-shell .stage-caption-proposed {
    display: block; transition: opacity 0.4s;
}
.socv5-shell .stage-caption-proposed { position: absolute; opacity: 0; }
.socv5-shell .stage-caption-container { position: relative; min-height: 42px; }
.socv5-shell .stage-diagram-wrap.is-proposed ~ .stage-caption .stage-caption-current,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed ~ .stage-caption .stage-caption-current { opacity: 0; }
.socv5-shell .stage-diagram-wrap.is-proposed ~ .stage-caption .stage-caption-proposed,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed ~ .stage-caption .stage-caption-proposed { opacity: 1; position: relative; }
.socv5-shell .loop-progress {
    height: 3px; background: var(--gray-200);
    border-radius: 2px; margin-top: 0.6rem;
    overflow: hidden; opacity: 0; transition: opacity 0.3s;
}
.socv5-shell .stage-diagram-wrap.is-loop ~ .stage-caption + .loop-progress { opacity: 1; }
.socv5-shell .loop-progress-fill {
    height: 100%; background: var(--brand-teal-500); width: 0;
}

/* The consolidation explanation's header and body */
.socv5-logic-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--gray-200);
}
.socv5-logic-eyebrow {
    font-size: 10.5px; font-weight: 700;
    letter-spacing: 0.09em; text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 0.35rem;
}
.socv5-logic-title {
    font-weight: 600;
    font-size: 22px; line-height: 1.15;
    color: var(--gray-900);
    margin: 0 0 0.5rem;
}
.socv5-logic-tier {
    display: inline-block;
    font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
    padding: 3px 10px; border-radius: 999px;
    background: var(--brand-teal-500); color: white;
}
.socv5-logic-tier.tier-t2 { background: var(--brand-amber-500); }
.socv5-logic-tier.tier-middle { background: var(--gray-600); }
.socv5-logic-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem 2rem;
}

/* ═══ Drawer content blocks ═══ */
.socv5-logic-block { margin-bottom: 1.5rem; }
.socv5-logic-block-title {
    font-size: 10.5px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 0.6rem;
}

/* Block 1 — The pair */
.socv5-pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.socv5-pair-card {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.85rem 0.9rem;
    background: var(--gray-50);
}
.socv5-pair-card.pair-loser  { border-color: var(--brand-red-500);  background: var(--brand-red-50); }
.socv5-pair-card.pair-keeper { border-color: var(--brand-teal-500); background: var(--brand-teal-50); }
.socv5-pair-card-role {
    font-size: 10px; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 0.3rem;
}
.socv5-pair-card.pair-loser .socv5-pair-card-role  { color: var(--brand-red-500); }
.socv5-pair-card.pair-keeper .socv5-pair-card-role { color: var(--brand-teal-600); }
.socv5-pair-card-name { font-weight: 700; color: var(--gray-900); margin-bottom: 0.15rem; font-size: 14px; }
.socv5-pair-card-sub  { font-size: 11px; color: var(--gray-600); margin-bottom: 0.55rem; }
.socv5-pair-card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem 0.6rem; font-size: 11.5px; }
.socv5-pair-stat-label {
    color: var(--gray-500); font-size: 10px;
    letter-spacing: 0.03em; text-transform: uppercase; font-weight: 600;
}
.socv5-pair-stat-value {
    color: var(--gray-900); font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

/* Block 2 — Rationale */
.socv5-tier-explainer {
    border-left: 3px solid var(--brand-teal-500);
    background: var(--brand-teal-50);
    padding: 0.65rem 0.85rem;
    border-radius: 0 6px 6px 0;
    font-size: 12.5px; color: var(--gray-700); line-height: 1.5;
}
.socv5-tier-explainer.tier-t2     { border-left-color: var(--brand-amber-500); background: var(--brand-amber-50); }
.socv5-tier-explainer.tier-middle { border-left-color: var(--brand-indigo-500); background: #eef2ff; }
.socv5-tier-explainer strong { color: var(--gray-900); }

/* Block 3 — Tie-break trace */
.socv5-trace-list { list-style: none; padding: 0; margin: 0; counter-reset: trace; }
.socv5-trace-step {
    display: grid; grid-template-columns: 28px 1fr;
    gap: 0.6rem; padding: 0.55rem 0;
    border-bottom: 1px dashed var(--gray-200);
}
.socv5-trace-step:last-child { border-bottom: none; }
.socv5-trace-step-num {
    counter-increment: trace;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-500);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
}
.socv5-trace-step-num::before { content: counter(trace); }
.socv5-trace-step.decisive .socv5-trace-step-num { background: var(--brand-teal-500); color: white; }
.socv5-trace-step-body { font-size: 12.5px; color: var(--gray-700); line-height: 1.4; }
.socv5-trace-step-label { color: var(--gray-900); font-weight: 600; margin-bottom: 0.1rem; }
.socv5-trace-step.decisive .socv5-trace-step-label { color: var(--brand-teal-600); }
.socv5-trace-step-detail { font-size: 11.5px; color: var(--gray-600); }
.socv5-trace-step-detail code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--gray-100);
    padding: 1px 5px; border-radius: 3px;
    color: var(--gray-800); font-size: 10.5px;
}
.socv5-trace-step-decision {
    display: inline-block; margin-top: 0.25rem;
    font-size: 10.5px; font-weight: 700;
    letter-spacing: 0.03em; text-transform: uppercase;
    color: var(--brand-teal-600);
}
.socv5-trace-step:not(.decisive) .socv5-trace-step-decision { color: var(--gray-400); }

/* Block 4 — Reports moved */
.socv5-reports-list { display: flex; flex-direction: column; gap: 0.4rem; }
.socv5-report-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.7rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
}
.socv5-report-emp, .socv5-report-dest { display: flex; flex-direction: column; min-width: 0; }
.socv5-report-dest { text-align: right; }
.socv5-report-emp-name, .socv5-report-dest-name {
    font-weight: 600; color: var(--gray-900); font-size: 12.5px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.socv5-report-dest-name { color: var(--brand-teal-600); }
.socv5-report-emp-role, .socv5-report-dest-label {
    font-size: 10.5px; color: var(--gray-500);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.socv5-report-arrow { color: var(--brand-teal-500); font-weight: 700; font-size: 14px; }
.socv5-report-row.report-promoted { background: #eef2ff; border-color: var(--brand-indigo-500); }
.socv5-report-row.report-promoted .socv5-report-dest-name { color: var(--brand-indigo-500); }
.socv5-report-row.report-promoted .socv5-report-arrow { color: var(--brand-indigo-500); }
.socv5-reports-note {
    margin-top: 0.6rem;
    font-size: 11px; color: var(--gray-600);
    padding: 0.5rem 0.7rem;
    background: var(--gray-50);
    border-left: 3px solid var(--gray-300);
    border-radius: 0 4px 4px 0;
    line-height: 1.5;
}

/* Block 5 — Outcome */
.socv5-outcome-card {
    background: var(--brand-green-50);
    border: 1px solid var(--brand-green-500);
    border-radius: 8px;
    padding: 0.85rem 1rem;
}
.socv5-outcome-title { font-weight: 700; color: var(--gray-900); margin-bottom: 0.6rem; font-size: 13px; line-height: 1.4; }
.socv5-outcome-before-after {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.5rem; align-items: center;
    margin-top: 0.55rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
}
.socv5-outcome-cell {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 0.45rem 0.55rem;
    text-align: center;
}
.socv5-outcome-cell-label {
    font-family: inherit;
    font-size: 9.5px; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--gray-500); margin-bottom: 0.15rem;
}
.socv5-outcome-arrow { color: var(--brand-green-600); font-weight: 700; font-size: 16px; }
.socv5-outcome-landing { margin-top: 0.55rem; font-size: 11px; color: var(--brand-green-600); font-weight: 600; }

/* Footnote */
.socv5-logic-footnote {
    font-size: 10.5px; color: var(--gray-500);
    font-style: italic;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--gray-200);
    margin-top: 0.5rem; line-height: 1.5;
}

/* ═══ The department's page: slim head, then list · panel · chart (approved 2026-11-04) ═══ */
.l2-modeb-lens-tabs.l2-tabs-split--slim { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.l2-tabs-split--slim .l2-tabs-left { flex: none; width: auto; }
.l2-tabs-split--slim .l2-tabs-center { display: none; }
.l2-tabs-split--slim .l2-tabs-right { flex: none; width: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.25rem 0.75rem; }
.l2-tabs-split--slim .l2-aside-foot { margin: 0; padding: 0; border: 0; font-size: var(--text-body); white-space: nowrap; }
.l2-tabs-split--slim .drill-stacked-method { display: flex; align-items: center; gap: 0.6rem; margin: 0; }
.l2-tabs-split--slim .l2-method-card { padding: 0.2rem 0.5rem; margin: 0; width: auto; min-height: 0; font-size: var(--text-sm); white-space: nowrap; }
.l2-tabs-split--slim .drill-stacked-method .target-source-note { margin: 0; padding: 0; background: none; border: 0; display: flex; flex-direction: row; align-items: center; gap: 0.35rem; font-size: var(--text-xs); white-space: nowrap; }
.l2-tabs-split--slim .target-source-list { margin: 0; padding: 0; list-style: none; }
.drill-slim-metrics { margin: 0 0 0.6rem; }
.drill-slim-metrics .l1-strip { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; margin: 0; padding: 0; border: 0; background: none; }
.drill-slim-metrics .l1-metric { display: inline-flex; flex-direction: row; align-items: baseline; gap: 0.3rem; min-width: 0; min-height: 0; padding: 0; background: none; border: 0; box-shadow: none; }
.drill-slim-metrics .l1-metric-value { font-size: var(--text-body); font-weight: 700; }
.drill-slim-metrics .l1-metric-label { font-size: var(--text-sm); margin: 0; }
.drill-slim-metrics .l1-metric-subtext { font-size: var(--text-xs); margin: 0; }
.lens-body--plain { margin: 0; padding: 0; }

.socv5-shell { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 0.75rem; align-items: center; }
.socv5-shell > .socv5-stage-controls { grid-column: 1; grid-row: 1; margin: 0; }
.socv5-shell > .socv5-stage-controls[hidden] { display: none; }
.socv5-shell > .socv5-stage-controls[hidden] ~ .stage-caption { grid-column: 1 / -1; }
.socv5-shell > .stage-caption { grid-column: 2; grid-row: 1; margin: 0; padding: 0.4rem 0.75rem; font-size: var(--text-sm); line-height: 1.3; border-radius: var(--radius); gap: 0.6rem; }
.socv5-shell > .loop-progress { grid-column: 1 / -1; grid-row: 2; margin: 0.35rem 0 0.5rem; }
.socv5-shell > .stage-diagram-wrap { grid-column: 1 / -1; grid-row: 3; min-width: 0; }
.socv5-shell .stage-caption-container { min-height: 0; }
.socv5-shell .stage-diagram-wrap.is-proposed ~ .stage-caption .stage-caption-current,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed ~ .stage-caption .stage-caption-current { position: absolute; }

.socv5-shell .stage-diagram-wrap { grid-template-columns: minmax(0, 400px) 172px minmax(0, 1fr); gap: 0.5rem; align-items: start; }
.socv5-stage-diagram { display: contents; }
.socv5-shell .range-strip { grid-column: 1; grid-row: 1; margin: 0; padding: 0.5rem 0.65rem; }
.socv5-shell .removed-tray { grid-column: 2; grid-row: 1; position: static; padding: 0.45rem 0.55rem; }
.socv5-shell .socv5-chart { grid-column: 3; grid-row: 1; min-width: 0; position: relative; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 0.5rem 0.6rem; }
.socv5-shell .socv5-chart svg { display: block; width: 100%; height: auto; margin: 0.25rem auto 0; }
.socv5-shell .range-strip-title { margin-bottom: 0.2rem; font-size: var(--text-sm); gap: 0.5rem; }
.socv5-shell .range-strip-sub { white-space: nowrap; }
.socv5-proposed-only { display: none; }
.socv5-shell .stage-diagram-wrap.is-proposed .socv5-proposed-only,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .socv5-proposed-only { display: inline; }
.socv5-key-new { display: inline-block; width: 14px; height: 0; border-top: 1.5px solid var(--brand-green-600); vertical-align: middle; margin-right: 0.3rem; }

/* The managers: one line each; the dot slides, the rows re-sort */
.socv5-managers .bgraph-rows { gap: 0; }
.socv5-managers .socv5-mrow { grid-template-columns: 118px minmax(0, 1fr) 58px; gap: 0.35rem; padding: 0.22rem 0; font-size: var(--text-sm); align-items: center; border: 0; position: relative; background: var(--white); transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s; }
.socv5-managers .bgraph-axis { margin: 0 calc(58px + 0.35rem) 0.1rem calc(118px + 0.35rem); }
.socv5-managers .bgraph-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.socv5-managers .bgraph-cell { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 18px; }
.socv5-managers .bgraph-value { display: flex; align-items: center; justify-content: flex-end; gap: 0.25rem; }
.socv5-managers .bd-pill { padding: 0.05rem 0.3rem; font-size: var(--text-xs); transition: background-color 0.5s, color 0.5s; }
.socv5-managers .bgraph-dot { transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s, background-color 0.5s; }
.socv5-managers .bgraph-zone { transition: opacity 0.4s; }
.socv5-managers .socv5-move { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); margin: 0; text-align: center; font-size: var(--text-xs); line-height: 1.3; color: var(--gray-800); white-space: nowrap; }
.socv5-managers .bgraph-legend { margin: 0.3rem 0 0; gap: 0 0.5rem; font-size: var(--text-xs); row-gap: 0; }
.socv5-managers .bd-direction { margin-top: 0.15rem; font-size: var(--text-xs); line-height: 1.25; }
.socv5-mrow.is-gone .bgraph-dot { opacity: 0; }
.socv5-mrow.is-gone .bgraph-zone { opacity: 0.45; }
.socv5-mrow.is-gone .bgraph-label { color: var(--gray-500); }
.socv5-net { font-size: var(--text-xs); font-weight: 700; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity 0.3s ease; }
.socv5-net--up { color: var(--brand-green-700); }
.socv5-net--down { color: var(--brand-red-600); }
.socv5-shell .stage-diagram-wrap.is-proposed .socv5-net,
.socv5-shell .stage-diagram-wrap.is-loop.showing-proposed .socv5-net { opacity: 1; }

/* The panel: a name and where the team goes */
.socv5-shell .tray-slot { padding: 0.3rem 0.5rem; min-height: 0; }
.socv5-shell .tray-slot-name { font-size: var(--text-sm); line-height: 1.25; }
.socv5-shell .tray-slot-arrow { font-size: var(--text-xs); margin: 0; padding: 0; border: 0; }
.socv5-shell .removed-tray { gap: 0.3rem; }
.socv5-shell .removed-tray-title { margin-bottom: 0.1rem; padding-bottom: 0.25rem; font-size: var(--text-xs); letter-spacing: 0.03em; }
.socv5-shell .tray-slot.is-open { box-shadow: 0 0 0 2px var(--brand-teal-500); }

/* The explanation takes the org chart's place */
.socv5-chart.is-explaining > .range-strip-title,
.socv5-chart.is-explaining > svg { display: none; }
.socv5-explain { position: relative; max-height: 560px; overflow: auto; margin: -0.5rem -0.6rem; }
.socv5-explain-close { position: sticky; float: right; top: 0.45rem; right: 0.45rem; margin: 0.45rem 0.45rem 0 0; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); background: var(--white); color: var(--gray-500); font-size: 18px; line-height: 1; cursor: pointer; }
.socv5-explain-close:hover { background: var(--gray-100); color: var(--gray-900); }
.socv5-explain .socv5-logic-header { padding: 0.7rem 0.85rem 0.55rem; }
.socv5-explain .socv5-logic-title { font-size: var(--text-body); margin: 0.1rem 0 0.3rem; padding-right: 1.5rem; }
.socv5-explain .socv5-logic-title:focus { outline: none; }
.socv5-explain .socv5-logic-body { overflow: visible; padding: 0.65rem 0.85rem 0.85rem; }
.socv5-outcome-planned { margin-top: 0.35rem; font-size: var(--text-xs); color: var(--gray-700); }

/* The overview's rows */
.socv5-sentence { margin: 0.25rem 0 0.75rem; font-size: var(--text-body); color: var(--gray-700); }
.socv5-sentence + .bgraph-legend { margin-bottom: 1rem; }
.socv5-rows .socv5-see { display: block; margin-top: 0.15rem; font-size: var(--text-sm); font-weight: 500; color: var(--brand-indigo-700); line-height: 1.3; }
.socv5-rows [data-soc-v4-dept]:hover .socv5-see { text-decoration: underline; }
.socv5-see-end { white-space: nowrap; }
.socv5-see-chev { vertical-align: -2px; }
.socv5-tiers { display: inline-flex; gap: 0.25rem; margin-left: 0.4rem; vertical-align: 1px; }
.socv5-tiers .soc-v4-tier-pill { margin: 0; }
.socv5-tiers [data-tooltip] { cursor: help; }
.socv5-row--wide .bgraph-lane-box { background: var(--brand-amber-500); }
.socv5-row--wide .bgraph-range { color: var(--brand-amber-800); font-weight: 600; }
.socv5-move-arrow { display: none; }
@media (max-width: 640px) {
    .socv5-move-words { display: none; }
    .socv5-move-arrow { display: inline; }
    .socv5-managers .socv5-move { overflow: hidden; text-overflow: ellipsis; }
    .socv5-shell .socv5-chart { overflow-x: auto; }
    .socv5-shell .socv5-chart svg { min-width: 640px; }
}
@media (min-width: 641px) {
    .socv5-rows .bgraph-row { grid-template-columns: 230px minmax(0, 1fr) 64px; }
    .socv5-rows .bgraph-axis { margin-left: calc(230px + 0.75rem); }
}

@media (max-width: 1100px) {
    .socv5-shell .stage-diagram-wrap { grid-template-columns: minmax(0, 1fr) 172px; }
    .socv5-shell .socv5-chart { grid-column: 1 / -1; grid-row: 2; }
    .socv5-shell .range-strip-title { flex-wrap: wrap; }
    .socv5-shell .range-strip-sub { white-space: normal; }
    .l2-tabs-split--slim .l2-tabs-right { flex: 1 1 auto; min-width: 0; }
    .l2-tabs-split--slim .l2-aside-foot, .l2-tabs-split--slim .l2-method-card, .l2-tabs-split--slim .drill-stacked-method .target-source-note { white-space: normal; }
    .l2-tabs-split--slim .drill-stacked-method { flex-wrap: wrap; min-width: 0; }
}
@media (max-width: 900px) {
    .socv5-shell { grid-template-columns: minmax(0, 1fr); padding: 0.75rem; }
    .socv5-shell > .socv5-stage-controls { grid-column: 1; grid-row: 1; margin-bottom: 0.4rem; }
    .socv5-shell > .stage-caption { grid-column: 1; grid-row: 2; }
    .socv5-shell > .loop-progress { grid-column: 1; grid-row: 3; }
    .socv5-shell > .stage-diagram-wrap { grid-column: 1; grid-row: 4; }
    .socv5-shell .stage-diagram-wrap { grid-template-columns: minmax(0, 1fr); }
    .socv5-shell .removed-tray, .socv5-shell .range-strip, .socv5-shell .socv5-chart { grid-column: 1; grid-row: auto; }
    .socv5-managers .socv5-mrow { grid-template-columns: 110px minmax(0, 1fr) 58px; }
    .socv5-managers .bgraph-axis { margin: 0 calc(58px + 0.35rem) 0.1rem calc(110px + 0.35rem); }
    .l2-modeb-lens-tabs.l2-tabs-split--slim { flex-wrap: wrap; }
}

/* Reduced motion — kill all animations */
@media (prefers-reduced-motion: reduce) {
    .socv5-shell .node-group,
    .socv5-shell .link,
    .socv5-shell .tray-slot,
    .socv5-shell .stage-caption-current,
    .socv5-shell .stage-caption-proposed,
    .socv5-shell .employee-pill,
    .socv5-shell .dot-report,
    .socv5-shell .dots-cluster,
    .socv5-shell .kitchen-cluster,
    .socv5-shell .banquet-cluster,
    .socv5-shell .range-dot,
    .socv5-shell .link-new,
    .socv5-shell .link--ends,
    .socv5-readout,
    .socv5-net,
    .socv5-managers .socv5-mrow,
    .socv5-managers .bgraph-dot,
    .socv5-managers .bd-pill,
    .socv5-managers .bgraph-zone {
        transition: none !important;
        animation: none !important;
    }
}
/* ── SoC v5 Overview — action-first prioritized list ── */
.socv5-opp-strip {
    margin-bottom: 1.5rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.85rem 1rem;
}
.socv5-opp-strip-bar {
    display: flex;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    gap: 2px;
    background: var(--gray-100);
}
.socv5-opp-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    overflow: hidden;
    padding: 0 0.5rem;
    white-space: nowrap;
}
.socv5-opp-seg.action  { background: var(--brand-amber-500); }
/* Neutral, not green. "Nothing to consolidate" is the ABSENCE of a finding, not a
   good result — on live data those departments held 37 managers outside their band.
   Green said healthy in colour after the label stopped saying it in words, which
   left half the claim standing. Amber stays on the other segment: an opportunity
   is genuinely actionable. */
.socv5-opp-seg.healthy { background: var(--gray-400); }
.socv5-opp-seg span { text-overflow: ellipsis; overflow: hidden; }
/* Segments are flex-sized by department count, so a 2-vs-24 split leaves the
   smaller one far too narrow for its label — it rendered as "2 action nee…".
   A floor wide enough for the words, and the count stays legible either way. */
.socv5-opp-seg { min-width: max-content; }
@media (max-width: 900px) { .socv5-opp-seg { min-width: 0; } }

.socv5-overview-section {
    margin-bottom: 1.5rem;
}
.socv5-overview-section-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--gray-200);
}
.socv5-overview-section-count {
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--gray-500);
}

.socv5-healthy-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: 8px;
    padding: 0.85rem 1.1rem;
    font-family: inherit;
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-align: left;
}
.socv5-healthy-toggle:hover {
    background: white;
    border-color: var(--gray-400);
}
.socv5-healthy-toggle-icon {
    font-size: 12px;
    color: var(--gray-500);
    display: inline-block;
    width: 14px;
    text-align: center;
    transition: transform 0.15s;
}
.socv5-healthy-toggle-label {
    flex: 1;
    color: var(--gray-700);
    font-size: 13px;
}
.socv5-healthy-toggle-label strong {
    color: var(--gray-900);
    font-weight: 700;
}
.socv5-healthy-toggle-hint {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gray-500);
}
.socv5-healthy-list { margin-top: 1rem; }

.socv5-overview-empty {
    background: var(--brand-green-50);
    border: 1px solid var(--brand-green-500);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    color: var(--gray-800);
    line-height: 1.5;
    font-size: 13.5px;
}
.socv5-overview-empty strong {
    display: block;
    color: var(--gray-900);
    margin-bottom: 0.35rem;
    font-size: 14.5px;
}
/* End SoC v5 chrome */

/* ═══════════════════════════════════════════════════════════════════
   EXPLORER — interactive dot-based workforce visualisation
   Ported from client/explorer-mockup.html
   Spec: docs/workforce-explorer-spec.md
   ══════════════════════════════════════════════════════════════════ */

/* Flex-fill layout so the chart canvas always occupies the visible viewport.
   Top-bar is ~56px + a small breathing gap; the shell itself absorbs everything else.
   Insight strip is repositioned absolutely over the chart (see .chart-canvas below). */
.explorer-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0.9rem 2rem 0.9rem;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px - 1.5rem);
    min-height: 620px;
    gap: 0.75rem;
}

/* Page head — compact single-line strip. Hotel + month live in the top bar now. */
.explorer-shell .page-head {
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 0.55rem;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.explorer-shell .page-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 0.35rem;
}
.explorer-shell .page-head h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.2;
}
.explorer-shell .page-meta {
    font-size: 12px;
    color: var(--gray-500);
    text-align: right;
    line-height: 1.5;
}

/* Chart + sidebar split — chart takes 1fr, insight sidebar takes fixed 300px.
   Sidebar is ALWAYS visible: empty-state placeholder before a pairing is picked,
   populated once an activator runs. Chart canvas never gets covered. */
.explorer-shell .chart-and-side {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 0.75rem;
    min-height: 0;
}
@media (max-width: 1100px) {
    .explorer-shell .chart-and-side {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }
}

/* Insight sidebar — fixed right column inside .chart-and-side. Populated state. */
.explorer-shell .insight-strip {
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-left: 3px solid var(--brand-indigo-500);
    border-radius: 7px;
    padding: 0.8rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    overflow-y: auto;
    min-height: 0;
    animation: explorer-insight-fade-in 0.35s ease;
}
@keyframes explorer-insight-fade-in {
    from { opacity: 0; transform: translateX(6px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Empty state — before any pairing has been picked */
.explorer-shell .insight-strip.empty {
    border-left-color: var(--gray-200);
    justify-content: center;
    align-items: flex-start;
}
.explorer-shell .insight-strip.empty .empty-eye {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray-400);
    margin-bottom: 0.35rem;
}
.explorer-shell .insight-strip.empty .empty-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.3;
    margin-bottom: 0.4rem;
}
.explorer-shell .insight-strip.empty .empty-body {
    font-size: 12px;
    color: var(--gray-600);
    line-height: 1.5;
}
.explorer-shell .insight-strip.empty .empty-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.75rem;
}
.explorer-shell .insight-strip.empty .empty-chip {
    padding: 3px 10px;
    border: 1px solid var(--brand-indigo-600);
    color: var(--brand-indigo-600);
    background: white;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
}
.explorer-shell .insight-strip.empty .empty-chip:hover {
    background: var(--brand-indigo-600);
    color: white;
}

/* ─── Discovered panel (Session 7 — spec §8.5) ─── */
.explorer-shell .insight-strip .discovered-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.explorer-shell .insight-strip .discovered-tag {
    background: var(--brand-indigo-600);
    color: white;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}
.explorer-shell .insight-strip .discovered-count {
    font-size: 11px;
    color: var(--gray-600);
    font-weight: 500;
}
.explorer-shell .insight-strip .discovered-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}
.explorer-shell .insight-strip .discovered-row {
    display: block;
    text-align: left;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 0.55rem 0.65rem;
    cursor: pointer;
    transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
    color: var(--gray-800);
    font: inherit;
    width: 100%;
}
.explorer-shell .insight-strip .discovered-row:hover {
    border-color: var(--brand-indigo-500);
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.12);
    transform: translateY(-1px);
}
.explorer-shell .insight-strip .discovered-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.2rem;
}
.explorer-shell .insight-strip .discovered-row-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--brand-indigo-600);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.explorer-shell .insight-strip .discovered-row-headline {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.35;
    margin-bottom: 0.15rem;
}
.explorer-shell .insight-strip .discovered-row-cta {
    font-size: 10.5px;
    color: var(--brand-indigo-600);
    font-weight: 600;
}
.explorer-shell .insight-strip .sig-bars {
    display: inline-flex;
    gap: 2px;
    align-items: center;
}
.explorer-shell .insight-strip .sig-bar {
    width: 3px;
    height: 10px;
    background: var(--gray-300);
    border-radius: 1px;
    display: inline-block;
}
.explorer-shell .insight-strip .sig-bar.on {
    background: var(--brand-indigo-500);
}
.explorer-shell .insight-strip .discovered-footer {
    margin-top: auto;
    padding-top: 0.6rem;
    border-top: 1px solid var(--gray-200);
}
.explorer-shell .insight-strip .discovered-footer-label {
    font-size: 9.5px;
    font-weight: 600;
    color: var(--gray-500);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.35rem;
}
.explorer-shell .insight-strip .discovered-footer-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.explorer-shell .insight-strip .discovered-footer-chips .empty-chip {
    padding: 3px 8px;
    font-size: 10.5px;
}

/* ─── Pre-computed pairing insight (from _explorerRenderInsightFromSnapshot) ─── */
.explorer-shell .insight-strip .signal {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 10.5px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.explorer-shell .insight-strip .rec-block {
    background: #f0fdf4;
    border-left: 3px solid var(--brand-green-500);
    padding: 0.55rem 0.7rem;
    border-radius: 5px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--gray-800);
    margin-top: 0.5rem;
}
.explorer-shell .insight-strip .rec-block .rec-eye {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-green-700);
    display: block;
    margin-bottom: 0.25rem;
}
.explorer-shell .insight-strip .rec-block strong {
    color: var(--gray-900);
    font-weight: 700;
}
.explorer-shell .insight-body { font-size: 13.5px; margin-bottom: 0.35rem; }
.explorer-shell .peer-line { font-size: 12.5px; padding-top: 0.4rem; margin-top: 0.5rem; }
.explorer-shell .action { margin-top: 0.55rem; padding: 0.5rem 0.7rem; }
.explorer-shell .action-body { font-size: 12.5px; }
.explorer-shell .also-try { margin-top: 0.55rem; padding-top: 0.5rem; }
.explorer-shell .insight-eyebrow {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.7rem;
    flex-wrap: wrap;
}
.explorer-shell .insight-tag {
    background: var(--brand-indigo-500);
    color: white;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 999px;
}
.explorer-shell .pair-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 13px;
}
.explorer-shell .strength {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 11.5px;
    color: var(--gray-600);
    font-weight: 500;
}
.explorer-shell .strength-bar {
    display: inline-flex;
    gap: 2px;
}
.explorer-shell .strength-bar span {
    width: 5px;
    height: 12px;
    background: var(--gray-200);
    border-radius: 1px;
}
.explorer-shell .strength-bar span.active { background: var(--brand-indigo-500); }
.explorer-shell .insight-body {
    font-size: 15px;
    line-height: 1.55;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}
.explorer-shell .insight-body strong { color: var(--gray-900); font-weight: 700; }
.explorer-shell .peer-line {
    font-size: 13.5px;
    color: var(--gray-600);
    line-height: 1.5;
    padding-top: 0.55rem;
    border-top: 1px dashed var(--gray-200);
    margin-top: 0.7rem;
}
.explorer-shell .peer-line strong { color: var(--gray-800); font-weight: 600; }

.explorer-shell .action {
    margin-top: 0.85rem;
    background: var(--brand-green-50);
    border-left: 3px solid var(--brand-green-500);
    padding: 0.7rem 0.95rem;
    border-radius: 0 6px 6px 0;
}
.explorer-shell .action-title {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--brand-green-600);
    margin-bottom: 0.2rem;
}
.explorer-shell .action-body {
    font-size: 13.5px;
    color: var(--gray-800);
    line-height: 1.5;
}
.explorer-shell .action-body strong { color: var(--gray-900); font-weight: 700; }

.explorer-shell .also-try {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.85rem;
    padding-top: 0.7rem;
    border-top: 1px dashed var(--gray-200);
}
.explorer-shell .also-try-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.explorer-shell .pill {
    background: white;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.explorer-shell .pill:hover {
    background: var(--brand-indigo-500);
    border-color: var(--brand-indigo-500);
    color: white;
}

/* Suggested pairings row (entry state) */
.explorer-shell .suggested-row {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    margin-bottom: 0;
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.explorer-shell .suggested-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--gray-500);
}
.explorer-shell .suggested-chip {
    background: white;
    border: 1.5px solid var(--brand-indigo-500);
    color: var(--brand-indigo-500);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}
.explorer-shell .suggested-chip:hover {
    background: var(--brand-indigo-500);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(79, 70, 229, 0.25);
}

/* Controls — X/Y/Colour pickers + peer toggle */
.explorer-shell .controls {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
    flex-shrink: 0;
}
.explorer-shell .control-group { gap: 0.2rem; }
.explorer-shell .control-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.explorer-shell .control-group label {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-500);
}
.explorer-shell .control-group select {
    font-family: inherit;
    font-size: 13px;
    padding: 6px 28px 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    color: var(--gray-800);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%234b5563' fill='none' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.explorer-shell .control-group select:hover { border-color: var(--gray-400); }
.explorer-shell .toggle-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    font-size: 13px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: var(--gray-800) !important;
    font-weight: 500 !important;
}
.explorer-shell .toggle-label input {
    accent-color: var(--brand-indigo-500);
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.explorer-shell .toggle-hint {
    font-size: 10px;
    color: var(--gray-500);
    font-style: italic;
    display: block;
    margin-top: 0.15rem;
    letter-spacing: 0.02em;
}

/* Legend */
.explorer-shell .chart-legend {
    display: flex;
    gap: 1.5rem;
    padding: 0 0.25rem;
    margin-bottom: 0.75rem;
    font-size: 12px;
    color: var(--gray-600);
    flex-wrap: wrap;
    align-items: center;
}
.explorer-shell .legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.explorer-shell .legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid white;
    box-shadow: 0 0 0 1px var(--gray-300);
}
.explorer-shell .legend-dot.male    { background: var(--brand-teal-500); box-shadow: 0 0 0 1px var(--brand-teal-700); }
.explorer-shell .legend-dot.female  { background: var(--brand-amber-500); box-shadow: 0 0 0 1px var(--brand-amber-600); }
.explorer-shell .legend-band {
    display: inline-block;
    width: 22px;
    height: 12px;
    background: var(--gray-200);
    border: 1px solid var(--gray-300);
    border-radius: 2px;
}
.explorer-shell .legend-line {
    display: inline-block;
    width: 22px;
    height: 2px;
    background: var(--gray-500);
}

/* Synthetic peer callout */
.explorer-shell .synthetic-callout {
    background: var(--brand-amber-50);
    border: 1px solid var(--brand-amber-500);
    border-radius: 6px;
    padding: 0.55rem 0.85rem;
    margin-bottom: 0.75rem;
    font-size: 11.5px;
    color: var(--gray-800);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.explorer-shell .synthetic-badge {
    background: var(--brand-amber-500);
    color: white;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    flex-shrink: 0;
}

/* Chart canvas — fills the 1fr grid column of .chart-and-side.
   Sidebar (.insight-strip) sits alongside in the fixed 300px column, never overlays. */
.explorer-shell .chart-canvas {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 0.75rem 0.75rem 0.5rem;
    margin-bottom: 0;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}
.explorer-shell .chart-canvas svg {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 100%;
}
/* Axes */
.explorer-shell .axis text {
    font-family: inherit;
    font-size: 11px;
    fill: var(--gray-500);
    font-feature-settings: 'tnum';
}
.explorer-shell .axis path,
.explorer-shell .axis line {
    stroke: var(--gray-200);
    shape-rendering: crispEdges;
}
.explorer-shell .axis-grid line {
    stroke: var(--gray-100);
    stroke-dasharray: 2 3;
}
.explorer-shell .axis-label {
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    fill: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Peer envelope band + median line */
.explorer-shell .peer-band-rect {
    fill: var(--gray-200);
    stroke: var(--gray-300);
    stroke-width: 1;
    rx: 3;
}
.explorer-shell .peer-median-line {
    stroke: var(--gray-500);
    stroke-width: 1.5;
    stroke-linecap: round;
}
.explorer-shell .peer-median-label {
    font-size: 9.5px;
    fill: var(--gray-500);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

/* Employee dots */
.explorer-shell .dot-emp {
    stroke: white;
    stroke-width: 1;
    cursor: pointer;
    transition: r 0.15s, stroke 0.15s;
}
.explorer-shell .dot-emp.male   { fill: var(--brand-teal-500); }
.explorer-shell .dot-emp.female { fill: var(--brand-amber-500); }
.explorer-shell .dot-emp.other  { fill: var(--gray-500); }
.explorer-shell .dot-emp.below-peer-p25 {
    stroke: var(--brand-red-500);
    stroke-width: 2;
}
.explorer-shell .dot-emp:hover {
    stroke: var(--gray-900);
    stroke-width: 1.5;
}

/* Tooltip */
.explorer-shell .chart-tooltip {
    position: absolute;
    background: var(--gray-900);
    color: white;
    padding: 0.5rem 0.7rem;
    border-radius: 6px;
    font-size: 11.5px;
    line-height: 1.4;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.explorer-shell .chart-tooltip.on { opacity: 1; }
.explorer-shell .chart-tooltip strong {
    color: white;
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
}
.explorer-shell .chart-tooltip .tt-sub {
    color: var(--gray-400);
    font-size: 10.5px;
}
.explorer-shell .chart-tooltip .tt-metric {
    color: white;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}
.explorer-shell .chart-tooltip .tt-flag {
    display: inline-block;
    margin-top: 4px;
    padding: 1px 6px;
    background: var(--brand-red-500);
    color: white;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Entry ball hint text (before any pairing selected) */
.explorer-shell .ball-hint {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--gray-500);
    font-size: 12.5px;
    letter-spacing: 0.02em;
    pointer-events: none;
    background: rgba(255,255,255,0.85);
    padding: 4px 10px;
    border-radius: 999px;
    text-align: center;
}

/* Stats bar — compact single-row strip with inline footer actions on the right */
.explorer-shell .stats-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    margin-bottom: 0;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.explorer-shell .stat {
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    line-height: 1.3;
}
.explorer-shell .stat-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 0;
}
.explorer-shell .stat-value {
    font-size: 13px !important;
    font-weight: 600;
    color: var(--gray-900);
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    font-feature-settings: 'tnum';
    flex-wrap: nowrap;
}
.explorer-shell .stat-sub {
    font-size: 10.5px;
    font-weight: 500;
    color: var(--gray-500);
}

/* Footer actions — inline with stats bar (pushed right by margin-left: auto) */
.explorer-shell .footer-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-bottom: 0;
    margin-left: auto;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.explorer-shell .footer-actions .btn { padding: 5px 12px; font-size: 12px; }

@media (max-width: 900px) {
    .explorer-shell .stats-bar { grid-template-columns: repeat(2, 1fr); }
    .explorer-shell .controls { flex-direction: column; align-items: stretch; }
}

/* End Explorer chrome */

/* ══════════════════════════════════════════════════════════════════════════
   INSIGHTS V2 — BUSINESS CHALLENGES (docs/insights-v2-taxonomy.md)
   Element families batch-approved 2026-07-21 (docs/ui-elements.md § Insights v2).
   Layout-level classes are chal- prefixed to avoid collisions with existing
   .section-header / .filter-pill / .btn-icon.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Challenges list header ── */
.chal-list-header { margin-bottom: 1.25rem; }
.chal-list-header h2 {
    margin: 0 0 0.25rem;
    font-size: var(--text-lg);
    color: var(--gray-900);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.chal-count-badge {
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: var(--text-sm);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.chal-subline { font-size: var(--text-body); color: var(--gray-500); }
.chal-subline strong { color: var(--gray-700); }

/* ── Business Challenge card ── */
.chal-stack { display: flex; flex-direction: column; gap: 0.85rem; margin-bottom: 1.5rem; }
.challenge-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--gray-300);
    padding: 1.15rem 1.5rem 1.25rem;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    cursor: pointer;
}
.challenge-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.challenge-card.sev-high { border-left-color: var(--brand-red-500); }
.challenge-card.sev-med { border-left-color: var(--brand-amber-500); }
.challenge-eyebrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.55rem;
}
.challenge-eyebrow-left { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); }
.challenge-title {
    font-size: var(--text-base);
    color: var(--gray-900);
    margin: 0 0 0.4rem;
    font-weight: 600;
    line-height: 1.3;
}
.challenge-body {
    font-size: var(--text-body);
    color: var(--gray-700);
    margin: 0 0 0.85rem;
    line-height: 1.55;
}
.challenge-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1rem;
    font-size: var(--text-sm);
}
.chal-meta-item { display: flex; align-items: center; color: var(--gray-600); }
.chal-meta-item strong { color: var(--gray-900); font-weight: 600; }
.challenge-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.6rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--gray-100);
}

/* ── Severity chip (HIGH / MEDIUM / WATCH) ── */
.severity-chip {
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: var(--text-xs);
}
.severity-chip.sev-high { background: var(--brand-red-100); color: var(--brand-red-700); }
.severity-chip.sev-med { background: var(--brand-amber-100); color: var(--brand-amber-700); }
.severity-chip.sev-monitor { background: color-mix(in srgb, var(--chart-2) 12%, var(--white)); color: var(--chart-2); } /* approved Blue; indigo is UI chrome */
.trend-tag { color: var(--gray-500); font-weight: 500; }

/* ── Evidence chips (data-source provenance on cards) ── */
.evidence-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0.25rem;
    align-items: center;
}
.evidence-chips-label { font-size: var(--text-sm); color: var(--gray-500); font-weight: 500; margin-right: 2px; }
.evidence-chip {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 3px 9px;
    border-radius: 12px;
    font-size: var(--text-sm);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.evidence-chip::before {
    content: '';
    width: 5px; height: 5px;
    background: var(--gray-400);
    border-radius: 50%;
}

/* ── Monitored templates strip ── */
.monitored-templates {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 0.9rem 1.25rem 1rem;
}
.monitored-templates-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--text-sm);
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 0.6rem;
}
.monitored-templates-header::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--brand-green-500);
    border-radius: 50%;
}
.monitored-list { display: flex; flex-wrap: wrap; gap: 5px 8px; }
.monitored-item {
    font-size: var(--text-sm);
    color: var(--gray-500);
    padding: 2px 8px 2px 6px;
    background: transparent;
    border: 1px dashed var(--gray-300);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.monitored-item::before {
    content: '';
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--brand-green-500);
    opacity: 0.7;
}

/* ── All-clear empty state ── */
.chal-all-clear {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    color: var(--gray-500);
    border: 1px dashed var(--gray-300);
}
.chal-all-clear-icon { font-size: var(--text-2xl); margin-bottom: 0.5rem; color: var(--brand-green-500); }
.chal-all-clear-title { font-weight: 600; color: var(--gray-800); margin-bottom: 0.25rem; }
.chal-all-clear-sub { font-size: var(--text-body); }

/* ── Inference indicator ── */
.est-tag {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 1px 5px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Evidence page chrome ── */
.evidence-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0 0.75rem;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-600);
    font-size: var(--text-body);
    cursor: pointer;
    background: transparent;
    border: none;
    font-family: inherit;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius);
}
.back-link:hover { background: var(--gray-100); color: var(--gray-900); }

.evidence-section-nav {
    position: sticky;
    top: 60px;
    z-index: 40;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 0.55rem 1rem;
    display: flex;
    justify-content: center;
    gap: 4px;
    overflow-x: auto;
    margin-bottom: 1.25rem;
}
.section-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: var(--text-sm);
    color: var(--gray-600);
    cursor: pointer;
    background: transparent;
    border: none;
    font-family: inherit;
    font-weight: 500;
    white-space: nowrap;
}
.section-nav-item:hover { background: var(--gray-100); color: var(--gray-900); }
/* Scroll-spy current-section state (ux-patterns §8.7). Set by the
   IntersectionObserver in chalMountEvidenceChrome — never hand-toggled. */
.section-nav-item.is-current { background: var(--brand-indigo-50); color: var(--primary-color); font-weight: 600; }
.section-nav-item.is-current .section-nav-num { background: var(--primary-color); color: var(--white); }
.section-nav-item:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.section-nav-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: var(--text-xs);
    font-weight: 700;
}

.evidence-container { max-width: 1080px; margin: 0 auto; }
.evidence-hero {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--brand-red-500);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
}
.evidence-hero-eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 0.5rem; font-size: var(--text-sm); }
.evidence-hero-verdict {
    font-size: var(--text-body);
    font-weight: 600;
    color: var(--brand-red-700);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.35rem;
}
.evidence-hero h1 { margin: 0 0 0.5rem; font-size: var(--text-xl); color: var(--gray-900); font-weight: 600; }
.evidence-hero-summary { font-size: var(--text-body); color: var(--gray-700); line-height: 1.55; margin: 0 0 1rem; }
.evidence-hero-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-size: var(--text-sm); color: var(--gray-500); }
/* The hero carries its severity (the list card's sev-high / sev-med). */
.evidence-hero.sev-med { border-left-color: var(--brand-amber-500); }
.evidence-hero.sev-med .evidence-hero-verdict { color: var(--brand-amber-700); }
.evidence-hero-meta strong { color: var(--gray-800); font-weight: 600; }

.evidence-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.75rem 1.5rem;
    margin-bottom: 1.15rem;
    scroll-margin-top: 120px;
}
.evidence-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}
.evidence-section-number {
    width: 26px; height: 26px;
    background: var(--brand-indigo-50);
    color: var(--primary-color);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 700;
    flex-shrink: 0;
}
.evidence-section-header h2 { margin: 0; font-size: var(--text-base); color: var(--gray-900); font-weight: 600; flex: 1; }
.section-source {
    font-size: var(--text-sm);
    color: var(--gray-500);
    background: var(--gray-50);
    padding: 3px 8px;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
}

/* ── P1: summary metric tiles ── */
.evidence-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; }
.summary-tile { background: var(--gray-50); border-radius: var(--radius); padding: 0.9rem 1.1rem; }
.summary-tile-value { font-size: var(--text-xl); font-weight: 700; color: var(--gray-900); line-height: 1.1; margin-bottom: 3px; }
.summary-tile-value.warn { color: var(--brand-red-500); }
.summary-tile-value.growth { color: var(--brand-amber-700); }
.summary-tile-label { font-size: var(--text-sm); color: var(--gray-600); }
.summary-tile-sub { font-size: var(--text-sm); color: var(--gray-500); margin-top: 4px; }

/* ── P2: cohort table (variant of approved Tables family) ── */
.evidence-cohort-table { width: 100%; border-collapse: collapse; font-size: var(--text-body); }
.evidence-cohort-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--gray-200);
}
.evidence-cohort-table td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); color: var(--gray-800); }
/* NO row :hover here by design. ux-patterns §8.7: cohort rows should eventually
   deep-link to the employee profile, but until that click is wired a hover
   highlight is a dead affordance — it promises interactivity that doesn't
   exist. Add `tbody tr:hover { background: var(--gray-50); cursor: pointer; }`
   in the SAME change that wires the click, not before. */
.evidence-cohort-table .cell-name { font-weight: 600; color: var(--gray-900); }
.risk-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: var(--text-sm);
    font-weight: 600;
}
.risk-pill.high { background: var(--brand-red-100); color: var(--brand-red-700); }
.risk-pill.mod { background: var(--brand-amber-100); color: var(--brand-amber-700); }
.compa-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: var(--text-sm);
    font-weight: 600;
    background: var(--brand-red-100);
    color: var(--brand-red-700);
}

/* ── P3: overlap analysis ── */
.evidence-signal-grid { display: grid; grid-template-columns: 340px 1fr; gap: 1.5rem; align-items: center; }
.venn-container { text-align: center; }
/* Names the diagram's scope — the circles are one department, the narrative
   beside them is hotel-wide. Without this the two read as one population. */
.venn-scope {
    margin: 0.15rem 0 0;
    font-size: var(--text-xs);
    color: var(--gray-500);
    line-height: 1.4;
}
.signal-narrative { font-size: var(--text-body); color: var(--gray-700); line-height: 1.6; }
.signal-narrative strong { color: var(--gray-900); }

/* ── P4: factor cards (+ ruled-out variant) ── */
.evidence-factor-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
.factor-card {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    border-left: 3px solid var(--gray-300);
}
.factor-card.active { border-left-color: var(--brand-red-500); background: var(--white); box-shadow: var(--shadow-sm); }
.factor-card.ruled-out { border-left-color: var(--brand-green-500); background: var(--white); box-shadow: var(--shadow-sm); }
/* Approved 2026-10-13: "cannot check" and context (a fact about scope) are
   gray — neither a driver nor cleared. Green means checked and not active. */
.factor-card.cannot-check { border-left-color: var(--gray-300); background: var(--white); box-shadow: var(--shadow-sm); }
.factor-card.cannot-check .ruled-out-badge { color: var(--gray-700); background: var(--gray-100); }
.factor-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.4rem; }
.factor-name { font-size: var(--text-body); font-weight: 600; color: var(--gray-800); }
.factor-affected { font-size: var(--text-sm); color: var(--gray-500); }
.factor-card.active .factor-affected { color: var(--brand-red-700); font-weight: 600; }
.factor-detail { font-size: var(--text-sm); color: var(--gray-600); line-height: 1.5; }
.ruled-out-badge {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--brand-green-700);
    background: var(--brand-green-100);
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── P5: manager attribution panel ── */
.manager-panel {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    background: var(--brand-amber-100);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--brand-amber-500);
}
.manager-panel-avatar {
    width: 44px; height: 44px;
    background: var(--white);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--brand-amber-700);
    flex-shrink: 0;
    border: 1px solid var(--brand-amber-500);
}
.manager-panel-body { flex: 1; color: var(--gray-800); font-size: var(--text-body); line-height: 1.55; }
.manager-panel-body strong { color: var(--gray-900); }

/* ── P6: trend chart ── */
.trend-chart-container { padding: 0 1rem; }
.trend-annotation { font-size: var(--text-body); color: var(--gray-600); margin-top: 0.75rem; text-align: center; }
.trend-annotation strong { color: var(--gray-900); } /* captions state facts, rises and falls alike */

/* ── P7: recommended actions ── */
.evidence-actions-list { display: flex; flex-direction: column; gap: 0.7rem; }
.evidence-action-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 0.9rem 1.15rem;
    border-radius: var(--radius);
    background: var(--gray-50);
    border-left: 3px solid var(--primary-color);
}
.evidence-action-num {
    width: 22px; height: 22px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: 700;
    flex-shrink: 0;
}
.evidence-action-body { flex: 1; }
.evidence-action-title { font-size: var(--text-body); font-weight: 600; color: var(--gray-900); margin: 0 0 0.2rem; }
.evidence-action-text { font-size: var(--text-body); color: var(--gray-600); line-height: 1.5; margin: 0; }

/* ── Responsive (look-and-feel §2.9) ── */
@media (max-width: 640px) {
    .evidence-summary-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .summary-tile-value { font-size: var(--text-lg); }
    .evidence-signal-grid { grid-template-columns: 1fr; }
    .venn-container svg { max-width: 280px; }
    .evidence-factor-grid { grid-template-columns: 1fr; }
    .evidence-cohort-table { display: block; overflow-x: auto; white-space: nowrap; font-size: var(--text-sm); }
    .challenge-card { padding: 1rem 1.15rem 1.15rem; }
    .challenge-title { font-size: var(--text-base); }
    .evidence-hero h1 { font-size: var(--text-lg); }
    .section-nav-item span:last-child { display: none; }
    .evidence-section-header { flex-wrap: wrap; }
}

/* ══════════════════════════════════════════════════════════════════════════
   CH-03 · Manager quality outliers — evidence-page-specific patterns
   Section 5 hero manager panel with cross-links, Section 6 divergence chart
   legend, exited/active status pill (Section 3 is the bullet graph since 2026-10-26).
   All new tokens alias existing brand-* / gray-* families (look-and-feel §2).
   ══════════════════════════════════════════════════════════════════════════ */

.signal-narrative--spaced { margin-top: 1rem; }
/* The evidence page while it loads, and notices over the list. */
.chal-evd-loading { display: flex; flex-direction: column; gap: 0.75rem; }
.chal-evd-back { align-self: flex-start; }
.chal-notice { margin-bottom: 1rem; }
.chal-history-hint { font-size: var(--text-sm); color: var(--gray-600); }

/* CH-03 Section 6: the team's average rating per month, a small line chart (ui-elements § Insights v2) */
.chal-perf-strip { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--gray-100); }
.chal-perf-strip-title { font-size: var(--text-sm); color: var(--gray-600); margin-bottom: 0.5rem; }
.chal-perf-strip-foot { font-size: var(--text-sm); color: var(--gray-600); margin-top: 0.5rem; }

/* ── Section 5 · Hero manager panel (larger P5 for CH-03) ── */
.manager-panel--hero {
    align-items: flex-start;
    padding: 1.5rem 1.75rem;
    gap: 1.5rem;
}
.manager-panel-avatar--large {
    width: 64px;
    height: 64px;
    font-size: var(--text-base);
    border-width: 2px;
}
.manager-panel-name {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2px;
}
.manager-panel-role {
    font-size: var(--text-body);
    color: var(--gray-600);
    margin-bottom: 0.7rem;
}
.manager-panel-summary {
    font-size: var(--text-body);
    color: var(--gray-800);
    line-height: 1.55;
    margin: 0 0 0.75rem;
}
.manager-panel-summary strong { color: var(--gray-900); }
.manager-panel-crosslinks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--gray-200);
}
.crosslink-label {
    font-size: var(--text-sm);
    color: var(--gray-600);
    font-weight: 500;
    margin-right: 4px;
}

/* ── Section 6 · Divergence chart legend ── */
.divergence-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
}
.divergence-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.divergence-legend-item .line-swatch {
    display: inline-block;
    width: 22px;
    height: 3px;
    border-radius: 2px;
    vertical-align: middle;
}
.divergence-legend-item .line-swatch.team { background: var(--chart-1); }
/* CH-02 Section 5 strip: this hotel's dot, the other hotels' dots, the median bar */
.divergence-legend-item .dot-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.divergence-legend-item .dot-swatch.team { background: var(--chart-1); }
.divergence-legend-item .dot-swatch.other { background: var(--chart-10); opacity: 0.45; }
.divergence-legend-item .bar-swatch { display: inline-block; width: 16px; height: 2px; background: var(--gray-600); }
.divergence-legend-item .line-swatch.hotel {
    background: var(--chart-10);
    /* dashed pattern for visual parity with the SVG */
    background-image: linear-gradient(to right, var(--chart-10) 60%, transparent 40%);
    background-size: 6px 3px;
    background-repeat: repeat-x;
    background-color: transparent;
    height: 3px;
}

/* ── Section 2 · Status pill (Active / Exited) for the cohort table ── */
.status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: var(--text-sm);
    font-weight: 600;
}
.status-pill.active { background: var(--brand-green-100); color: var(--brand-green-700); }
.status-pill.exited { background: var(--gray-100); color: var(--gray-600); }

/* ── Responsive (look-and-feel §2.9) ── */
@media (max-width: 640px) {

    .manager-panel--hero { flex-direction: column; padding: 1.15rem; }
    .manager-panel-avatar--large { width: 52px; height: 52px; font-size: var(--text-base); }
}

/* ══════════════════════════════════════════════════════════════════════════
   CH-04 · Below-market pay in critical roles — evidence-page-specific
   Reuses CH-03's divergence-legend family (Section 3 is the bullet graph since
   2026-10-26, plan Phase 2.9); adds:
   .divergence-legend-item .line-swatch.amber (Section 5 dual-axis turnover line)
   .crosslink-inline (Section 3 peer-challenge chips outside the P5 hero)
   ══════════════════════════════════════════════════════════════════════════ */

.divergence-legend-item .line-swatch.amber {
    background: var(--chart-4);
    background-image: linear-gradient(to right, var(--chart-4) 60%, transparent 40%);
    background-size: 6px 3px;
    background-repeat: repeat-x;
    background-color: transparent;
    height: 3px;
}

.crosslink-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--gray-300);
}

/* ══════════════════════════════════════════════════════════════════════════
   CH-02 · Property outlier — evidence-page-specific
   New P9 pattern (cluster comparison grid) + P4 variant cross-challenge cards
   (the P3 per-metric chart is the bullet graph since 2026-10-26).
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Section 2 · P9 cluster comparison grid ── */
.cluster-grid-p9 { overflow-x: auto; margin-bottom: 0.75rem; }
.cluster-grid-p9-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
    font-size: var(--text-body);
}
.cluster-grid-p9-hotel-header,
.cluster-grid-p9-metric-header {
    background: var(--gray-50);
    color: var(--gray-600);
    padding: 8px 12px;
    text-align: left;
    font-size: var(--text-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--radius);
}
.cluster-grid-p9-metric-header { text-align: center; }
.cluster-grid-p9-hotel-cell {
    background: var(--gray-50);
    padding: 10px 12px;
    font-weight: 600;
    color: var(--gray-900);
    border-radius: var(--radius);
    white-space: nowrap;
}
.cluster-grid-p9-outlier-row.sev-high .cluster-grid-p9-hotel-cell {
    background: var(--brand-red-100);
    color: var(--brand-red-700);
    border-left: 4px solid var(--brand-red-500);
}
.cluster-grid-p9-outlier-row.sev-med .cluster-grid-p9-hotel-cell {
    background: var(--brand-amber-100);
    color: var(--brand-amber-700);
    border-left: 4px solid var(--brand-amber-500);
}
.grid-cell {
    background: var(--white);
    padding: 8px 10px;
    text-align: center;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    position: relative;
    min-width: 100px;
}
.grid-cell.no-data { color: var(--gray-400); }
.grid-cell .cluster-card-chevron { position: absolute; top: 4px; right: 4px; }
.cluster-grid-p9-value { font-weight: 700; color: var(--gray-900); font-size: var(--text-body); }
.cluster-grid-p9-delta { font-size: var(--text-sm); color: var(--gray-600); margin-top: 2px; }

/* ── Section 3 · CH-02 per-metric gap bars ── */
.ch02-gap-metric {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--gray-100);
}
.ch02-gap-metric:last-child { border-bottom: none; margin-bottom: 0; }

.ch02-gap-narrative {
    font-size: var(--text-body);
    color: var(--gray-700);
    line-height: 1.5;
    margin: 0.85rem 0 0;
}

/* ── Section 4 · CH-02 cross-challenge cards ── */
.cross-challenge-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
}
.cross-challenge-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.85rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border-left: 3px solid var(--gray-300);
}
.cross-challenge-card.is-clickable { cursor: pointer; transition: box-shadow 0.15s ease, transform 0.15s ease; }
.cross-challenge-card.is-clickable:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.cross-challenge-card.is-clickable:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.cross-challenge-card:has(.severity-chip.sev-high) { border-left-color: var(--brand-red-500); }
.cross-challenge-card:has(.severity-chip.sev-med) { border-left-color: var(--brand-amber-500); }
.cross-challenge-body { flex: 1; }
.cross-challenge-title { font-size: var(--text-body); font-weight: 600; color: var(--gray-900); margin-bottom: 2px; }
.cross-challenge-summary { font-size: var(--text-sm); color: var(--gray-600); }
.cross-challenge-cta { color: var(--gray-400); font-size: var(--text-base); }
.cross-challenge-note {
    font-size: var(--text-body);
    color: var(--gray-600);
    margin: 0.5rem 0 0;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .grid-cell { min-width: 80px; padding: 6px 8px; }
    .cluster-grid-p9-value { font-size: var(--text-body); }
    .cluster-grid-p9-delta { font-size: var(--text-xs); }

}

/* ── P8 · Evidence page footer (approved 2026-07-21 · built 2026-07-27) ────── */
.evidence-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.15rem 1.75rem;
    margin-top: 1.15rem;
}
.evidence-footer-label {
    font-size: var(--text-body);
    font-weight: 600;
    color: var(--gray-800);
}
.evidence-footer-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
/* Disabled = capability not built yet. Reads as "not yet", not as "broken". */
.evidence-footer-actions .btn[disabled] { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 640px) {
    .evidence-footer { flex-direction: column; align-items: flex-start; padding: 1rem 1.15rem; }
    .evidence-footer-actions { width: 100%; }
    .evidence-footer-actions .btn { flex: 1; justify-content: center; }
}

/* ==========================================================================
   HOTEL HR METRICS v2 — lens bodies
   Scoped under .rewards-v2-drill-mode, which the section reuses along with the
   rest of the shared drill chrome. The wrappers the section previously emitted
   (.hotel-metrics-cards-mode, .hotel-metrics-header) still carry no rules of
   their own — they are structural only, which is why nothing here targets them.
   ========================================================================== */

.hr-v2-trend-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}
.hr-v2-trend-title { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.hr-v2-trend-range { font-size: 11.5px; color: var(--gray-500); font-variant-numeric: tabular-nums; }
/* Fills the evidence pane and scales with it — no fixed width, so it survives the
   drawer push the way the sunburst now does. */
.hr-v2-trend-svg { width: 100%; height: auto; display: block; }
.hr-v2-trend-foot {
    margin: 0.6rem 0 0;
    font-size: 12.5px;
    color: var(--gray-600);
    line-height: 1.55;
}
.hr-v2-trend-foot strong { color: var(--gray-900); font-weight: 600; }

/* ==========================================================================
   Hotel HR metrics — division tables (ui-elements.md, 2026-08-13)
   The .hr-v2-div* bar list that stood here was deleted with the lens that drew
   it: it rendered the same headcount bars on all three cards, ignoring the
   `key` naming which card it was for. Two cells replace it, on the shared
   table. Colouring by a KEYWORD MATCH ON THE DIVISION NAME went with it —
   `getDivisionBarClass` classed kitchen as front-of-house, and a category
   painted onto a bar was never the finding anyway.
   ========================================================================== */

/* A division's share of the property ratio. One segment, one whole. */
.hr-share-cell { white-space: nowrap; }
.hr-share {
    display: inline-block;
    width: 74px;
    height: 7px;
    border-radius: 99px;
    background: var(--gray-100);
    overflow: hidden;
    vertical-align: middle;
}
.hr-share > i { display: block; height: 100%; border-radius: 99px; }
.hr-share > i.hr-share-seg { background: var(--chart-1); }
.hr-share-none { color: var(--gray-400); }
.hr-share-val {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin-left: 0.45rem;
    font-variant-numeric: tabular-nums;
}

/* Payroll share against headcount share — a DIVERGING bar from a centre line,
   because the sign carries the finding. Left-anchored, "well below its size"
   and "well above its size" would render as the same bar in the same
   direction. No RAG: a senior division costing more than its size is normal
   and there is no per-division target that would make it a failure. */
.hr-gap-cell { white-space: nowrap; }
.hr-gap { display: inline-block; width: 120px; vertical-align: middle; }
.hr-gap-val { display: inline-block; min-width: 3.6em; text-align: left; }
.peq-below-dim { padding: 0.75rem 0; border-bottom: 1px solid var(--gray-100); }
.peq-below-dim:last-child { border-bottom: none; }
.peq-below-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.25rem; }
.peq-below-dim .peq-sentence { margin: 0.5rem 0 0; }
.hr-gap-val { font-size: var(--text-sm); margin-left: 0.45rem; font-variant-numeric: tabular-nums; }
.hr-gap-val.over { color: var(--brand-amber-700); }
.hr-gap-val.under { color: var(--gray-600); }

@media (max-width: 720px) {
    .hr-col-drop { display: none; }
}

/* ==========================================================================
   BENCHMARK CHALLENGES — Phase A (plan §3c, D8/D9)
   Rendered by client/benchmark-challenge-renderers.js. The evidence pages
   reuse the shared split chrome (.l2-content[data-layout="split"]), so only
   the challenge-specific pieces live here.
   ========================================================================== */
.bmc-list-head { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 1rem; }
.bmc-list-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.005em; }
.bmc-list-sub { font-size: 13px; color: var(--gray-500); }
.bmc-list { display: grid; gap: 0.75rem; }

.bmc-card {
    display: grid; grid-template-columns: auto 1fr auto; gap: 0.9rem; align-items: start;
    width: 100%; padding: 1rem 1.1rem; text-align: left; font-family: inherit; cursor: pointer;
    background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.bmc-card:hover {
    border-color: var(--brand-indigo-200);
    box-shadow: 0 2px 10px rgba(79, 70, 229, 0.09);
    transform: translateY(-1px);
}
.bmc-card-body { display: block; min-width: 0; }
.bmc-sev { width: 4px; align-self: stretch; border-radius: 2px; }
.bmc-sev--high { background: var(--brand-red-500); }
.bmc-sev--medium { background: var(--brand-amber-500); }
.bmc-sev--low { background: var(--gray-300); }
.bmc-id { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--gray-400); }
.bmc-title { display: block; font-size: 14px; font-weight: 700; margin: 0.1rem 0 0.25rem; color: var(--gray-900); }
.bmc-summary { display: block; font-size: 12.5px; color: var(--gray-600); line-height: 1.55; }
.bmc-meta { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.5rem; }
.bmc-chev { align-self: center; font-size: 18px; color: var(--gray-300); }

.bmc-badge { font-size: 10.5px; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px; }
.bmc-badge--high { background: var(--brand-red-100); color: var(--brand-red-800); }
.bmc-badge--medium { background: var(--brand-amber-100); color: var(--brand-amber-800); }
.bmc-badge--low { background: var(--gray-100); color: var(--gray-600); }

/* Point-in-time marker — the honest replacement for a trend chip. Deliberately
   quiet: it is a qualifier, not a status. */
.bmc-asof { font-size: 10.5px; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: 999px;
    background: var(--gray-100); color: var(--gray-600); }
.bmc-subtabs { display: inline-flex; gap: 0.3rem; }
.bmc-subtab { font-size: 10.5px; padding: 0.15rem 0.45rem; border-radius: 999px;
    background: var(--brand-indigo-50); color: var(--brand-indigo-700); }

.bmc-empty { text-align: center; padding: 2.5rem 1.5rem; background: var(--white);
    border: 1px solid var(--gray-200); border-radius: var(--radius-lg); }
.bmc-empty-ico { font-size: 24px; color: var(--brand-green-500); }
.bmc-empty h3 { margin: 0.5rem 0 0.35rem; font-size: 16px; font-weight: 700; }
.bmc-empty p { margin: 0 auto; max-width: 460px; font-size: 13px; color: var(--gray-600); }

.bmc-notice { margin-top: 1rem; padding: 0.85rem 1rem; border-radius: var(--radius);
    background: var(--gray-50); border-left: 3px solid var(--gray-300); }
.bmc-notice--warn { background: var(--brand-amber-50); border-left-color: var(--brand-amber-500); }
.bmc-notice-title { font-size: 12.5px; font-weight: 700; color: var(--gray-900); margin-bottom: 0.25rem; }
.bmc-notice p, .bmc-notice li { font-size: 12.5px; color: var(--gray-700); line-height: 1.55; }
.bmc-notice ul { margin: 0.25rem 0 0.4rem; padding-left: 1.1rem; }

/* ── Evidence page ── */
.bmc-ev-head { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.5rem; }
.bmc-ev-summary { margin: 0 0 1.1rem; font-size: 13.5px; color: var(--gray-700); line-height: 1.6; max-width: 70ch; }

.bmc-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center;
    padding: 1.25rem; margin-bottom: 1.25rem;
    background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); }
.bmc-stat { text-align: center; min-width: 0; }
.bmc-stat-lbl { font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--gray-500); }
.bmc-stat-val { font-size: 30px; font-weight: 700; line-height: 1.15; margin: 0.2rem 0; }
.bmc-stat-val--good { color: var(--brand-green-600); }
.bmc-stat-val--bad { color: var(--brand-red-600); }
.bmc-stat-val--neutral { color: var(--gray-900); }
.bmc-stat-sub { font-size: 12.5px; color: var(--gray-600); margin-bottom: 0.35rem; }
.bmc-pos { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 0.15rem 0.5rem; border-radius: 999px; }
.bmc-pos--good { background: var(--brand-green-100); color: var(--brand-green-800); }
.bmc-pos--bad { background: var(--brand-red-100); color: var(--brand-red-800); }
.bmc-pos--neutral { background: var(--gray-100); color: var(--gray-600); }
.bmc-pair-vs { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gray-400); }

.bmc-side-block { margin-bottom: 0.9rem; }
.bmc-side-title { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--gray-500); margin-bottom: 0.4rem; }
.bmc-gate-row { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.28rem 0;
    font-size: 12px; border-bottom: 1px dashed var(--gray-100); }
.bmc-gate-row:last-child { border-bottom: none; }
.bmc-gate-row > span:first-child { color: var(--gray-500); }
.bmc-gate-test { color: var(--gray-400); font-size: 11px; }
.bmc-side-note { margin: 0; font-size: 11px; color: var(--gray-500); line-height: 1.45; }

.bmc-lead { margin: 0 0 0.9rem; font-size: 13.5px; color: var(--gray-700); line-height: 1.6; }
.bmc-thin { margin-top: 0.7rem; font-size: 11.5px; color: var(--gray-500); line-height: 1.55; }
.bmc-thin--flag { color: var(--brand-indigo-700); }

.bmc-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bmc-tbl th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--gray-500); font-weight: 600; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--gray-200); }
.bmc-tbl td { padding: 0.5rem; border-bottom: 1px solid var(--gray-100); font-variant-numeric: tabular-nums; }
.bmc-tbl td:first-child { font-weight: 600; }
.bmc-tbl tr:last-child td { border-bottom: none; }
.bmc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.4rem; }
.bmc-dot--good { background: var(--brand-green-500); }
.bmc-dot--mid { background: var(--brand-amber-500); }
.bmc-dot--neutral { background: var(--gray-300); }
.bmc-dot--bad { background: var(--brand-red-500); }
.bmc-good { color: var(--brand-green-600); font-weight: 600; }
.bmc-bad { color: var(--brand-red-600); font-weight: 600; }
.bmc-tag { font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    padding: 0.05rem 0.35rem; border-radius: 999px; background: var(--brand-indigo-50); color: var(--brand-indigo-700); }

@media (max-width: 720px) {
    .bmc-pair { grid-template-columns: 1fr; }
    .bmc-pair-vs { text-align: center; }
}

/* ==========================================================================
   BENCHMARK DRILL-IN — overview grid + Turnover drill-in
   Rendered by client/benchmark-drill-renderers.js. Evidence chrome reuses the
   shared split (.l2-content[data-layout="split"]); only the Benchmark-specific
   pieces live here.
   ========================================================================== */
.bd-overview-head { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.bd-overview-actions { margin-left: auto; align-self: center; }
.bd-overview-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.005em; }
.bd-overview-sub { font-size: 13px; color: var(--gray-500); }
.bd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }

.bd-tile {
    display: block; width: 100%; text-align: left; font-family: inherit; cursor: pointer;
    padding: 1rem 1.1rem; background: var(--white);
    border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.bd-tile:hover { border-color: var(--brand-indigo-200); box-shadow: 0 2px 10px rgba(79,70,229,0.09); transform: translateY(-1px); }
.bd-tile--suppressed { cursor: default; }
.bd-tile--suppressed:hover { border-color: var(--gray-200); box-shadow: none; transform: none; }
.bd-tile-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.bd-tile-name { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.bd-tile-val { display: block; font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.bd-tile-foot { display: block; margin-top: 0.3rem; font-size: 11.5px; color: var(--gray-500); }
.bd-tile-shield { font-size: 12px; color: var(--gray-500); padding: 0.4rem 0 0.1rem; }

.bd-pill { font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; padding: 0.16rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.bd-pill--good { background: var(--brand-green-100); color: var(--brand-green-800); }
.bd-pill--neutral { background: var(--gray-100); color: var(--gray-700); }
.bd-pill--warn { background: var(--brand-amber-100); color: var(--brand-amber-800); }
.bd-pill--bad { background: var(--brand-red-100); color: var(--brand-red-800); }
.bd-pill--mute { background: var(--gray-100); color: var(--gray-600); }

/* A verdict's colours, on the title row */
.bd-verdict-text { font-size: 15px; font-weight: 700; line-height: 1.2; }
.bd-verdict-text--good { color: var(--brand-green-600); }
.bd-verdict-text--neutral { color: var(--gray-700); }
.bd-verdict-text--warn { color: var(--brand-amber-600); }
.bd-verdict-text--bad { color: var(--brand-red-600); }

.bd-scale-wrap { margin: 0 0 1.15rem; }
/* Direction label — copy and treatment match .threshold-legend-direction, which
   every other scale already has. The arrow points at the GOOD end and the label
   aligns to that side, so direction is not carried by hue alone (WCAG 1.4.1). */
.bd-direction { margin-top: 0.35rem; font-size: 11.5px; font-style: italic; color: var(--gray-500); }
.bd-direction--lower { text-align: left; }
.bd-direction--higher { text-align: right; }
.bd-direction b { font-style: normal; font-weight: 600; color: var(--gray-700); }

/* Provenance pane */
.bd-prov { margin-bottom: 0.9rem; }
.bd-prov-title { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--gray-500); margin-bottom: 0.4rem; }
.bd-prov-row { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.28rem 0; font-size: 12px; border-bottom: 1px dashed var(--gray-100); }
.bd-prov-row:last-child { border-bottom: none; }
.bd-prov-row > span:first-child { color: var(--gray-500); }
.bd-prov-row > span:last-child { color: var(--gray-900); font-weight: 600; text-align: right; }
.bd-prov-note { margin-top: 0.4rem; font-size: 11px; color: var(--gray-500); line-height: 1.45; }

/* Lens bodies */
.bd-lens-title { font-size: 13.5px; font-weight: 600; margin: 0 0 0.75rem; }
/* Tells the reader what the bars currently ARE, and that there is a level below.
   The headcount chart aggregates to divisions until one is chosen, which is not
   discoverable from the pills alone. */
.bd-lens-hint { display: block; margin-top: 0.15rem; font-size: 11.5px; font-weight: 400;
    color: var(--gray-500); }
.bd-cmp { display: flex; justify-content: space-between; padding: 0.55rem 0; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
.bd-cmp:last-child { border-bottom: none; }
.bd-cmp > span:first-child { color: var(--gray-600); }
.bd-cmp > span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.bd-good { color: var(--brand-green-600); }
.bd-bad { color: var(--brand-red-600); }
.bd-tiles-sm { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
.bd-tile-sm { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 0.6rem 0.7rem; }
.bd-tile-sm b { display: block; font-size: 19px; font-weight: 700; line-height: 1.2; }
.bd-tile-sm i { font-style: normal; font-size: 11px; color: var(--gray-500); }
.bd-thin { margin-top: 0.7rem; font-size: 11.5px; color: var(--gray-500); line-height: 1.55; }

/* ==========================================================================
   Gender benchmark — Option B (scale in lens body) + gender chart
   Decided 2026-08-14 after review of `_gender-benchmark-prototype.html`. The
   card-level parity scale moved into the Overall lens body — above the split
   it hovered over three lenses and scored only one. On by-department and
   by-grade a gender chart replaces the numeric table; the table stays
   available in a <details> disclosure for the "I need the receipt" case.
   ========================================================================== */

/* The Overall lens leads with the scale. bd-scale-inline gives the shared
   `renderGenderBalanceScale` a container that matches the header-scale spacing
   so the two feel identical, just relocated. */
.bd-scale-inline { margin: 0.15rem 0 0.75rem; }
.bd-scale-inline .bd-direction { margin-top: 0.4rem; }
.bd-lens-title--sub { margin-top: 1.2rem; }

/* <details> disclosure — same primitive the app already uses. The summary
   sits right of the chart so the picture stays the first thing read. */
.bd-table-details { margin-top: 1rem; }
.bd-table-details > summary {
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--brand-indigo-700);
    padding: 0.4rem 0;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.bd-table-details > summary::-webkit-details-marker { display: none; }
.bd-table-details > summary::before {
    content: '›';
    display: inline-block;
    font-size: 14px;
    color: var(--gray-400);
    transition: transform 0.15s;
}
.bd-table-details[open] > summary::before { transform: rotate(90deg); }
.bd-table-details > summary:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: 3px;
}
.bd-table-details[open] > .bd-tbl-scroll { margin-top: 0.4rem; }

/* ==========================================================================
   REGRETTABLE TURNOVER — A + B (2026-08-14)
   Enriches the Regrettable lens with a composition strip and a per-grade
   concentration chart. C (12-month trend) is a separate PR — needs history
   the current payload does not carry.
   ========================================================================== */

/* A · Composition strip. Absolute leaver split, dark = regrettable, muted
   = other exits. Sized to counts, not to a fixed width, so the strip is
   literally "of THIS many leavers, THIS many were regrettable". */
.reg-strip {
    display: flex;
    height: 20px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--gray-100);
    margin: 0.5rem 0;
}
.reg-strip-reg { background: var(--brand-red-500); opacity: 0.85; }
.reg-strip-non { background: var(--gray-300); }
.reg-strip-legend {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin: 0 0 0.9rem;
    flex-wrap: wrap;
}
.reg-strip-legend strong { color: var(--gray-900); font-weight: 600; }
.reg-strip-total { margin-left: auto; color: var(--gray-500); }
.reg-swatch {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 2px;
    margin-right: 0.35rem;
    vertical-align: middle;
}
.reg-swatch--reg { background: var(--brand-red-500); opacity: 0.85; }
.reg-swatch--non { background: var(--gray-300); }

/* B · Regrettable exits by grade. Same row shape as the horizontal
   turnover chart (bar length is the metric; the metric here is
   regrettable COUNT rather than rate) but sorted by CONCENTRATION —
   regrettable ÷ leavers for that grade. Colour is severity by
   concentration, not by side. */
.reg-grade-chart {
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--gray-50);
    margin: 0.3rem 0 0.5rem;
}
.reg-grade-legend {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin: 0 0 0.5rem;
}
.reg-grade-row {
    display: grid;
    grid-template-columns: 130px 1fr 130px;
    align-items: center;
    gap: 0.55rem;
    padding: 5px 4px;
    font-size: var(--text-sm);
    border-top: 1px solid var(--gray-100);
    border-radius: 4px;
    transition: background 0.12s;
}
.reg-grade-row:first-of-type { border-top: 0; }
.reg-grade-row:hover { background: white; }
.reg-grade-name {
    color: var(--gray-800);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.reg-grade-track {
    position: relative;
    height: 14px;
    background: var(--gray-100);
    border-radius: 3px;
}
.reg-grade-bar {
    position: absolute;
    top: 2px; bottom: 2px; left: 0;
    border-radius: 2px;
}
.reg-grade-bar--good { background: var(--brand-green-500); opacity: 0.65; }
.reg-grade-bar--mid  { background: var(--brand-amber-500); opacity: 0.80; }
.reg-grade-bar--bad  { background: var(--brand-red-500);   opacity: 0.82; }
.reg-grade-val {
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.reg-grade-val strong {
    display: block;
    font-size: var(--text-sm);
    color: var(--gray-900);
    font-weight: 600;
}
.reg-grade-sub {
    display: block;
    font-size: var(--text-xs);
    color: var(--gray-500);
}

/* Wide comparison tables scroll inside their own pane. Before this, .bd-tbl sat
   bare in the lens body and its 6-7 columns (measured 669px on the pay-by-grade
   table) pushed the WHOLE PAGE sideways below roughly 800px.

   The `nowrap` rule below is what produces the overflow, not the container. A
   table's used width is max(its specified width, its minimum content width), so
   once the numeric columns cannot wrap the table exceeds `width: 100%` on its
   own and the container catches it.

   Deliberately NO min-width. The first version set 34rem, on the assumption
   that width:100% would otherwise squash the columns. Measured at 375px: the
   wide table overflows to 669px either way, while a 3-column table that fits
   the viewport exactly was forced out to 544px and made to scroll for no
   reason. A floor tuned to the widest table is wrong for the narrowest. */
.bd-tbl-scroll { overflow-x: auto; scrollbar-width: thin; }
.bd-tbl-scroll:focus-visible { outline: 2px solid var(--brand-indigo-500); outline-offset: 2px; border-radius: var(--radius-sm); }
.bd-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
/* Numbers must never wrap — a broken figure reads as two figures. Only the
   first column, which carries department / grade names, is allowed to wrap. */
.bd-tbl th:not(:first-child), .bd-tbl td:not(:first-child) { white-space: nowrap; }
.bd-tbl th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); font-weight: 600; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--gray-200); }
.bd-tbl td { padding: 0.5rem; border-bottom: 1px solid var(--gray-100); font-variant-numeric: tabular-nums; }
.bd-tbl td:first-child { font-weight: 600; }
.bd-tbl tr:last-child td { border-bottom: none; }
.bd-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.4rem; }
.bd-dot--good { background: var(--brand-green-500); }
.bd-dot--mid { background: var(--brand-amber-500); }
.bd-dot--bad { background: var(--brand-red-500); }
.bd-dot--neutral { background: var(--gray-300); }   /* around the median, or not read: too few people */

/* Suppressed page state */
.bd-shield { max-width: 620px; margin: 0 auto; text-align: center; padding: 2.25rem 2rem; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); }
.bd-shield-ico { font-size: 26px; }
.bd-shield h3 { margin: 0.5rem 0 0.4rem; font-size: 16px; font-weight: 700; }
.bd-shield p { margin: 0 auto 0.5rem; max-width: 440px; font-size: 13px; color: var(--gray-600); }
.bd-shield-count { display: inline-flex; gap: 0.4rem; align-items: baseline; margin: 0.75rem 0 1rem; padding: 0.5rem 0.9rem; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: 13px; }
.bd-shield-count b { font-size: 19px; }
.bd-shield-acts { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }

@media (max-width: 720px) { .bd-tiles-sm { grid-template-columns: 1fr; } }

/* Peer-range row: plain language leads, the percentile term is a muted
   cross-reference to the scale's own P25 / Median / P75 ticks. */
.bd-cmp-note { font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em; color: var(--gray-400); margin-left: 0.35rem; }
.bd-explainer { margin-top: 0.9rem; padding-top: 0.75rem; border-top: 1px solid var(--gray-100); }
.bd-direction--centre { text-align: center; }

/* ══ Bullet graph (approved 2026-10-25, docs/ui-elements.md § Bullet graph) ══
   Built by client/bullet-graph-views.js. Zones, lines and the dot sit in a 12px
   track; rows share one scale; every zone its own tint; the dot carries the
   reading. Not the legacy .bullet-* classes of the hidden Workforce tab. */
.bgraph-caption { font-size: var(--text-sm); color: var(--gray-600); margin: 0 0 0.35rem; }
.bgraph-rows { display: flex; flex-direction: column; }
.bgraph-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 64px; gap: 0.75rem; align-items: center; padding: 0.45rem 0; border-bottom: 1px solid var(--gray-100); font-size: var(--text-sm); }
.bgraph-label { min-width: 0; color: var(--gray-800); overflow-wrap: anywhere; }
.bgraph-label small { display: block; color: var(--gray-500); font-size: var(--text-xs); }
.bgraph-cell { min-width: 0; }
.bgraph-value { text-align: right; }
.bgraph-row--reference .bgraph-label { color: var(--gray-600); }
.bgraph-row[role="button"] { cursor: pointer; border-radius: 4px; }
.bgraph-row[role="button"]:hover { background: var(--gray-50); }
.bgraph-row[role="button"]:focus-visible { outline: 2px solid var(--brand-teal-500); outline-offset: 2px; }
.bgraph-row--on, .bgraph-row--on:hover { background: var(--brand-teal-50); box-shadow: inset 3px 0 0 var(--brand-teal-500); }
.bgraph-axis { position: relative; height: 14px; margin: 0 calc(64px + 0.75rem) 0 calc(150px + 0.75rem); font-size: var(--text-xs); color: var(--gray-500); }
.bgraph-axis-tick { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.bgraph-axis-first { transform: none; }
.bgraph-axis-last { transform: translateX(-100%); }
.bgraph-track { position: relative; height: 12px; background: var(--gray-100); border-radius: 2px; }
.bgraph-zone { position: absolute; top: 0; bottom: 0; }
.bgraph-zone--best { background: var(--brand-green-300); }
.bgraph-zone--good, .bgraph-zone--atm { background: var(--brand-green-200); }
.bgraph-zone--ok { background: var(--brand-green-100); }
.bgraph-zone--warn { background: var(--brand-amber-100); }
.bgraph-zone--warn2 { background: var(--brand-amber-200); }
.bgraph-zone--bad { background: var(--brand-red-100); }
.bgraph-zone--bad2 { background: var(--brand-red-200); }
.bgraph-zone--none { background: var(--gray-100); }
.bgraph-line { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--gray-700); }
.bgraph-line--peer { background: var(--gray-400); }
.bgraph-dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid var(--white); box-shadow: 0 0 0 1px var(--gray-400); }
.bgraph-dot--good { background: var(--brand-green-600); }
.bgraph-dot--warn { background: var(--brand-amber-600); }
.bgraph-dot--bad { background: var(--brand-red-600); }
.bgraph-dot--neutral { background: var(--gray-400); }
.bgraph-dot--over-r::after, .bgraph-dot--over-l::after { position: absolute; top: -3px; font-size: var(--text-sm); line-height: 1; color: var(--gray-700); }
.bgraph-dot--over-r::after { content: '›'; left: 12px; }
.bgraph-dot--over-l::after { content: '‹'; right: 12px; }
.bgraph-lane { position: relative; height: 6px; margin-top: 4px; background: var(--gray-50); border-radius: 2px; }
.bgraph-lane-box { position: absolute; top: 0; bottom: 0; background: var(--gray-300); border-radius: 2px; }
.bgraph-lane-med { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--gray-600); }
.bgraph-range { margin-top: 3px; font-size: var(--text-xs); line-height: 1.2; color: var(--gray-500); text-align: right; font-variant-numeric: tabular-nums; }
.bgraph-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; margin-top: 0.5rem; font-size: var(--text-xs); color: var(--gray-600); }
.bgraph-key { display: inline-flex; align-items: center; gap: 0.3rem; }
.bgraph-key i { display: inline-block; flex: none; }
.bgraph-key-zone { width: 14px; height: 8px; border-radius: 2px; }
.bgraph-key-line { width: 2px; height: 11px; background: var(--gray-700); }
.bgraph-key-line--peer { background: var(--gray-400); }
.bgraph-key-dot { width: 10px; height: 10px; border-radius: 50%; }
.bgraph-key-lane { width: 16px; height: 6px; border-radius: 2px; background: var(--gray-300); }
.bgraph-key-range { font-style: normal; color: var(--gray-500); font-variant-numeric: tabular-nums; }
/* One item in money (the Pay vs market drawer) */
.bgraph-money { margin: 0.3rem 0 0.6rem; }
.bgraph-money-keys { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin-bottom: 0.45rem; font-size: var(--text-sm); color: var(--gray-600); font-variant-numeric: tabular-nums; }
.bgraph-money-keys strong { color: var(--gray-900); }
.bgraph-money-keys i { display: inline-block; margin-right: 0.35rem; vertical-align: -2px; }
.bgraph-key-end { width: 3px; height: 12px; }
.bgraph-key-box { width: 14px; height: 10px; background: var(--gray-200); border: 1px solid var(--gray-300); border-radius: 2px; }
.bgraph-money-track { position: relative; height: 26px; background: var(--white); border: 1px solid var(--gray-200); border-radius: 3px; }
.bgraph-money-range { position: absolute; top: 0; bottom: 0; background: var(--gray-200); }
.bgraph-money-bar { position: absolute; top: 34%; bottom: 34%; }
.bgraph-money-end { position: absolute; top: 16%; bottom: 16%; width: 3px; margin-left: -1.5px; border-radius: 1px; }
.bgraph-money-median { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--gray-900); }
.bgraph-money--good { background: var(--brand-green-600); }
.bgraph-money--warn { background: var(--brand-amber-600); }
.bgraph-money--bad { background: var(--brand-red-600); }
.bgraph-money--neutral { background: var(--gray-500); }
/* The compact size, for a drawer (460px): a narrower label, the axis at its ends and its kept ticks */
.bgraph-rows--compact .bgraph-row { grid-template-columns: 108px minmax(0, 1fr) 56px; gap: 0.5rem; }
.bgraph-rows--compact .bgraph-axis { margin: 0 calc(56px + 0.5rem) 0 calc(108px + 0.5rem); }
.bgraph-rows--compact .bgraph-axis-tick:not(.bgraph-axis-first):not(.bgraph-axis-last):not(.bgraph-axis-keep) { display: none; }
/* Rows that each have their own scale: the figures named on the bar, the ticks on hover */
.bgraph-rows--own .bgraph-row { grid-template-columns: 150px minmax(0, 1fr) 78px; }
.bgraph-figures { position: relative; height: 15px; margin-bottom: 3px; font-size: var(--text-sm); line-height: 15px; }
.bgraph-figure { position: absolute; white-space: nowrap; font-weight: var(--font-semibold); font-variant-numeric: tabular-nums; }
.bgraph-figure--low { transform: translateX(-100%); padding-right: 3px; }
.bgraph-figure--high { padding-left: 3px; }
.bgraph-figure--good { color: var(--brand-green-700); }
.bgraph-figure--warn { color: var(--brand-amber-700); }
.bgraph-figure--bad { color: var(--brand-red-700); }
.bgraph-figure--neutral { color: var(--gray-700); }
.bgraph-figure--ref { color: var(--gray-700); font-weight: var(--font-medium); }
.bgraph-under { position: relative; }
.bgraph-under .bgraph-range { transition: opacity 0.12s; }
.bgraph-ticks { position: absolute; top: 3px; left: 0; right: 0; height: 13px; font-size: var(--text-xs); line-height: 13px; color: var(--gray-600); font-variant-numeric: tabular-nums; opacity: 0; pointer-events: none; transition: opacity 0.12s; }
.bgraph-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.bgraph-rows--own .bgraph-line--peer,
.bgraph-rows--marks .bgraph-line--peer { top: -3px; bottom: 0; width: 1px; margin-left: 0; background: var(--gray-500); opacity: 0; transition: opacity 0.12s; }
.bgraph-rows--own .bgraph-row:focus-visible .bgraph-ticks,
.bgraph-rows--own .bgraph-row:focus-visible .bgraph-line--peer,
.bgraph-rows--marks .bgraph-row:focus-visible .bgraph-ticks,
.bgraph-rows--marks .bgraph-row:focus-visible .bgraph-line--peer { opacity: 1; }
.bgraph-rows--own .bgraph-row:focus-visible .bgraph-under .bgraph-range,
.bgraph-rows--marks .bgraph-row:focus-visible .bgraph-under .bgraph-range { opacity: 0; }
@media (hover: hover) {
    .bgraph-rows--own .bgraph-row:hover .bgraph-ticks,
    .bgraph-rows--own .bgraph-row:hover .bgraph-line--peer,
    .bgraph-rows--marks .bgraph-row:hover .bgraph-ticks,
    .bgraph-rows--marks .bgraph-row:hover .bgraph-line--peer { opacity: 1; }
    .bgraph-rows--own .bgraph-row:hover .bgraph-under .bgraph-range,
    .bgraph-rows--marks .bgraph-row:hover .bgraph-under .bgraph-range { opacity: 0; }
}
/* The one short key above a chart's rows; the rest of the rule behind its icon */
.bgraph-short-key { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; margin-bottom: 0.6rem; }
.bgraph-short-key .bgraph-legend { margin-top: 0; }
/* Pay vs market (plan Phase 1.5–1.6): the controls row and the grade's drawer */
.pvm-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0.25rem 0 1rem; }
.pvm-grow { flex: 1 1 auto; }
.pvm-controls .search-bar.pvm-search { flex: 0 1 300px; margin: 0; }
.pvm-note { flex-basis: 100%; margin: 0; text-align: right; }
.pvm-note:empty { display: none; }
.pvm-head { padding-bottom: 0.75rem; border-bottom: 1px solid var(--gray-100); }
.pvm-lead { font-size: var(--text-body); color: var(--gray-800); margin: 0 0 0.35rem; }
.pvm-sub { margin-top: 1rem; }
.pvm-open { padding: 0.35rem 0.4rem 0.75rem; background: var(--brand-teal-50); border-bottom: 1px solid var(--gray-100); }
.pvm-quality { margin: 0.6rem 0 0.4rem; padding: 0.6rem 0.7rem; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); }
.pvm-quality-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.4rem; }
.pvm-quality-head .bd-thin { margin: 0; }
.pvm-quality-list { display: grid; grid-template-columns: 74px 1fr; gap: 0.25rem 0.6rem; margin: 0; font-size: var(--text-sm); }
.pvm-quality-list dt { color: var(--gray-500); }
.pvm-quality-list dd { margin: 0; color: var(--gray-800); font-variant-numeric: tabular-nums; }
.pvm-quality-foot { margin: 0.45rem 0 0; }
@media (max-width: 640px) {
    .bgraph-row { grid-template-columns: 96px minmax(0, 1fr) 56px; gap: 0.5rem; }
    .bgraph-axis { margin: 0 calc(56px + 0.5rem) 0 calc(96px + 0.5rem); }
    .bgraph-axis-tick:not(.bgraph-axis-first):not(.bgraph-axis-last):not(.bgraph-axis-keep) { display: none; }
    /* Own-scale rows: label and pill on a line, the bar under them at full width */
    .bgraph-rows--own .bgraph-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 0.75rem; }
    .bgraph-rows--own .bgraph-cell { grid-column: 1 / -1; grid-row: 2; padding: 0 1rem; }
    /* A shared scale's rows with hover marks take the same layout; the axis lines up with the full-width bars */
    .bgraph-rows--marks .bgraph-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 0.75rem; }
    .bgraph-rows--marks .bgraph-cell { grid-column: 1 / -1; grid-row: 2; padding: 0 1rem; }
    .bgraph-rows--marks .bgraph-axis { margin: 0 1rem 0.25rem; }
}
.bd-tag { font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    padding: 0.05rem 0.35rem; border-radius: 999px; background: var(--brand-indigo-50); color: var(--brand-indigo-700); }

/* .bd-kpis removed 2026-07-31. It reimplemented the density of the context-pane
   KPI tiles while inheriting none of `.l2-l1strip`'s behaviour — no always-2-up
   grid, no responsive variants, and no reflow to 4-up when the insights drawer
   stacks the split. The benchmark pane now uses the shared wrapper, like every
   other drill-in. */

/* Rewards pay drill-in — filter row.
   LAYOUT ONLY. The controls inside are `hc-dist-metric-toggle` and
   `hc-dist-division-pill`, the already-approved variants the legacy card used;
   this adds no new element, only the row that holds them. The legacy card
   positioned the same pills with four separate inline `style="display:flex..."`
   blocks, which is what this replaces. */
.bd-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem;
    padding-bottom: 0.9rem; margin-bottom: 1rem; border-bottom: 1px solid var(--gray-100); }
.bd-filter-group { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
/* Separates the basis toggle from the scope pills without a vertical rule —
   they are different kinds of choice (what is measured vs over whom). */
.bd-filter-group + .bd-filter-group { padding-left: 1rem; border-left: 1px solid var(--gray-200); }
@media (max-width: 720px) {
    .bd-filter-group + .bd-filter-group { padding-left: 0; border-left: none; }
}

/* Suppression reasons. Neutral, not error-styled: a privacy floor and an
   unmapped grade are both states, not faults (§8.2 — styling suppression red
   teaches users that a legal minimum is a bug). */
.bd-shield-reasons { list-style: none; margin: 0.9rem auto 0; padding: 0.7rem 1rem; max-width: 380px;
    text-align: left; background: var(--gray-50); border: 1px solid var(--gray-200);
    border-radius: var(--radius); font-size: 12.5px; color: var(--gray-700); }
.bd-shield-reasons li { padding: 0.2rem 0; }
.bd-shield-reasons strong { color: var(--gray-900); }

/* ==========================================================================
   EARLY ATTRITION — table cells.

   The card's three grids became one sortable table (client/attrition-table.js).
   Only what is specific to this card lives here: the tenure-mix strip, the
   vs-average cell and the person chips. The table itself is the canonical
   `.data-table.data-table-compact` in a `.table-container`, styled by the shared
   `.tt-*` rules above — nothing here restyles a border, a padding or a header.
   ========================================================================== */

/* Tenure mix — HOW EARLY they left, as proportions of this row's early leavers.
   Fourth caller for the shared composition strip, and the first where segment
   ORDER IS SEVERITY: the whole point is whether the mass sits at the left-hand
   end. Colours are the card's own bucket dots, unchanged, so the strip and the
   status beside it cannot disagree. No target band and no marker — this card's
   stated target is zero, and a band drawn around zero says nothing. */
.ea-strip {
    display: flex; width: 100%; min-width: 80px; height: 7px;
    border-radius: 4px; overflow: hidden;
    background: var(--gray-100); vertical-align: middle; cursor: help;
}
.ea-strip > i { display: block; height: 100%; min-width: 2px; }
.ea-strip > i.seg-90  { background: var(--brand-red-500); }
.ea-strip > i.seg-180 { background: var(--brand-amber-500); }
.ea-strip > i.seg-1y  { background: var(--brand-green-500); }
.ea-strip > i.seg-2y  { background: var(--gray-400); }
.ea-strip-none { color: var(--gray-400); font-size: var(--text-sm); }
.ea-cell-strip { width: 20%; }
.ea-drawer-strip { margin-bottom: 1rem; }

.ea-legend {
    margin: 0.6rem 0 0; font-size: var(--text-xs); color: var(--gray-500);
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem;
}
.ea-legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.ea-legend-item > i { width: 10px; height: 7px; border-radius: 2px; display: inline-block; }
.ea-legend-item > i.seg-90  { background: var(--brand-red-500); }
.ea-legend-item > i.seg-180 { background: var(--brand-amber-500); }
.ea-legend-item > i.seg-1y  { background: var(--brand-green-500); }
.ea-legend-item > i.seg-2y  { background: var(--gray-400); }
.ea-legend-sep { color: var(--gray-300); }

/* vs the property average, on the manager lens. Replaces a raw "⚠" glued onto
   the end of the manager's NAME — a status placed inside an identifier, which
   could not be sorted or filtered and was read by a screen reader as part of
   the name. */
.ea-vs { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ea-vs.is-over { color: var(--danger); font-weight: var(--font-semibold); }
.ea-vs.is-under { color: var(--gray-500); }
.ea-vs-avg { color: var(--gray-400); font-weight: var(--font-normal); }

.ea-none { color: var(--gray-400); }
/* A leaver's pay position. Below 0.90 is the same line the retention card's pay
   factor uses, so the two agree about what "under-paid" means. */
.ea-compa { font-variant-numeric: tabular-nums; font-weight: 600; }
.ea-compa.is-low { color: var(--brand-red-600); }
.ea-fast { font-variant-numeric: tabular-nums; }
.ea-fast.is-quick { color: var(--danger); font-weight: var(--font-semibold); }

/* Drawer person rows — everyone carries the tenure that put them in a bucket. */
.ea-person-right { display: inline-flex; gap: 0.35rem; align-items: center; }
.ea-tenure {
    font-size: 11px; font-weight: 600; padding: 0.1rem 0.4rem; border-radius: 3px;
    white-space: nowrap; align-self: center; font-variant-numeric: tabular-nums;
}
.ea-tenure.t90  { background: var(--brand-red-50); color: var(--brand-red-700); }
.ea-tenure.t180 { background: var(--brand-amber-50); color: var(--brand-amber-700); }
.ea-tenure.t1y  { background: var(--brand-green-50); color: var(--brand-green-700); }
.ea-tenure.t2y  { background: var(--gray-100); color: var(--gray-600); }

/* Drawer ladder — same canonical table, narrower gutters. Evidence, not a
   target list: its rows are not clickable, so they get no hover affordance. */
.ea-ladder { font-size: var(--text-xs); }
.ea-ladder th, .ea-ladder td { padding: 0.35rem 0.4rem; }
.ea-ladder th:first-child, .ea-ladder td:first-child { padding-left: 0; }
.ea-ladder th:last-child, .ea-ladder td:last-child { padding-right: 0; }
.ea-ladder tbody tr { cursor: default; }
.tt-table.ea-ladder tbody tr:hover,
.tt-table.ea-ladder tbody tr:nth-child(even):hover { background: var(--tt-zebra); }
.tt-table.ea-ladder tbody tr:nth-child(odd):hover { background: transparent; }
.ea-ladder .ea-strip { width: 60px; min-width: 60px; }

/* Narrow panes: "Joined" goes first — the rate beside it already carries the
   ratio it is the denominator for — then "Fastest exit", whose signal the
   strip's left-hand end already shows. CLASS-DRIVEN for the drawer as well as a
   media query for the viewport: opening the L3 drawer narrows the pane without
   the viewport changing at all, so a media query alone never fires and the
   columns are simply crushed. */
body.l3-drawer-open .ea-col-drop { display: none; }
@media (max-width: 1100px) { .ea-col-drop { display: none; } }
/* Pushed right, away from the legend keys — it is a caveat about the table, not
   another thing in the key. */
.ea-legend-hidden { margin-left: auto; }

/* ==========================================================================
   NATIONALITY DIVERSITY — table cells.

   Four lenses became three (client/diversity-table.js). Only what is specific
   to this card lives here: the nationality mix strip, the quota bar, the status
   cell. The table itself is the canonical `.data-table.data-table-compact` in a
   `.table-container`, styled by the shared `.tt-*` rules — nothing below
   restyles a border, a padding or a header.
   ========================================================================== */

/* Nationality mix — the shared composition strip, fifth caller.

   THE CHART PALETTE, NEVER RAG. A nationality is not a status: colouring the
   largest segment red says the people in it are the problem. Only the first
   segment carries meaning — its width is the top share, which is what the
   verdict is read from. */
.dv-strip {
    display: flex; width: 100%; min-width: 90px; height: 8px;
    border-radius: 4px; overflow: hidden;
    background: var(--gray-100); vertical-align: middle; cursor: help;
}
.dv-strip > i { display: block; height: 100%; min-width: 2px; }
.dv-strip > i.dv-s1 { background: var(--chart-1); }
.dv-strip > i.dv-s2 { background: var(--chart-2); }
.dv-strip > i.dv-s3 { background: var(--chart-3); }
.dv-strip > i.dv-s4 { background: var(--chart-4); }
.dv-strip > i.dv-s5 { background: var(--chart-5); }
.dv-strip > i.dv-rest { background: var(--chart-10); }
.dv-strip-none { color: var(--gray-400); font-size: var(--text-sm); }
.dv-cell-strip { width: 18%; }

/* The 50% mark, drawn on the strip. A composition bar with no reference is
   unreadable at a glance — 44% and 56% of one colour look identical — and 50 is
   exactly where Concentrated becomes Dominated. */
.dv-strip-wrap { position: relative; display: block; }
.dv-strip-half {
    position: absolute; top: -2px; bottom: -2px; left: 50%;
    width: 0; border-left: 1.5px dashed var(--gray-500); pointer-events: none;
}

.dv-legend {
    margin: 0.6rem 0 0; font-size: var(--text-xs); color: var(--gray-500);
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem;
}
.dv-legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.dv-legend-item > i { width: 10px; height: 8px; border-radius: 2px; display: inline-block; }
.dv-legend-sep { color: var(--gray-300); }
.dv-legend-hidden { margin-left: auto; }

/* Status cell. The department lens's verdict is the band name alone — the
   nationality and its share are the two columns immediately to the left, and a
   status that restates its neighbours is a third copy, not a summary. */
.dv-status { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.dv-status-none { color: var(--gray-400); }
.dv-why { color: var(--gray-400); font-size: 11px; }
/* "3 tied" — a fact about the department, not a nationality's name, so it is
   set apart from the names in the same column rather than reading as one. */
.dv-tied { color: var(--gray-500); font-style: italic; cursor: help; }
/* A deliberate second line under a number, not a wrap the layout chose. */
.dv-why-block { display: block; line-height: 1.35; }
/* The status must never outgrow its row: one name and a count, and if a label
   still runs long it ellipsises rather than pushing the column off the pane. */
.dv-status { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* `is-flag` marks the reading that produced the status — an underline, not a
   colour, so the RAG dot stays the only status signal in the row. */
.dv-num { font-variant-numeric: tabular-nums; }
.dv-num.is-flag {
    text-decoration: underline; text-decoration-color: var(--gray-400);
    text-underline-offset: 3px; font-weight: var(--font-semibold);
}

/* Quota bar (Nationalization lens). Carries the target as a tick for the same
   reason the Gender chart does: a bar with no reference cannot be judged. A
   department with no nationals says "none" rather than rendering as an empty
   track indistinguishable from a missing value. */
/* Since plan Phase 2.6 the quota, velocity and average cells hold the bullet graph's
   track (docs/ui-elements.md § Bullet graph); these only size the cell. */
.dv-quota, .cg-vel, .pf-avg, .gt-share { display: block; width: 100%; min-width: 90px; cursor: help; }
.gt-share-none { color: var(--gray-400); font-size: var(--text-sm); }
.gender-split-bullet { margin-top: 1rem; }
.gender-split-item { display: flex; align-items: center; gap: 0.75rem; }
.gender-split-item .gt-share { flex: 1; }
.gender-split-item-val { flex: none; min-width: 5.5em; text-align: right; font-size: var(--text-sm); color: var(--gray-700); font-variant-numeric: tabular-nums; }

/* The Nationalization headline — one number against one target, plus the thing
   that number cannot say. Sits outside the .tt-shell, so a re-sort leaves it. */
.dv-gauge-row {
    display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
    padding: 0 0 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--gray-100);
}
.dv-gauge-val { font-size: 26px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.dv-gauge-val.status-red { color: var(--brand-red-600); }
.dv-gauge-val.status-amber { color: var(--brand-amber-600); }
.dv-gauge-val.status-green { color: var(--brand-green-600); }
.dv-gauge-meta { font-size: 12.5px; color: var(--gray-600); line-height: 1.5; }
.dv-gauge-meta strong { color: var(--gray-900); }
.dv-gauge-caveat { margin: 0; flex: 1 1 320px; }
/* The correction rides on the verdict, in the verdict's own weight — it is part
   of the sentence "at target", not a footnote to it. */
.dv-gauge-but { color: var(--brand-amber-700); font-weight: var(--font-semibold); }

/* Drawer bits — same canonical table, narrower gutters. Evidence, not a target
   list: its rows are not clickable, so they get no hover affordance. */
.dv-drawer-strip { margin: 0.75rem 0 1rem; }
.dv-ladder { font-size: var(--text-xs); }
.dv-ladder th, .dv-ladder td { padding: 0.35rem 0.4rem; }
.dv-ladder th:first-child, .dv-ladder td:first-child { padding-left: 0; }
.dv-ladder th:last-child, .dv-ladder td:last-child { padding-right: 0; }
.dv-ladder tbody tr { cursor: default; }
.tt-table.dv-ladder tbody tr:hover,
.tt-table.dv-ladder tbody tr:nth-child(even):hover { background: var(--tt-zebra); }
.tt-table.dv-ladder tbody tr:nth-child(odd):hover { background: transparent; }
.dv-ladder .dv-strip { width: 70px; min-width: 70px; }
.dv-swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px;
    margin-right: 0.4rem; vertical-align: baseline; }
.dv-swatch.dv-s1 { background: var(--chart-1); }
.dv-swatch.dv-s2 { background: var(--chart-2); }
.dv-swatch.dv-s3 { background: var(--chart-3); }
.dv-swatch.dv-s4 { background: var(--chart-4); }
.dv-swatch.dv-s5 { background: var(--chart-5); }
.dv-swatch.dv-rest { background: var(--chart-10); }

/* Narrow panes: People goes first — the strip and the shares carry the size —
   then the secondary measure. CLASS-DRIVEN as well as a media query: opening
   the L3 drawer narrows the pane without the viewport changing at all, so a
   media query alone never fires and the columns are simply crushed. */
body.l3-drawer-open .dv-col-drop { display: none; }
@media (max-width: 1100px) { .dv-col-drop { display: none; } }

/* ==========================================================================
   CAREER GROWTH — table cells.

   Four of five lenses converted (client/career-table.js). Only what is specific
   to this card lives here: the movement-mix strip, the direction chip, the
   tenure-band strip, the velocity scale. The table itself is the canonical
   `.data-table.data-table-compact` in a `.table-container`.
   ========================================================================== */

/* Movement mix and tenure spread — the shared composition strip, sixth and
   seventh callers. CATEGORIES, NOT SEVERITIES: a lateral move is not "amber"
   and a transfer is not a warning, so these take the chart palette. The one
   exception is a demotion, which is the segment the reader must not miss. */
.cg-strip {
    display: flex; width: 100%; min-width: 90px; height: 8px;
    border-radius: 4px; overflow: hidden;
    background: var(--gray-100); vertical-align: middle; cursor: help;
}
.cg-strip > i { display: block; height: 100%; min-width: 2px; }
.cg-strip > i.cg-promo    { background: var(--chart-1); }
.cg-strip > i.cg-lateral  { background: var(--chart-2); }
.cg-strip > i.cg-transfer { background: var(--chart-6); }
.cg-strip > i.cg-unknown  { background: var(--chart-10); }
.cg-strip > i.cg-demo     { background: var(--brand-red-500); }
.cg-strip > i.cg-t0 { background: var(--brand-red-400); }
.cg-strip > i.cg-t1 { background: var(--brand-amber-400); }
.cg-strip > i.cg-t3 { background: var(--brand-green-400); }
.cg-strip > i.cg-t5 { background: var(--chart-10); }
.cg-strip-none { color: var(--gray-400); font-size: var(--text-sm); }
.cg-cell-strip { width: 17%; }

.cg-legend {
    margin: 0.6rem 0 0; font-size: var(--text-xs); color: var(--gray-500);
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem;
}
.cg-legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.cg-legend-item > i { width: 10px; height: 8px; border-radius: 2px; display: inline-block; }
.cg-legend-item > i.cg-promo    { background: var(--chart-1); }
.cg-legend-item > i.cg-lateral  { background: var(--chart-2); }
.cg-legend-item > i.cg-transfer { background: var(--chart-6); }
.cg-legend-item > i.cg-unknown  { background: var(--chart-10); }
.cg-legend-item > i.cg-demo     { background: var(--brand-red-500); }
.cg-legend-item > i.cg-t0 { background: var(--brand-red-400); }
.cg-legend-item > i.cg-t1 { background: var(--brand-amber-400); }
.cg-legend-item > i.cg-t3 { background: var(--brand-green-400); }
.cg-legend-item > i.cg-t5 { background: var(--chart-10); }
.cg-legend-sep { color: var(--gray-300); }

/* The direction chip. `unknown` is amber because it is a gap in what the
   platform knows, not a judgement about the move. */
.cg-dir {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 11px; font-weight: 600; padding: 0.12rem 0.45rem;
    border-radius: 3px; white-space: nowrap;
}
.cg-dir.d-promo    { background: var(--brand-green-50); color: var(--brand-green-700); }
.cg-dir.d-lateral  { background: var(--gray-100); color: var(--gray-600); }
.cg-dir.d-transfer { background: var(--brand-indigo-50); color: var(--brand-indigo-700); }
.cg-dir.d-demo     { background: var(--brand-red-50); color: var(--brand-red-700); }
.cg-dir.d-unknown  { background: var(--brand-amber-50); color: var(--brand-amber-700); }

.cg-move { font-size: 12px; color: var(--gray-600); }
.cg-move b { color: var(--gray-900); font-weight: var(--font-semibold); }
.cg-arrow { color: var(--gray-400); margin: 0 0.25rem; }

/* The velocity scale — a department's average time to first move against the
   property's own P10–P90. The band is what makes a number of months readable:
   eighteen months is fast at one property and slow at another. */
.cg-vel-none, .pf-avg-none { font-size: 10px; color: var(--gray-400); }

.cg-num { font-variant-numeric: tabular-nums; }
.cg-none { color: var(--gray-400); }
.cg-status {
    display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.cg-status-none { color: var(--gray-400); }
.cg-why { color: var(--gray-400); font-size: 11px; }

/* Drawer bits — same canonical table, narrower gutters. Evidence, not a target
   list: rows are not clickable, so they get no hover affordance. */
.cg-drawer-strip { margin: 0.75rem 0 1rem; }
.cg-ladder { font-size: var(--text-xs); }
.cg-ladder th, .cg-ladder td { padding: 0.35rem 0.4rem; }
.cg-ladder th:first-child, .cg-ladder td:first-child { padding-left: 0; }
.cg-ladder th:last-child, .cg-ladder td:last-child { padding-right: 0; }
.cg-ladder tbody tr { cursor: default; }
.tt-table.cg-ladder tbody tr:hover,
.tt-table.cg-ladder tbody tr:nth-child(even):hover { background: var(--tt-zebra); }
.tt-table.cg-ladder tbody tr:nth-child(odd):hover { background: transparent; }
.cg-ladder .cg-strip { width: 70px; min-width: 70px; }
.cg-swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px;
    margin-right: 0.4rem; vertical-align: baseline; }
.cg-swatch.cg-t0 { background: var(--brand-red-400); }
.cg-swatch.cg-t1 { background: var(--brand-amber-400); }
.cg-swatch.cg-t3 { background: var(--brand-green-400); }
.cg-swatch.cg-t5 { background: var(--chart-10); }

/* Narrow panes — class-driven for the drawer as well as a media query, because
   the pane narrows when the drawer opens WITHOUT the viewport changing. */
body.l3-drawer-open .cg-col-drop { display: none; }
@media (max-width: 1100px) { .cg-col-drop { display: none; } }

/* ==========================================================================
   PERFORMANCE — table cells.

   Performance STAYS Mode B: spec §6 says the chart slot is lens-aware and that
   lenses may expose a view selector. Builders: client/performance-table.js.

   Readability rebuild (2026-11-06, owner-approved mock-up
   client/performance-final-mockup.html): the context pane draws the rating mix
   against the target mix as one bar per band; the group table is Name · People ·
   Average · Rating mix · Status, the legend above it; the target mix is a lane
   under a row's mix on hover or focus; the rows on target fold; Needs review sits
   under department headings; the drawer names people instead of drawing a waffle.
   ========================================================================== */

/* Rating distribution — the shared composition strip, in the card's own
   `--perf-rating-N`, so the strip, the bars and the legend cannot disagree. */
.pf-strip {
    display: flex; width: 100%; min-width: 80px; height: 9px;
    border-radius: 4px; overflow: hidden;
    background: var(--gray-100); vertical-align: middle;
}
.pf-strip > i { display: block; height: 100%; min-width: 2px; }
.pf-strip > i.r1 { background: var(--perf-rating-1); }
.pf-strip > i.r2 { background: var(--perf-rating-2); }
.pf-strip > i.r3 { background: var(--perf-rating-3); }
.pf-strip > i.r4 { background: var(--perf-rating-4); }
.pf-strip > i.r5 { background: var(--perf-rating-5); }
.pf-strip-none { color: var(--gray-400); font-size: var(--text-sm); }
.pf-cell-strip { width: 22%; }
/* The status column holds a label and a reason in people: room for both on one line each. */
.pf-col-status { width: 31%; }

/* A row's mix, and the target mix as a lane under it: shown while the row is
   hovered, focused or open, its height held at rest so the row never jumps. */
.pf-mixcell { display: grid; gap: 3px; }
.pf-mixline { display: flex; align-items: center; gap: 6px; }
.pf-mixline small { flex: none; width: 34px; font-size: var(--text-xs); color: var(--gray-500); }
.pf-mixline--actual small, .pf-mixline--target { visibility: hidden; }
.pf-mixline--target .pf-strip { height: 6px; opacity: 0.55; }
.tt-table tbody tr.tt-row:hover .pf-mixline--target,
.tt-table tbody tr.tt-row:focus .pf-mixline--target,
.tt-table tbody tr.tt-row.is-l3-selected .pf-mixline--target,
.tt-table tbody tr.tt-row:hover .pf-mixline--actual small,
.tt-table tbody tr.tt-row:focus .pf-mixline--actual small,
.tt-table tbody tr.tt-row.is-l3-selected .pf-mixline--actual small { visibility: visible; }

/* The rating mix against the target mix — one bar per band, a tick at the
   target share, the gap in points beside it (amber at 10 or more). In the
   context pane for the property, in the drawer for one group. */
.pf-aside-mix { margin-top: 0.25rem; }
.pf-aside-title { font-size: 13px; font-weight: var(--font-semibold); color: var(--gray-700); margin: 0 0 0.25rem; }
.pf-aside-caption { font-size: var(--text-sm); color: var(--gray-500); margin: 0.4rem 0 0; }
.pf-mix-row {
    display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 3px 8px;
    padding: 0.5rem 0.375rem; border-bottom: 1px solid var(--gray-100);
    border-radius: 4px; font-size: 13px;
}
.pf-mix-row:last-child { border-bottom: 0; }
.pf-mix-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 8px; min-width: 0; }
.pf-mix-label b { font-weight: var(--font-semibold); color: var(--gray-900); white-space: nowrap; }
.pf-mix-label > span { font-size: 11px; color: var(--gray-500); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pf-mix-bar { grid-column: 1; position: relative; height: 9px; background: var(--gray-100); border-radius: 4px; }
.pf-mix-bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.pf-mix-bar > i.r1 { background: var(--perf-rating-1); }
.pf-mix-bar > i.r2 { background: var(--perf-rating-2); }
.pf-mix-bar > i.r3 { background: var(--perf-rating-3); }
.pf-mix-bar > i.r4 { background: var(--perf-rating-4); }
.pf-mix-bar > i.r5 { background: var(--perf-rating-5); }
.pf-mix-bar > em { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 2px solid var(--gray-800); }
.pf-mix-gap {
    grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right;
    font-family: var(--font-mono); font-size: 12px; font-weight: var(--font-semibold); color: var(--gray-500);
}
.pf-mix-gap.is-off { color: var(--brand-amber-600); }
.pf-mix-row--jump { cursor: pointer; }
.pf-mix-row--jump:hover, .pf-mix-row--jump:focus-visible { background: var(--gray-50); }
.pf-mix-row--jump:focus-visible { outline: 2px solid var(--chart-2); outline-offset: -2px; }
.pf-mix-chev { color: var(--gray-400); margin-left: 0.25rem; }
.l3-drawer .pf-mix { margin: 0 0 0.75rem; }

/* The key, above the table; the direction line and notes under it. */
.pf-legend {
    margin: 0 0 0.6rem; font-size: var(--text-xs); color: var(--gray-500);
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.75rem;
}
.pf-legend--foot { margin: 0.6rem 0 0; }
.pf-legend--count { font-size: var(--text-sm); }
.pf-legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.pf-legend-item > i { width: 10px; height: 9px; border-radius: 2px; display: inline-block; }
.pf-legend-item > i.r1 { background: var(--perf-rating-1); }
.pf-legend-item > i.r2 { background: var(--perf-rating-2); }
.pf-legend-item > i.r3 { background: var(--perf-rating-3); }
.pf-legend-item > i.r4 { background: var(--perf-rating-4); }
.pf-legend-item > i.r5 { background: var(--perf-rating-5); }
.pf-legend-lane > i {
    width: 22px; height: 5px; opacity: 0.55;
    background: linear-gradient(to right, var(--perf-rating-2) 0 10%, var(--perf-rating-3) 10% 80%, var(--perf-rating-4) 80% 95%, var(--perf-rating-5) 95%);
}
.pf-legend .pf-legend-keys { margin: 0; font-size: inherit; }

/* People: plain when everyone is rated; "8 of 30", amber, when not. */
.pf-cov { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--brand-amber-700); font-weight: var(--font-semibold); }
.pf-cov.is-thin { color: var(--brand-red-600); }

/* Average: the number and its bullet track in one cell. */
.pf-avg { display: flex; align-items: center; gap: 10px; }
.pf-avg-val { flex: none; width: 2.2em; text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.pf-avg .bgraph-track { flex: 1; max-width: 110px; }
.pf-avg-none { color: var(--gray-400); }

.pf-num { font-variant-numeric: tabular-nums; }
.pf-none { color: var(--gray-400); }

/* Status: the label, then the reason under it in people. */
.pf-status { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; max-width: 100%; }
.pf-status-label { display: inline-flex; align-items: center; gap: 0.4rem; }
.pf-status-none { color: var(--gray-400); }
.pf-why { color: var(--gray-500); font-size: 11px; line-height: 1.4; padding-left: 14px; }
.pf-status-none .pf-why { padding-left: 0; }
.pf-tip { color: var(--gray-400); }
.pf-small { margin-left: 0.4rem; cursor: help; vertical-align: 1px; }

/* The fold: the rows on target behind one toggle row in the same table. */
.tt-table tbody tr.pf-fold-row td { padding: 0; }
.tt-table tbody tr.pf-fold-row:hover { background: transparent; }
.pf-fold {
    width: 100%; display: flex; gap: 0.5rem; align-items: center; text-align: left;
    border: 0; background: var(--gray-50); padding: 0.55rem 0.75rem;
    font: inherit; font-size: 13px; color: var(--gray-700); cursor: pointer;
}
.pf-fold:hover { background: var(--gray-100); }
.pf-fold:focus-visible { outline: 2px solid var(--chart-2); outline-offset: -2px; }
.pf-fold-arr { color: var(--gray-500); transition: transform 0.15s; }
.pf-fold[aria-expanded="true"] .pf-fold-arr { transform: rotate(90deg); }

/* Needs review — the person, the rating with its band, the series, the review date. */
.pf-person { display: inline-flex; align-items: flex-start; gap: 0.45rem; text-align: left; }
.pf-person small { display: block; color: var(--gray-500); font-size: 11px; line-height: 1.4; }
.pf-rating b { font-weight: var(--font-semibold); font-variant-numeric: tabular-nums; }
.pf-rating-band { color: var(--gray-500); font-size: 11px; }
.pf-hist { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.15rem 0.35rem; font-variant-numeric: tabular-nums; }
.pf-hist-arrow { color: var(--gray-300); font-size: 10px; }
.pf-stale { color: var(--brand-amber-700); font-weight: var(--font-semibold); }
.pf-person-facts { font-size: var(--text-xs); }
.pf-person-facts td { padding: 0.3rem 0.4rem; }
.pf-person-facts td:first-child { padding-left: 0; color: var(--gray-500); }
.tt-table.pf-person-facts tbody tr { cursor: default; }

/* A row with no drawer behind it must not offer the affordance of one. */
.tt-table tbody tr.pf-row-flat { cursor: default; }
.tt-table tbody tr.pf-row-flat:hover { background: transparent; }
.tt-table tbody tr.pf-row-flat:nth-child(even):hover { background: var(--tt-zebra); }

/* Narrow panes — class-driven as well as a media query, because the pane
   narrows when the drawer opens WITHOUT the viewport changing. */
body.l3-drawer-open .pf-col-drop { display: none; }
@media (max-width: 1100px) { .pf-col-drop { display: none; } }
/* A phone: the average keeps its number and loses its track; the status column sizes to fit. */
@media (max-width: 640px) {
    .pf-avg .bgraph-track { display: none; }
    .pf-avg-val { width: auto; }
    /* The table scrolls inside its container (the canonical .table-container), so the
       status keeps enough width that its reason is two short lines, not six. */
    .pf-col-status { width: auto; min-width: 150px; }
    .pf-why { padding-left: 0; }
}

/* ==========================================================================
   RETENTION RISK — table cells.

   Two of three lenses converted (client/retention-table.js). "Risk factors"
   keeps its four cards: it is a fixed summary, not a ranking. The table itself
   is the canonical `.data-table.data-table-compact` in a `.table-container`.
   ========================================================================== */

/* Which factors fired, and how hard — the shared composition strip, ninth
   caller, and the only one whose segments are POINTS rather than people. Two
   employees both scoring 60 for different reasons are the same number and a
   different problem, and the number alone cannot separate them.

   Fixed colour per factor, so the same signal reads the same way down the
   column. NOT the RAG palette: these are categories, and "pay" is not more
   severe than "tenure" — severity is the score, which has its own cell. */
.rr-strip {
    display: flex; width: 100%; min-width: 80px; height: 8px;
    border-radius: 4px; overflow: hidden;
    background: var(--gray-100); vertical-align: middle; cursor: help;
}
.rr-strip > i { display: block; height: 100%; min-width: 2px; }
.rr-strip > i.rr-f1, .rr-legend-item > i.rr-f1, .rr-swatch.rr-f1 { background: var(--chart-1); }
.rr-strip > i.rr-f2, .rr-legend-item > i.rr-f2, .rr-swatch.rr-f2 { background: var(--chart-2); }
.rr-strip > i.rr-f3, .rr-legend-item > i.rr-f3, .rr-swatch.rr-f3 { background: var(--chart-6); }
.rr-strip > i.rr-f4, .rr-legend-item > i.rr-f4, .rr-swatch.rr-f4 { background: var(--chart-4); }
.rr-strip-none { color: var(--gray-400); font-size: var(--text-sm); }
.rr-cell-strip { width: 15%; }

/* Named factors, for a row with room for words. */
.rr-chips { display: inline-flex; gap: 0.25rem; flex-wrap: wrap; justify-content: center; }
.rr-chip {
    font-size: 10px; font-weight: 700; letter-spacing: 0.02em;
    padding: 0.1rem 0.35rem; border-radius: 3px; white-space: nowrap;
    color: #fff;
}
.rr-chip.rr-f1 { background: var(--chart-1); }
.rr-chip.rr-f2 { background: var(--chart-2); }
.rr-chip.rr-f3 { background: var(--chart-6); }
.rr-chip.rr-f4 { background: var(--chart-4); }

/* The score against the tier boundaries. The ticks come from the calculator,
   never from a second copy written here — CLAUDE.md records that Critical at 80
   was once arithmetically unreachable, so that tile could only read zero. */
.rr-score { display: block; width: 100%; min-width: 90px; cursor: help; }
.rr-cell-score { width: 16%; }

/* A department's at-risk share. */
.rr-share { display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; cursor: help; }
.rr-share .bgraph-track { flex: 1; min-width: 70px; }
.rr-share-val { min-width: 2.6em; text-align: right; }
.rr-share-val { font-variant-numeric: tabular-nums; }
.rr-share.is-high .rr-share-val { color: var(--brand-red-600); font-weight: var(--font-semibold); }
.rr-cell-share { width: 22%; }

.rr-legend {
    margin: 0.6rem 0 0; font-size: var(--text-xs); color: var(--gray-500);
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem;
}
.rr-legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.rr-legend-item > i { width: 10px; height: 8px; border-radius: 2px; display: inline-block; }
.rr-legend-w { color: var(--gray-400); font-variant-numeric: tabular-nums; }
.rr-legend-sep { color: var(--gray-300); }
.rr-legend-hidden { margin-left: auto; }

.rr-num { font-variant-numeric: tabular-nums; }
.rr-none { color: var(--gray-400); }
.rr-status {
    display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.rr-status-none { color: var(--gray-400); }
.rr-why { color: var(--gray-400); font-size: 11px; }
.rr-person { display: inline-flex; align-items: flex-start; text-align: left; }
.rr-person small { display: block; color: var(--gray-500); font-size: 11px; line-height: 1.4; }

/* Drawer — the arithmetic. A score with no working shown is how a broken scale
   survived once already. */
.rr-drawer-strip { margin: 0.75rem 0 1rem; }
.rr-ladder { font-size: var(--text-xs); }
.rr-ladder th, .rr-ladder td { padding: 0.35rem 0.4rem; }
.rr-ladder th:first-child, .rr-ladder td:first-child { padding-left: 0; }
.rr-ladder th:last-child, .rr-ladder td:last-child { padding-right: 0; }
.rr-ladder tbody tr { cursor: default; }
.tt-table.rr-ladder tbody tr:hover,
.tt-table.rr-ladder tbody tr:nth-child(even):hover { background: var(--tt-zebra); }
.tt-table.rr-ladder tbody tr:nth-child(odd):hover { background: transparent; }
/* A signal that did not fire is still a row — "checked and clear" is not the
   same as absent, which is the distinction this whole card is careful about. */
.tt-table.rr-ladder tbody tr.rr-row-off td { color: var(--gray-400); }
.rr-detail { color: var(--gray-500); font-size: 11px; text-align: left; }
.rr-swatch { display: inline-block; width: 9px; height: 9px; border-radius: 2px;
    margin-right: 0.4rem; vertical-align: baseline; }
.rr-maths {
    margin: 0.9rem 0 0; padding: 0.6rem 0.75rem;
    background: var(--gray-50); border-radius: var(--radius-sm);
    font-size: 12px; line-height: 1.55; color: var(--gray-600);
}
.rr-maths strong { color: var(--gray-900); font-variant-numeric: tabular-nums; }

/* Narrow panes — class-driven as well as a media query, because the pane
   narrows when the drawer opens WITHOUT the viewport changing. */
body.l3-drawer-open .rr-col-drop { display: none; }
@media (max-width: 1100px) { .rr-col-drop { display: none; } }

/* Grade compression — Staircase (floating bars), Structure table, Above manager.
   Builders in client/grade-compression-lenses.js. Signed off 2026-09-16 from the
   grade-compression mockup (v5). Bands are the property's authored ranges; the
   teal series colour marks actual pay; RAG on the step pills only. */
.gcs-wrap { background: transparent; border: none; padding: 0; }
/* Structure table: a grade number nobody is in (2026-09-18). */
.tt-table tr.gc-gap td { background: var(--gray-50); color: var(--gray-500); font-style: italic; }
/* Manager premium dumbbell (approved 2026-09-18): teal report, dark manager, gray premium, red only for an inversion. */
.gcs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.gcs-grid--single { grid-template-columns: 1fr; }
.gcs-panel { min-width: 0; }
.gcs-panel-title { font-size: var(--text-xs); font-weight: var(--font-semibold); color: var(--gray-700); margin: 0 0 0.25rem; }
.gcs-svg { width: 100%; height: auto; display: block; }
.gcs-svg text { font-family: var(--font-sans); font-size: 10.5px; fill: var(--gray-600); }
.gcs-svg .gcs-tick { fill: var(--gray-500); font-family: var(--font-mono); font-size: 10px; }
.gcs-svg .gcs-grid { stroke: var(--gray-100); }
.gcs-svg .gcs-band { fill: var(--gray-50); stroke: var(--gray-400); stroke-width: 1; }
.gcs-svg .gcs-band.solo { stroke-dasharray: 3 2; }
.gcs-svg .gcs-band.fallback { stroke-dasharray: 5 3; }
.gcs-svg .gcs-bandmid { stroke: var(--gray-400); stroke-width: 1.5; }
.gcs-svg .gcs-median { fill: var(--brand-teal-600); }
.gcs-svg .gcs-solo { fill: var(--gray-500); }
.gcs-svg .gcs-overlap { fill: var(--zone-watch-fill); }
.gcs-svg .gcs-glabel { fill: var(--gray-800); font-weight: var(--font-medium); }
.gcs-svg .gcs-glabel.solo { fill: var(--gray-400); }
.gcs-svg .gcs-steparrow { stroke: var(--gray-300); stroke-dasharray: 2 2; }
.gcs-svg .gcs-pill { stroke-width: 1; }
.gcs-svg .gcs-pill.green { fill: var(--brand-green-100); stroke: var(--brand-green-500); }
.gcs-svg .gcs-pill.amber { fill: var(--brand-amber-100); stroke: var(--brand-amber-500); }
.gcs-svg .gcs-pill.red { fill: var(--brand-red-100); stroke: var(--brand-red-500); }
.gcs-svg .gcs-pill.gray { fill: white; stroke: var(--gray-300); stroke-dasharray: 3 2; }
.gcs-svg .gcs-pill-txt { font-family: var(--font-mono); font-size: 11px; font-weight: var(--font-bold); }
.gcs-svg .gcs-pill-txt.green { fill: var(--brand-green-700); }
.gcs-svg .gcs-pill-txt.amber { fill: var(--brand-amber-600); }
.gcs-svg .gcs-pill-txt.red { fill: var(--brand-red-600); }
.gcs-svg .gcs-pill-txt.gray { fill: var(--gray-500); }
.gcs-svg .gcs-grade:hover .gcs-band { stroke: var(--gray-700); }
.gcs-key { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.gcs-key span { display: inline-flex; align-items: center; gap: 0.3rem; }
.gcs-key i { display: inline-block; width: 10px; height: 8px; border-radius: 2px; }
.gcs-key .gcs-k-band { border: 1px solid var(--gray-400); background: var(--gray-50); }
.gcs-key .gcs-k-mid { background: var(--gray-400); height: 2px; width: 12px; border-radius: 0; }
.gcs-key .gcs-k-median { background: var(--brand-teal-600); width: 8px; height: 8px; border-radius: 50%; }
.gcs-key .gcs-k-solo { background: var(--gray-500); width: 7px; height: 7px; border-radius: 50%; }
.gcs-key .gcs-k-overlap { background: var(--zone-watch-fill); border: 1px solid var(--brand-amber-500); }
@media (max-width: 720px) { .gcs-grid { grid-template-columns: 1fr; } }
/* Structure table — unscored rows read as context, not as data */
tr.gc-unscored td { color: var(--gray-500); }
.cell-value.green { color: var(--brand-green-600); font-weight: var(--font-semibold); }
.cell-value.gray { color: var(--gray-400); }
/* Above-manager drawer: the employee the drawer is about, inside their manager's team */
tr.gc-drawer-self td { background: var(--brand-amber-100); }
.l3-drawer-context { font-size: 13px; color: var(--gray-700); }
/* Method popup reading key (same row pattern as the pay-equity popup) */
.method-read-band { border: 1px solid var(--gray-400); background: var(--gray-50); box-sizing: border-box; }
.method-read-median { background: var(--brand-teal-600); border-radius: 50%; width: 10px !important; height: 10px !important; }
.method-read-overlap { background: var(--zone-watch-fill); border: 1px solid var(--brand-amber-500); box-sizing: border-box; }

/* Total rewards — Composition rows, By grade table, Year on year (bridge + trend).
   Builders in client/total-rewards-lenses.js. Signed off 2026-09-16 from the
   total-rewards mockup (v9). Component colours are chart palette slots (teal,
   blue, cyan, slate) with amber for the variable component; the bridge is
   neutral slate because a cost bridge passes no judgement. */
.tr-composition, .tr-groups, .tr-yoy, .tr-bridge, .tr-trend { background: transparent; }
.tr-stack { display: flex; height: 22px; border-radius: 6px; overflow: hidden; margin: 0.25rem 0 0.5rem; background: var(--gray-100); }
.tr-stack > i { display: block; height: 100%; }
.tr-rows { display: grid; gap: 2px; }
.tr-row { display: grid; grid-template-columns: 120px 1fr 64px 120px; align-items: center; gap: 12px; padding: 0.5rem 0; border-bottom: 1px solid var(--gray-100); }
.tr-row-label { font-size: 13px; font-weight: var(--font-semibold); color: var(--gray-900); }
.tr-row-label small { display: block; font-weight: 400; font-size: 11px; color: var(--gray-500); }
.tr-track { position: relative; height: 14px; background: var(--gray-100); border-radius: 7px; overflow: hidden; }
.tr-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 7px; }
.tr-c-basic { background: var(--chart-1); } .tr-c-count { background: var(--chart-1); } /* headcount bars (Structure lens): same teal, a name that is not a pay component */ .tr-c-housing { background: var(--chart-2); } .tr-c-transport { background: var(--chart-5); } .tr-c-other { background: var(--chart-10); } .tr-c-sc { background: var(--chart-4); } .tr-c-social { background: var(--chart-8); }
/* EoS profile rows: a longer label (band + people + rate pill) than a pay component needs. */
.tr-row.tr-row--wide { grid-template-columns: 170px 1fr 64px 130px; }
.tr-row-label .badge { margin-left: 6px; vertical-align: middle; }
.tr-share { font-family: var(--font-mono); font-size: 13px; font-weight: var(--font-semibold); text-align: right; font-variant-numeric: tabular-nums; color: var(--gray-900); }
.tr-amt { font-family: var(--font-mono); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; color: var(--gray-600); }
.tr-amt small { display: block; font-size: 10.5px; color: var(--gray-500); }
.tr-sentence { font-size: 12.5px; color: var(--gray-600); margin: 0.6rem 0 0; }
.tr-sentence b { color: var(--gray-900); font-weight: var(--font-semibold); }
.trb-svg, .try-svg { width: 100%; height: auto; display: block; }
.trb-svg text, .try-svg text { font-family: var(--font-sans); font-size: 11px; fill: var(--gray-700); }
.trb-svg .trb-tick, .try-svg .trb-tick { fill: var(--gray-500); font-family: var(--font-mono); font-size: 10px; }
.trb-svg .trb-grid, .try-svg .trb-grid { stroke: var(--gray-100); }
.trb-svg .trb-total { fill: var(--gray-300); }
.trb-svg .trb-effect { fill: var(--chart-10); }
.trb-svg .trb-link { stroke: var(--gray-400); stroke-dasharray: 3 3; }
.trb-svg .trb-val, .try-svg .trb-val { font-family: var(--font-mono); font-weight: var(--font-semibold); fill: var(--gray-900); }
.trb-svg .trb-sub { fill: var(--gray-500); font-size: 10px; }
.try-svg .try-line { fill: none; stroke: var(--brand-teal-600); stroke-width: 2; }
.try-svg .try-area { fill: var(--chart-1); fill-opacity: 0.10; }
.try-svg .try-dot { fill: var(--brand-teal-600); }
.try-svg .try-dot-ref { fill: white; stroke: var(--gray-700); stroke-width: 2; }
.try-svg .try-dot-now { fill: var(--gray-900); }
.try-svg .try-ref { stroke: var(--gray-400); stroke-dasharray: 3 3; }
.try-svg .try-hc { fill: var(--gray-200); }
.try-svg .try-hc-lbl { fill: var(--gray-500); font-family: var(--font-mono); font-size: 9.5px; }
.tr-trend { margin-top: 1rem; }
@media (max-width: 640px) { .tr-row { grid-template-columns: 96px 1fr 52px 96px; gap: 8px; } }

/* All-months preload failed: one notice above the Insights results, a foot line on every drill headline. */
.insights-partial-notice { margin: 0 0 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.insights-partial-notice .card-callout-title { flex-basis: 100%; }
.insights-partial-notice .insights-partial-retry { margin-left: auto; }
.headline-foot-partial { color: var(--brand-amber-600); font-weight: var(--font-semibold); }

/* Span of Control › Structure lens (2026-09-19) — two titled blocks, approved families inside. */
.wfs-block { margin: 0 0 1.25rem; }
.wfs-block + .wfs-block { border-top: 1px solid var(--gray-100); padding-top: 1rem; }
.wfs-title { margin: 0 0 0.5rem; font-size: 0.875rem; font-weight: 600; color: var(--gray-900); }
.tr-row.wfs-layer { grid-template-columns: 110px 1fr 56px 120px; }
.tr-row.wfs-layer .tr-row-label small { display: block; color: var(--gray-500); font-weight: 400; }
@media (max-width: 640px) { .tr-row.wfs-layer { grid-template-columns: 80px 1fr 40px 80px; } }

/* ============================================
   Users › Access rights (2026-10-06, docs/access-rights-plan.md)
   Mock-up: client/access-rights-mockup.html
   ============================================ */
/* These are shown and hidden with the hidden attribute, which loses to the
   display rules of .btn and .form-group without this. */
.users-container[hidden],
.access-actions [hidden],
#user-modal [hidden],
#user-type-modal [hidden],
#security-tab-erasure [hidden],
#erasure-modal [hidden],
#erasure-drawer [hidden] {
    display: none !important;
}
/* One toolbar shape, two panels: Users › Access rights and Security › Data erasure. */
.access-toolbar,
.erasure-toolbar {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 0 0 0.75rem;
}
.access-intro,
.erasure-intro {
    margin: 0;
    max-width: 44rem;
    color: var(--gray-600);
    font-size: var(--text-sm);
}
.access-actions,
.erasure-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.access-pending {
    margin-right: 0.25rem;
    color: var(--gray-700);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}
.access-matrix th.access-type-col {
    text-align: center;
    vertical-align: bottom;
}
.access-matrix th.access-cap-col {
    vertical-align: bottom;
}
.access-type-meta {
    display: block;
    margin: 0.3rem 0 0.2rem;
    font-weight: 400;
    font-size: var(--text-sm);
    color: var(--gray-500);
}
.access-cap {
    min-width: 17rem;
}
.access-cap-label {
    display: block;
    font-weight: var(--font-medium);
    color: var(--gray-900);
}
.access-cap-sub {
    display: block;
    font-size: var(--text-sm);
    color: var(--gray-500);
}
.access-matrix td.access-cell {
    text-align: center;
}
.access-cell .checkbox {
    justify-content: center;
}
.access-locked {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--gray-400);
}
.access-lock {
    flex: none;
}
.access-legend {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    align-items: center;
    margin: 0.6rem 0 0;
    font-size: var(--text-sm);
    color: var(--gray-500);
}
.access-swatch {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    margin-right: 0.3rem;
    border-radius: 3px;
    vertical-align: -2px;
    background: var(--brand-amber-50);
    box-shadow: inset 0 0 0 1px var(--brand-amber-300);
}
.access-loading {
    display: grid;
    place-items: center;
    gap: 0.5rem;
    height: 6rem;
    color: var(--gray-500);
    font-size: var(--text-sm);
}
.access-archive {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.access-archive .btn {
    flex: none;
    white-space: nowrap;
}
.rights-changes {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.rights-changes li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* What a user type can do, two columns (approved 2026-10-06,
   docs/ui-elements.md). Drawn from the same served table as Access rights. */
.rights-summary {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
}
.rights-summary-head {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 0.5rem;
    font-weight: var(--font-medium);
}
.rights-summary-link {
    font-size: var(--text-sm);
    color: var(--primary-color);
    text-decoration: none;
}
.rights-summary-link:hover {
    text-decoration: underline;
}
.rights-summary-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.rights-summary ul {
    display: grid;
    align-content: start;   /* the shorter list stays packed at the top */
    gap: 0.3rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--text-sm);
}
.rights-summary li {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
.rights-summary-can svg {
    flex: none;
    color: var(--brand-green-600);
}
.rights-summary-cannot {
    color: var(--gray-500);
}
.rights-summary-cannot svg {
    flex: none;
    color: var(--gray-400);
}
@media (max-width: 640px) {
    .rights-summary-cols {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════════════════════════════
   SECURITY › DATA ERASURE (2026-10-06, docs/erasure-tool-plan.md)
   Approved elements only (mock-up: client/erasure-tool-mockup.html); these
   rules lay them out. The toolbar shares the Access rights rules above.
   ══════════════════════════════════════════════════════════════════════════════ */

/* Pills share width equally (flex-basis 0), so in a toolbar that sizes to its
   content each shrank to its longest word and the count wrapped below. */
.erasure-actions .filter-pill {
    white-space: nowrap;
}

.erasure-register tbody tr {
    cursor: pointer;
}

.erasure-register tbody tr:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.erasure-muted {
    color: var(--gray-500);
    font-size: var(--text-sm);
}

.erasure-section-title {
    margin: 1rem 0 0.5rem;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--gray-700);
}

.erasure-section-title:first-child {
    margin-top: 0;
}

/* Two wide cards side by side; auto-fill would leave them 180px wide. */
.erasure-cards {
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.erasure-cards .radio-card > span {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.erasure-cards .form-hint {
    margin-top: 0;
}

/* Delete everything, for a superuser without 2FA. */
.radio-card:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.6;
    background: var(--gray-50);
}

.radio-card:has(input:disabled) input[type="radio"] {
    cursor: not-allowed;
}

.erasure-gap {
    margin-top: 0.85rem;
}

.erasure-what td:first-child {
    min-width: 13rem;
}

.erasure-matches tr.is-erased td {
    color: var(--gray-500);
}

.erasure-lead {
    margin: 0 0 0.75rem;
}

.erasure-list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.35rem;
}

.erasure-confirm-type input {
    max-width: 22rem;
}

.erasure-code-input {
    max-width: 10rem;
}

/* The record: label column muted, no header row. */
.erasure-record thead {
    display: none;
}

.erasure-record td:first-child {
    width: 38%;
    color: var(--gray-500);
}

.erasure-note {
    margin: 0;
}

@media (max-width: 640px) {
    /* With a Failed pill the group outgrows a phone: it scrolls, the page does not. */
    #erasure-filter {
        max-width: 100%;
        overflow-x: auto;
    }

    .erasure-what td:first-child {
        min-width: 0;
    }
}

/* ═══ Setup view — the essential path (onboarding Phase 3) ═══
   .setup-flow approved 2026-10-11 (docs/ui-elements.md, Family 18): the steps
   on the left, the step on the right. Finished steps are links back; steps
   not reached are plain text. The page sits in .setup-page (a white panel);
   Welcome and Ready use the narrower .setup-page-medium. */
.setup-page { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 1.5rem; max-width: 1040px; margin: 0 auto; }
.setup-page-medium { max-width: 640px; }
.setup-page h2.setup-page-title { margin: 0 0 0.5rem; font-size: var(--text-xl); }
.setup-page-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }
.setup-page .setup-muted, .setup-suggest-form .setup-muted { color: var(--gray-500); font-size: var(--text-sm); }
.setup-page .setup-gap-top { margin-top: 1rem; }
/* Setup › Job titles (2026-10-23, client/job-titles-views.js): approved table, pills,
   badges and select; only the editor row's layout is its own */
.setup-page .jt-summary { margin: 0.75rem 0; color: var(--gray-700); }
.setup-page .jt-table td { vertical-align: top; }
.setup-page .jt-table .btn { white-space: nowrap; }
.setup-page .jt-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.setup-page .jt-editor select { min-width: 16rem; max-width: 100%; }
.setup-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .setup-grid2 { grid-template-columns: 1fr; } }

.setup-flow { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 1.5rem; }
@media (max-width: 760px) { .setup-flow { grid-template-columns: 1fr; } }
.setup-flow-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; align-content: start; }
.setup-flow-steps li > a, .setup-flow-steps li > span.setup-flow-step { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.55rem 0.65rem;
    border-radius: var(--radius); font-size: var(--text-sm); color: var(--gray-600); text-decoration: none; }
.setup-flow-steps li > a:hover { background: var(--gray-50); color: var(--gray-900); }
.setup-flow-steps li > a:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.setup-flow-steps li.on > a, .setup-flow-steps li.on > span.setup-flow-step { background: var(--gray-50); color: var(--gray-900); font-weight: 600; }
.setup-flow-steps .n { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--gray-300);
    display: grid; place-items: center; font-size: var(--text-xs); font-weight: 600; }
.setup-flow-steps li.on .n { border-color: var(--primary-color); color: var(--primary-color); }
.setup-flow-steps li.done .n { border-color: var(--brand-green-500); background: var(--brand-green-500); color: var(--white); }
.setup-flow-steps small { display: block; font-weight: 400; color: var(--gray-500); }
.setup-flow-head { margin-bottom: 1rem; }
.setup-flow-head h2 { margin: 0 0 0.25rem; font-size: var(--text-xl); }
/* The heading takes focus on each step so a screen reader announces it; it is not a control, so no ring */
.setup-flow-head h2[tabindex="-1"]:focus { outline: none; }
.setup-flow-head p { margin: 0; }
.setup-flow-foot { display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; border-top: 1px solid var(--gray-100); padding-top: 1rem; margin-top: 1.25rem; }
.setup-flow-foot .setup-flow-back, .setup-flow-foot .setup-flow-left { margin-right: auto; }
.setup-welcome-steps { margin: 0.5rem 0 1rem; padding-left: 1.25rem; line-height: 1.7; color: var(--gray-700); }
/* Room under the page so its footer scrolls clear of the floating buttons. */
#setup-view .view-content { padding-bottom: 6rem; }
/* Departments step: the selects take their column, so the table fits the step. */
.setup-dept-table { width: 100%; table-layout: fixed; }
.setup-dept-table th:nth-child(1) { width: 20%; }
.setup-dept-table th:nth-child(2) { width: 8%; }
.setup-dept-table th:nth-child(3) { width: 42%; }
/* One line per department: every cell starts at the top, and the name and the
   people count drop to the middle of the 32px selects beside them (the hint
   under the standard department used to push its select up and the division
   select down, by 12px, 21px when the hint wrapped). Desktop only: below 640px
   each department is a block. */
@media (min-width: 641px) {
    .setup-dept-table.data-table td { vertical-align: top; }   /* over .data-table-compact's middle */
    .setup-dept-table.data-table td.setup-dept-name, .setup-dept-table.data-table td.setup-dept-people { padding-top: 14px; }
}
/* Selects: the approved compact select (.form-group-sm on the table, docs/ui-elements.md § Selects) */
.setup-dept-table select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.setup-dept-table .setup-dept-place { margin-top: var(--space-1); }
.setup-dept-table .setup-dept-place:empty { display: none; }
/* Settings › Department mapping: the same "On the map" hint under the choice */
.mapping-map-place { margin-top: var(--space-1); }
.mapping-map-place:empty { display: none; }
.setup-dept-table td { overflow-wrap: anywhere; }
/* The suggest form's close matches: the area, then "Use this instead" on its right */
.setup-suggest-close .card-callout { margin-bottom: var(--space-4); }
.setup-suggest-close-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-top: var(--space-2); }
.setup-suggest-close-row .btn { flex-shrink: 0; white-space: nowrap; }
/* Phone: each department a block (name and people; then the standard
   department; then the division), the Setup › Targets pattern, instead of a
   four-column table whose headers overlapped and whose counts wrapped a digit
   a line at 390px. The mapping window's table does the same. */
@media (max-width: 640px) {
    .setup-dept-table, .setup-dept-table tbody,
    .mapping-wizard-table, .mapping-wizard-table tbody { display: block; table-layout: auto; }
    .setup-dept-table thead, .mapping-wizard-table thead { display: none; }
    .setup-dept-table tr, .mapping-wizard-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.4rem 0.75rem; padding: 0.7rem 0; border-bottom: 1px solid var(--gray-100); }
    .setup-dept-table.data-table td, .mapping-wizard-table.data-table td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: normal; }
    .setup-dept-table td.setup-dept-name, .mapping-wizard-table td.mapping-dept-name { font-weight: 600; }
    .setup-dept-table td.setup-dept-people { text-align: right; }
    .setup-dept-table td.setup-dept-choice,
    .mapping-wizard-table td.mapping-template-cell, .mapping-wizard-table td.mapping-division-cell { grid-column: 1 / -1; }
    .mapping-wizard-table td.mapping-category-cell { grid-column: 1 / -1; font-size: var(--text-sm); color: var(--gray-600); }
    .mapping-wizard-table td.mapping-confidence-cell { grid-column: 2; grid-row: 1; justify-self: end; }
    .setup-dept-table td[data-label]::before,
    .mapping-wizard-table td[data-label]:not(.mapping-confidence-cell)::before { content: attr(data-label); display: block; font-size: var(--text-xs); color: var(--gray-500); margin-bottom: 0.15rem; }
    .setup-dept-table td.setup-dept-people::before { display: inline; margin-right: 0.35rem; }
    .mapping-wizard-table select, .setup-dept-table select { width: 100%; }
}
body.on-setup-view #setup-fab { display: none !important; }

/* System Settings › Functional area suggestions (functional-areas-views.js) */
#functional-area-requests-list { margin-top: var(--space-4); }
/* Superuser hotel modal: departments are matched in Setup (one line and its button) */
.hotel-dept-setup { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.hotel-dept-setup .form-hint { margin: 0; }
.ticket-detail-review:not(:empty) { margin-bottom: var(--space-4); }
.fa-table td { vertical-align: top; }
.fa-table .fa-muted { color: var(--gray-500); font-size: var(--text-sm); margin-top: 0.15rem; }
.fa-table span.fa-muted { margin-top: 0; }
.fa-table td.fa-actions { width: 8.5rem; }
.fa-actions-stack { display: grid; gap: var(--space-1); justify-items: stretch; }
@media (max-width: 640px) {
    .fa-table, .fa-table tbody { display: block; }
    .fa-table thead { display: none; }
    .fa-table tr { display: grid; gap: 0.5rem; padding: 0.75rem 0; border-bottom: 1px solid var(--gray-100); }
    .fa-table.data-table td, .fa-table.data-table td:first-child, .fa-table.data-table td:last-child { display: block; padding: 0; border: 0; }
    .fa-table td[data-label]::before { content: attr(data-label); display: block; font-size: var(--text-xs); color: var(--gray-500); margin-bottom: 0.15rem; }
    .fa-table td.fa-actions { width: auto; }
    .fa-actions-stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ═══ Setup list and optional step pages (onboarding Phase 4) ═══
   The drawer keeps the approved .setup-panel-* rows; a row that opens a step
   is a real <button>, a row that only states something is .setup-panel-task-static. */
button.setup-panel-task { width: 100%; border: 0; font: inherit; color: inherit; text-align: left; }
button.setup-panel-task:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.setup-panel-task-static { cursor: default; }
.setup-panel-task-static:hover { background: var(--gray-50) !important; }
.setup-panel-task-content > span { display: block; }
.setup-panel-task-desc a { color: var(--primary-color); }
.setup-page-back { margin: 0 0 0.75rem; font-size: var(--text-sm); }
.setup-page-back a { color: var(--primary-color); text-decoration: none; }
.setup-page-back a:hover { text-decoration: underline; }
.setup-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 1rem; }
@media (max-width: 640px) { .setup-grid4 { grid-template-columns: 1fr 1fr; } }
.setup-subhead { margin: 1.25rem 0 0.25rem; font-size: var(--text-base); }
.setup-plain-list { margin: 0.25rem 0 0; padding-left: 1.1rem; }
/* Inputs in the Targets and Salary bands tables: the approved compact control
   (.form-group-sm on the table, as Departments), sized to their cell. */
.setup-targets-table input,
.setup-bands-table input { width: 100%; min-width: 0; font-variant-numeric: tabular-nums; }
.setup-panel-task-static.complete .setup-panel-task-title { text-decoration: none; }

/* Setup prompts in Insights (onboarding Phase 4b). The wall is the approved
   .soc-v4-setup-wall (its scope now also covers People drill-ins); it sits
   under the headline in place of the evidence. The banner is the approved
   .card-callout-compact. */
.setup-prompt-wall { margin-top: 1rem; }
.l2-content > .setup-prompt-banner { margin: 0.75rem 0; }
.setup-default-marker { margin-left: 0.35rem; vertical-align: middle; text-transform: none; letter-spacing: 0; }
/* .card-callout-compact — approved 2026-10-11 (docs/ui-elements.md): the
   callout on one line, its actions on the right. */
.card-callout.card-callout-compact { display: flex; gap: 0.75rem; align-items: center; padding: 0.55rem 0.85rem; margin: 0.75rem 0; }
.card-callout-compact .card-callout-text { flex: 1; line-height: 1.45; }
.card-callout-compact .card-callout-actions { display: flex; gap: 0.4rem; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.card-callout-compact .card-callout-more { display: block; margin-top: 0.15rem; font-size: var(--text-xs); opacity: 0.85; }
@media (max-width: 640px) { .card-callout.card-callout-compact { flex-direction: column; align-items: stretch; } }

/* Targets editor (onboarding Phase 5, D6): the Targets step and Settings › Insight thresholds. */
.setup-targets-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.setup-targets-table { width: 100%; table-layout: fixed; margin-bottom: 0.5rem; }
.setup-targets-table th:nth-child(1) { width: 28%; }
.setup-targets-table th:nth-child(2), .setup-targets-table th:nth-child(3) { width: 22%; }
.setup-targets-table th:nth-child(4) { width: 16%; }
.setup-target-dir { display: block; font-size: var(--text-xs); color: var(--gray-500); }
/* "up to [ 12 ] %": the input takes what the cell leaves, never overflows it. */
.setup-target-field { display: flex; align-items: center; gap: 0.3rem; font-size: var(--text-xs); color: var(--gray-500); white-space: nowrap; min-width: 0; }
.setup-target-field input { flex: 1 1 auto; width: auto; min-width: 2.5rem; }
.setup-target-default { font-size: var(--text-xs); color: var(--gray-500); }
.setup-targets-table .badge { text-transform: none; letter-spacing: 0; }
.setup-target-error { display: block; margin-top: 0.25rem; }
.setup-target-error[hidden] { display: none; }
/* Phone: each target a block (name; green and amber side by side; default and
   source), instead of a five-column table that overlapped and clipped at 375px. */
@media (max-width: 640px) {
    .setup-targets-table, .setup-targets-table tbody { display: block; }
    .setup-targets-table thead { display: none; }
    .setup-targets-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.35rem 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--gray-100); }
    .setup-targets-table.data-table td { display: block; padding: 0; border: 0; min-width: 0; }
    .setup-targets-table .setup-target-field { min-width: 0; }
    .setup-targets-table .setup-target-field input { width: 100%; min-width: 0; }
    .setup-targets-table td.setup-target-name { grid-column: 1 / -1; }
    .setup-targets-table td[data-label]::before { content: attr(data-label); display: block; font-size: var(--text-xs); color: var(--gray-500); margin-bottom: 0.15rem; }
    .setup-targets-table td.setup-target-default { align-self: end; }
    .setup-targets-table td.setup-target-source { align-self: end; }
}
.setup-targets-legend { margin: 0 0 0.75rem; font-size: var(--text-sm); color: var(--gray-500); line-height: 1.5; }
.setup-target-unit { color: var(--gray-500); }
/* The defaults in force, under "How this is measured" (onboarding Phase 5). */
.setup-default-note { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0.5rem 0 0.75rem; font-size: var(--text-xs); color: var(--gray-600); line-height: 1.45; }
.setup-default-note p { margin: 0 0 0.25rem; }
.setup-default-note .badge { flex: none; text-transform: none; letter-spacing: 0; }
/* Where a drill's colours come from (client/target-source-mockup.html): one
   .setup-default-note per target under the method card, a Target section first
   in the method popup, and the source badge on a popup's threshold scale. */
.drill-stacked-method { max-width: 520px; }
.drill-stacked-method:empty { display: none; }
.target-source-note { margin: 0.4rem 0; flex-direction: column; gap: 0.2rem; font-size: var(--text-sm); }   /* badge above its list: the method card sits in a narrow rail; prose at 12px, not the chart-label 10px */
.target-source-list { margin: 0; padding: 0; list-style: none; }
.target-source-list li { margin: 0 0 0.15rem; }
.target-source-list strong { font-weight: 600; color: var(--gray-700); }
.target-source-note:last-of-type { margin-bottom: 0.75rem; }
.target-source-table { width: 100%; margin: 0 0 0.5rem; }
.target-source-table td { vertical-align: top; }
.target-source-section { margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--gray-100); }
.target-source-section .badge,
.threshold-scale-header .badge { text-transform: none; letter-spacing: 0; }
.target-source-section p { margin: 0.4rem 0 0; }
/* The pre-data empty state's one action (onboarding Phase 5, U7). */
.analysis-empty-action { display: block; margin-top: 0.75rem; }
.analysis-empty-sub { color: var(--gray-500); font-size: var(--text-sm); }

/* ════════════════════════════════════════════════════════════════════
 * Home › Map — the department board (docs/department-map-plan.md §5;
 * approved elements: docs/ui-elements.md § Department map). Tokens only:
 * every colour below is a --dmap-* alias of an existing token (spec §5.2).
 * ════════════════════════════════════════════════════════════════════ */
:root {
    --dmap-lane-foh: var(--white);
    --dmap-lane-boh: var(--gray-50);
    --dmap-lane-support: var(--gray-100);
    --dmap-col-lit: var(--brand-indigo-50);
    --dmap-tint-red: var(--brand-red-50);
    --dmap-tint-red-border: var(--brand-red-100);
    --dmap-rule: var(--gray-300);
    --dmap-rule-visibility: var(--gray-400);
    --dmap-link: var(--gray-300);
    --dmap-link-hot: var(--gray-700);
    --dmap-flow-dot: var(--gray-900);
    --dmap-halo: var(--brand-indigo-100);
    --dmap-here-ring: var(--brand-teal-100);
}

.dmap-head { margin-bottom: var(--space-3); }
.dmap-title { font-size: var(--text-lg); font-weight: 700; color: var(--gray-900); margin: 0; }
.dmap-sub { margin: var(--space-1) 0 0; font-size: var(--text-sm); color: var(--gray-600); }
.dmap .setup-prompt-banner { margin-bottom: var(--space-3); }

/* Status pips (✓ ! × –): the board's one status icon set */
.dmap-pip { width: 14px; height: 14px; flex: none; vertical-align: -2px; }
.dmap-pip g { stroke: var(--white); }
.dmap-pip--green circle { fill: var(--brand-green-500); }
.dmap-pip--amber circle { fill: var(--brand-amber-500); }
.dmap-pip--red circle { fill: var(--brand-red-500); }
.dmap-pip--gray circle { fill: var(--gray-400); }
.dmap-pip--teal circle { fill: var(--brand-teal-500); }

/* Tally chips: counts, not controls */
.dmap-tally { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.dmap-tally-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--radius-full);
    background: var(--white); border: 1px solid var(--gray-200); font-size: var(--text-sm); color: var(--gray-700); cursor: default; }
.dmap-tally-chip b { color: var(--gray-900); }

/* The board: a grid of the moments, three lanes and the Support band */
.dmap-scroll { overflow-x: auto; padding-bottom: 4px; }
.dmap-board { position: relative; display: grid; grid-template-columns: 156px repeat(var(--dmap-cols, 6), minmax(176px, 1fr));
    min-width: calc(156px + var(--dmap-cols, 6) * 176px); background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.dmap-corner { display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--gray-200); }
.dmap-corner span { font-size: var(--text-sm); font-weight: 700; color: var(--gray-800); }
.dmap-corner small, .dmap-lane-label small { font-size: var(--text-sm); font-weight: 500; color: var(--gray-500); line-height: 1.3; }
.dmap-corner .dmap-walk { align-self: flex-start; margin-top: var(--space-2); }
.dmap-walk { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: var(--radius-full); }
.dmap-walk svg { width: 11px; height: 11px; }
/* The stops: buttons that focus their moment (spec §5.3) */
.dmap-stop { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: var(--space-4) var(--space-2) var(--space-3);
    font: inherit; color: inherit; cursor: pointer; background: var(--white); border: 0;
    border-left: 1px solid var(--gray-100); border-bottom: 1px solid var(--gray-200); transition: background .2s; }
.dmap-stop:hover { background: var(--gray-50); }
.dmap-stop:focus-visible { outline: 2px solid var(--brand-indigo-300); outline-offset: -2px; }
.dmap-stop.is-active { background: var(--dmap-col-lit); box-shadow: inset 0 -3px 0 var(--brand-indigo-400); }
.dmap-stop.is-active .dmap-stop-name { color: var(--primary); }
.dmap-stop-dot { position: relative; z-index: 2; width: 40px; height: 40px; border-radius: 50%; background: var(--white); border: 3px solid var(--gray-300);
    display: flex; align-items: center; justify-content: center; margin-bottom: var(--space-1); transition: transform .25s, box-shadow .25s; }
.dmap-stop:hover .dmap-stop-dot { transform: scale(1.07); }
.dmap-stop.is-active .dmap-stop-dot { transform: scale(1.15); box-shadow: 0 0 0 5px var(--dmap-halo); }
.dmap-stop-dot > svg:not(.dmap-pip) { width: 18px; height: 18px; color: var(--gray-600); }
.dmap-stop-pip { position: absolute; right: -6px; top: -5px; width: 16px; height: 16px; }
.dmap-st-green .dmap-stop-dot { border-color: var(--brand-green-500); }
.dmap-st-amber .dmap-stop-dot { border-color: var(--brand-amber-500); }
.dmap-st-red .dmap-stop-dot { border-color: var(--brand-red-500); background: var(--dmap-tint-red); }
.dmap-stop-name { font-size: var(--text-body); font-weight: 700; color: var(--gray-900); }
.dmap-guest { font-size: var(--text-sm); color: var(--gray-600); line-height: 1.35; }
.dmap-stop-meta { font-size: var(--text-sm); color: var(--gray-500); }
.dmap-rule { grid-column: 1 / -1; position: relative; z-index: 2; height: 0; border-top: 1.5px dashed var(--dmap-rule); }
.dmap-rule--visibility { border-top: 2px solid var(--dmap-rule-visibility); }
.dmap-rule span { position: absolute; right: var(--space-3); top: -9px; padding: 0 6px; border-radius: var(--radius-sm); background: var(--white);
    font-size: var(--text-xs); font-weight: 600; color: var(--gray-500); }
.dmap-rule--visibility span { color: var(--gray-700); }
.dmap-lane-label { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm); font-weight: 700; color: var(--gray-800); }
.dmap-cell { display: flex; flex-direction: column; gap: var(--space-2); min-height: 66px; padding: var(--space-3); border-left: 1px solid var(--gray-100); transition: background .2s; }
.dmap-cell--foh { background: var(--dmap-lane-foh); }
.dmap-cell--boh, .dmap-lane-label--boh { background: var(--dmap-lane-boh); }
.dmap-cell.is-lit { background: var(--dmap-col-lit); }
.dmap-lane-label--foh { background: var(--dmap-lane-foh); }
.dmap-lane-label--support { background: var(--dmap-lane-support); }
.dmap-support { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3); background: var(--dmap-lane-support); }
.dmap-support .card-l3-mgr-card.dmap-card { width: 200px; }
.dmap-band-sep { width: 1px; align-self: stretch; background: var(--gray-300); margin: 0 6px; }
.dmap-band-note { font-size: var(--text-sm); font-weight: 600; color: var(--gray-500); }
.dmap-empty { font-size: var(--text-sm); color: var(--gray-400); padding: 6px 2px; }

/* The department card: a variant of the approved item card */
.card-l3-mgr-card.dmap-card { display: grid; grid-template-columns: 14px 1fr auto; column-gap: 8px; row-gap: 2px; align-items: start;
    width: 100%; min-height: 0; padding: 8px 10px; text-align: left; font: inherit; color: inherit;
    background: var(--white); border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); }
.card-l3-mgr-card.dmap-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); background: var(--white); }
.card-l3-mgr-card.dmap-card:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--brand-indigo-300), var(--shadow-md); }
.card-l3-mgr-card.dmap-card.is-selected { box-shadow: 0 0 0 2px var(--brand-indigo-400), var(--shadow-md); }
.card-l3-mgr-card.dmap-card--red { background: var(--dmap-tint-red); border-color: var(--dmap-tint-red-border); }
.card-l3-mgr-card.dmap-card--gray { background: var(--gray-50); }
.card-l3-mgr-card.dmap-card--unmatched { background: var(--gray-50); border: 1px dashed var(--gray-400); box-shadow: none; }
/* A focused moment lights its departments and their suppliers; the rest fade */
.dmap-board .card-l3-mgr-card.dmap-card { transition: opacity .25s, transform .15s, box-shadow .15s; }
.dmap-board.is-focusing .card-l3-mgr-card.dmap-card:not(.is-lit) { opacity: .45; } /* 45%: 30% left the faded names unreadable */

/* Supply lines (desktop): under the cards, hidden at rest, drawn for a focused
   moment or a hovered / keyboard-focused department; one dark dot travels each (D16) */
.dmap-board .card-l3-mgr-card.dmap-card { position: relative; z-index: 2; }
.dmap-links { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible; }
.dmap-links marker path { fill: var(--dmap-link-hot); }
.dmap-link { fill: none; stroke: var(--dmap-link); stroke-width: 1.5; opacity: 0; transition: opacity .2s, stroke .2s; }
.dmap-link.is-hot { opacity: 1; stroke: var(--dmap-link-hot); stroke-width: 2; }
.dmap-link-dot { fill: var(--dmap-flow-dot); stroke: var(--white); stroke-width: 1.5; opacity: 0; transition: opacity .2s; }
.dmap-link-dot.is-hot { opacity: 1; }
.dmap-legend-supplies line { stroke: var(--dmap-link-hot); stroke-width: 2; }
.dmap-legend-supplies path { fill: var(--dmap-link-hot); }
/* Challenges (step 8): the chip on cards and stops, the flag, the drawer's card */
.badge.dmap-ch-chip { height: 18px; padding: 0 6px; font-size: var(--text-xs); font-weight: 700; text-transform: none; border: 1px solid var(--dmap-tint-red-border); }
.dmap-stop-meta { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.dmap-board--rows .dmap-stop-meta { justify-content: flex-start; }
.dmap-flag { width: 13px; height: 13px; flex: none; }
.dmap-flag line { stroke: var(--gray-500); stroke-width: 1.4; stroke-linecap: round; }
.dmap-flag path { fill: var(--brand-red-500); }
.card-callout.dmap-challenge-card { margin-top: var(--space-3); padding: 12px 14px; border: 1px solid var(--dmap-tint-red-border); border-left: 3px solid var(--brand-red-500);
    background: var(--dmap-tint-red); border-radius: 0 var(--radius) var(--radius) 0; }
.dmap-challenge-eyebrow { display: flex; align-items: center; gap: 6px; font-size: var(--text-sm); font-weight: 600; color: var(--brand-red-700); }
.dmap-challenge-title { margin-top: 4px; font-size: var(--text-body); font-weight: 600; color: var(--gray-900); }
.dmap-challenge-detail { margin-top: 3px; font-size: var(--text-body); color: var(--gray-600); }
.dmap-challenge-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: 10px; }
.dmap-challenge-card .trend-tag { font-size: var(--text-sm); color: var(--gray-700); background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-full); padding: 2px 9px; }

/* A drill-in filtered to one department (§5.6): the approved segmented control under the title */
.drill-unit-filter { display: flex; margin: 2px 0 var(--space-3); }
.drill-unit-filter .filter-pill { white-space: nowrap; }
.drill-unit-suppressed { margin-top: var(--space-4); }

/* Layers (step 10): the card's figure, the Headcount bar, the switch, the walk's spoken line */
.dmap-card-fig { grid-column: 3; grid-row: 1; font-size: var(--text-body); font-weight: 700; color: var(--gray-900); font-variant-numeric: tabular-nums; }
.dmap-card-fig--green { color: var(--brand-green-700); }
.dmap-card-fig--amber { color: var(--brand-amber-700); }
.dmap-card-fig--red { color: var(--brand-red-700); }
.dmap-card-bar { grid-column: 2 / -1; display: block; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--gray-100); overflow: hidden; }
.dmap-card-bar i { display: block; height: 100%; border-radius: 2px; background: var(--brand-teal-500); }
.dmap-tools { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }
.dmap-tools-label { font-size: var(--text-sm); color: var(--gray-500); }
.dmap-live { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 639px) {
    .dmap-tools .filter-pill-group { flex: 1; }
    .dmap-tools .filter-pill { flex: 1; min-height: 44px; }
}

/* A measure red in every department: stated once above the board */
.card-callout.dmap-hotelwide { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.card-callout.dmap-hotelwide > span { flex: 1; min-width: 200px; }
.card-callout.dmap-hotelwide .dmap-pip { flex: none; }

/* The phone has no lines: a lit supplier says whom it supplies */
.dmap-card-supplies { grid-column: 2 / -1; font-size: var(--text-xs); font-weight: 600; color: var(--brand-teal-600); }

/* The track: one line through the stops, teal to the focused one, the guest beside it */
.dmap-track { position: absolute; z-index: 1; left: 0; top: 0; width: 0; height: 3px; border-radius: 2px; background: var(--gray-200); pointer-events: none; }
.dmap-track i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: var(--brand-teal-500); transition: width .6s cubic-bezier(.4, 0, .2, 1); }
.dmap-track--rail { width: 3px; height: 0; }
.dmap-track--rail i { right: 0; bottom: auto; width: auto; height: 0; transition: height .6s cubic-bezier(.4, 0, .2, 1); }
.dmap-track-guest { position: absolute; z-index: 3; left: 0; top: 0; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%;
    background: var(--brand-teal-500); border: 2px solid var(--white); box-shadow: var(--shadow-md); opacity: 0; pointer-events: none;
    display: flex; align-items: center; justify-content: center; transition: left .6s cubic-bezier(.4, 0, .2, 1), top .6s cubic-bezier(.4, 0, .2, 1), opacity .3s; }
.dmap-track-guest svg { width: 12px; height: 12px; fill: var(--white); }
.dmap-track-guest.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
    .dmap-track i, .dmap-track-guest, .dmap-stop-dot, .dmap-cell, .dmap-stop, .dmap-mrow, .dmap-board .card-l3-mgr-card.dmap-card { transition: none; }
    .dmap-stop:hover .dmap-stop-dot, .dmap-stop.is-active .dmap-stop-dot, .dmap-mrow.is-lit .dmap-stop-dot { transform: none; }
    .card-l3-mgr-card.dmap-card:hover { transform: none; }
    .dmap-walk, .dmap-link-dot { display: none; }
    .dmap-link { transition: none; }
}
.dmap-card-pip { grid-row: 1 / span 2; margin-top: 2px; }
.dmap-card-name { font-size: var(--text-body); font-weight: 600; color: var(--gray-900); line-height: 1.3; text-wrap: balance; overflow-wrap: break-word; min-width: 0; }
.dmap-card-sub { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; font-size: var(--text-sm); color: var(--gray-500); }
.dmap-card-sub-text { white-space: nowrap; }

.dmap-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-top: var(--space-3); font-size: var(--text-sm); color: var(--gray-600); }
.dmap-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dmap-legend-line::before { content: ''; display: inline-block; width: 28px; height: 0; border-top: 2px solid var(--dmap-rule-visibility); }

/* The phone's shape (below 640px, D15): one row per moment, the track a rail */
.dmap-board--rows { display: block; min-width: 0; }
.dmap-lanes-head, .dmap-mrow { display: grid; grid-template-columns: 40px 1fr 2px 1fr; }
.dmap-lanes-head { position: sticky; top: 0; z-index: 3; background: var(--white); border-bottom: 1px solid var(--gray-200); }
.dmap-lanes-head > div { padding: 7px 8px; font-size: var(--text-xs); font-weight: 700; color: var(--gray-600); line-height: 1.25; }
.dmap-lanes-head small { display: block; font-weight: 500; color: var(--gray-500); }
.dmap-lanes-head .dmap-vis { padding: 0; background: var(--dmap-rule-visibility); }
.dmap-board-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: 10px 12px; border-bottom: 1px solid var(--gray-200); }
.dmap-board-head > span { font-size: var(--text-sm); font-weight: 700; color: var(--gray-800); }
.dmap-board-head .dmap-walk { min-height: 44px; } /* the phone: every touch target 44px or more (D15) */
.dmap-mrow { border-bottom: 1px solid var(--gray-200); transition: background .2s; }
.dmap-mrow.is-lit { background: var(--dmap-col-lit); }
.dmap-mrow.is-lit .dmap-cell--boh { background: transparent; }
.dmap-rail { position: relative; grid-row: 1 / span 2; display: flex; justify-content: center; padding-top: var(--space-3); cursor: pointer; }
.dmap-board--rows .dmap-stop-dot { width: 32px; height: 32px; }
.dmap-board--rows .dmap-stop-dot > svg:not(.dmap-pip) { width: 15px; height: 15px; }
.dmap-mrow.is-lit .dmap-stop-dot { transform: scale(1.12); box-shadow: 0 0 0 4px var(--dmap-halo); }
.dmap-mrow.is-here .dmap-stop-dot { box-shadow: 0 0 0 4px var(--dmap-here-ring); }
.dmap-board--rows .dmap-stop { grid-column: 2 / -1; align-items: flex-start; text-align: left; gap: 2px; min-height: 44px;
    padding: var(--space-3) var(--space-2) var(--space-2); border: 0; background: transparent; box-shadow: none; }
.dmap-board--rows .dmap-stop:hover { background: transparent; }
.dmap-board--rows .dmap-cell { min-height: 0; padding: 0 6px var(--space-3); border: 0; }
.dmap-board--rows .dmap-cell--foh { grid-column: 2; }
.dmap-board--rows .dmap-cell--boh { grid-column: 4; }
.dmap-vis-line { grid-column: 3; grid-row: 2; background: var(--dmap-rule-visibility); }
.dmap-board--rows .card-l3-mgr-card.dmap-card { min-height: 44px; padding: 7px; }
.dmap-board--rows .dmap-card-name { font-size: var(--text-sm); }
.dmap-board--rows .dmap-support { display: block; padding: var(--space-3); }
.dmap-support-title { margin: 0 0 var(--space-2); font-size: var(--text-sm); color: var(--gray-800); }
.dmap-support-title small { font-weight: 500; color: var(--gray-500); }
.dmap-support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dmap-support-grid.dmap-unmatched { margin-top: var(--space-3); }
.dmap-support-grid .dmap-band-note { grid-column: 1 / -1; }
.dmap-board--rows .dmap-support .card-l3-mgr-card.dmap-card { width: 100%; }

/* The drawer: the Insights drawer with Home › Map's stepper and footer */
.drawer-stepper { display: flex; align-items: center; gap: 4px; margin-left: auto; font-size: var(--text-sm); color: var(--gray-500); white-space: nowrap; }
.drawer-stepper[hidden] { display: none; }
.drawer-stepper-btn { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.drawer-footer[hidden] { display: none; }
#insights-drawer-eyebrow .dmap-pip { margin-right: 4px; }
.dmap-drawer-section { margin: var(--space-4) 0 var(--space-2); font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--gray-700); }
.dmap-drawer-section small { font-weight: 400; color: var(--gray-500); }
.dmap-drawer .l1-strip { margin-top: var(--space-4); }
.dmap-stated { font-size: var(--text-xs); color: var(--gray-400); font-weight: 400; }
.dmap-drawer-table td:first-child { width: 22px; }
.dmap-members { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--gray-500); }
.dmap-attn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.dmap-attn .card-l3-mgr-card { background: var(--white); align-items: flex-start; }
.dmap-attn-link { font-size: var(--text-sm); font-weight: 600; color: var(--primary); text-decoration: none; }
.dmap-gap { margin-top: var(--space-4); }
.dmap-unmatched-list { margin: var(--space-3) 0 0; padding-left: 18px; font-size: var(--text-sm); color: var(--gray-700); }
/* Supplied by / Supplies: the related departments, each opening its own drawer */
.dmap-flow { margin-top: var(--space-4); }
.dmap-flowrow { display: flex; gap: var(--space-2); align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--gray-100); font-size: var(--text-body); }
.dmap-flowrow-k { flex: none; width: 92px; color: var(--gray-500); }
.dmap-flowrow-v { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.dmap-flowrow-link { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--primary); cursor: pointer; text-align: left; }
.dmap-flowrow-link:hover { text-decoration: underline; }
.dmap-flowrow-link:focus-visible { outline: 2px solid var(--brand-indigo-300); outline-offset: 2px; border-radius: var(--radius-sm); }
.dmap-spark-svg { display: block; width: 100%; height: 64px; }
.dmap-spark-line { fill: none; stroke: var(--brand-teal-500); stroke-width: 2; }
.dmap-spark-dot { fill: var(--brand-teal-500); }
.dmap-spark-axis { font-size: var(--text-xs); fill: var(--gray-400); }

/* Below 640px the drawer is a full-screen sheet that swipes down (D15) */
@media (max-width: 639px) {
    #insights-drawer.drawer-sheet { inset: 0; width: auto; max-width: none; height: auto; transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
    #insights-drawer.drawer-sheet.open { transform: translateY(0); }
    #insights-drawer.drawer-sheet .drawer-header { touch-action: none; cursor: grab; padding-top: 18px; position: relative; }
    #insights-drawer.drawer-sheet .drawer-header::before { content: ''; position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--gray-300); }
    #insights-drawer.drawer-sheet .drawer-stepper-btn, #insights-drawer.drawer-sheet .drawer-close { min-width: 40px; min-height: 40px; }
    #insights-drawer.drawer-sheet .drawer-footer .btn { min-height: 44px; }
    #insights-drawer.drawer-sheet .dmap-flowrow-link, #insights-drawer.drawer-sheet .dmap-challenge-foot .dmap-attn-link { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
    #insights-drawer.drawer-sheet { transition: none; }
}
