/* SPDX-FileCopyrightText: © 2026 Aspen Bravo, LLC <https://aspenbravo.com> */
/* SPDX-License-Identifier: LicenseRef-Proprietary */

/*
 * Aspen Bravo ATS — component styles for modal, toast, empty-state,
 * loading-spinner, error-message, form, table, chip, and pagination
 * surfaces. The dark glassmorphic shell (`mountain-bg`, `glass-panel`,
 * `glass-card`, `neon-bar`, `popover-menu`, `popover-item`,
 * `bar-chart-container`, `grid-line`, `hide-scrollbar`, `pb-safe`,
 * `search-input`, `glow-text`) lives in the Stitch inline `<style>`
 * block in `apps/ats/frontend/index.html` and is the source of truth
 * for those surfaces. See openspec/changes/ats-adopt-stitch-prototype.
 *
 * Tailwind CDN is loaded under a documented, time-boxed framework
 * exception scoped to `apps/ats/frontend` only. The follow-up change
 * `ats-remove-tailwind` translates the Tailwind utilities back to
 * named vanilla CSS classes backed by the design tokens below.
 *
 * Z-index scale (Decision 6):
 *   - mountain background: -2 / -1
 *   - base content / widgets: 0–10
 *   - bottom nav (mobile): 60
 *   - top nav (sticky): 100
 *   - nav-card popover: 1000
 *   - new menu popover: 1000
 *   - account menu popover: 1000
 *   - modal backdrop: 1099
 *   - modal level 1: 1100
 *   - modal level 2 (nested): 1200
 *   - toast: 2000
 */

:root {
  /* Brand colors */
  --peak-orange: #ef8429;
  --peak-orange-700: #c45f1b;
  --peak-orange-tint: rgba(239, 132, 41, 0.15);
  --summit-navy: #001b44;
  --summit-navy-700: #002766;
  --forest-green: #2d4c3b;
  --forest-green-tint: rgba(45, 76, 59, 0.3);
  --slate-dark: #1a1c1e;
  --snow-white: #ffffff;

  /* Background gradient (dark navy to forest) — kept as a token even
   * though the Stitch inline `<style>` block sets the body background;
   * the modal overlay and toast backgrounds still reference it. */
  --bg-gradient-start: #001f3f;
  --bg-gradient-end: #0d2c20;
  --bg-gradient: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);

  /* Glass surfaces */
  --glass-panel-bg: rgba(255, 255, 255, 0.05);
  --glass-card-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-border-strong: rgba(255, 255, 255, 0.2);
  --glass-highlight: rgba(255, 255, 255, 0.08);
  --glass-blur: blur(12px);
  --glass-blur-sm: blur(8px);

  /* Text on dark surfaces */
  --text-primary: rgba(255, 255, 255, 0.9);
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --text-placeholder: rgba(255, 255, 255, 0.4);

  /* Peak Orange glows */
  --accent-glow: rgba(239, 132, 41, 0.4);
  --accent-glow-strong: rgba(239, 132, 41, 0.6);
  --glow-text: 0 0 10px rgba(239, 132, 41, 0.7);

  /* Legacy surface ladder aliases kept for component compatibility
   * (light tokens now map to dark glass values). */
  --surface: rgba(0, 0, 0, 0.1);
  --surface-dim: rgba(0, 0, 0, 0.2);
  --surface-bright: rgba(255, 255, 255, 0.05);
  --surface-container-lowest: rgba(255, 255, 255, 0.02);
  --surface-container-low: rgba(255, 255, 255, 0.04);
  --surface-container: rgba(255, 255, 255, 0.05);
  --surface-container-high: rgba(255, 255, 255, 0.08);
  --surface-container-highest: rgba(255, 255, 255, 0.1);
  --surface-variant: rgba(255, 255, 255, 0.08);
  --inverse-surface: #eef1f3;
  --inverse-on-surface: #181c1e;

  --on-surface: var(--text-primary);
  --on-surface-variant: var(--text-secondary);
  --on-background: var(--text-primary);
  --background: var(--bg-gradient-start);

  /* Outline */
  --outline: rgba(255, 255, 255, 0.25);
  --outline-variant: rgba(255, 255, 255, 0.15);

  /* Primary (Peak Orange family) */
  --primary: var(--peak-orange);
  --primary-container: var(--peak-orange);
  --on-primary: var(--snow-white);
  --on-primary-container: var(--snow-white);
  --primary-fixed: var(--peak-orange-tint);
  --primary-fixed-dim: rgba(239, 132, 41, 0.3);
  --on-primary-fixed: var(--snow-white);
  --on-primary-fixed-variant: var(--peak-orange);
  --inverse-primary: var(--peak-orange);

  /* Secondary (cool blue family) */
  --secondary: #495e8a;
  --secondary-container: rgba(73, 94, 138, 0.3);
  --on-secondary: var(--snow-white);
  --on-secondary-container: var(--snow-white);
  --secondary-fixed: rgba(184, 204, 254, 0.2);
  --secondary-fixed-dim: rgba(184, 204, 254, 0.35);
  --on-secondary-fixed: var(--snow-white);
  --on-secondary-fixed-variant: #b8ccfe;

  /* Tertiary (Forest Green family) */
  --tertiary: var(--forest-green);
  --tertiary-container: var(--forest-green-tint);
  --on-tertiary: var(--snow-white);
  --on-tertiary-container: var(--snow-white);
  --tertiary-fixed: rgba(199, 235, 212, 0.2);
  --tertiary-fixed-dim: rgba(199, 235, 212, 0.35);
  --on-tertiary-fixed: var(--snow-white);
  --on-tertiary-fixed-variant: #c7ebd4;

  /* Error */
  --error: #ba1a1a;
  --error-container: rgba(186, 26, 26, 0.2);
  --on-error: var(--snow-white);
  --on-error-container: #ffdad6;
  --error-tint: rgba(186, 26, 26, 0.15);

  /* Status chip tints */
  --chip-new-bg: rgba(255, 255, 255, 0.1);
  --chip-new-fg: var(--text-secondary);
  --chip-active-bg: var(--peak-orange-tint);
  --chip-active-fg: var(--peak-orange);
  --chip-hired-bg: rgba(45, 76, 59, 0.4);
  --chip-hired-fg: #7dd98f;
  --chip-rejected-bg: var(--error-tint);
  --chip-rejected-fg: #ff8a84;

  /* Misc semantic */
  --success: #4ade80;
  --warning: #facc15;
  --info: #60a5fa;
  --surface-tint: var(--peak-orange);

  /* Typography */
  --font-headline: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-icons: 'Material Symbols Outlined';

  /* Type scale */
  --text-display-lg: 48px;
  --text-headline-lg: 32px;
  --text-headline-lg-mobile: 24px;
  --text-title-md: 18px;
  --text-body-lg: 16px;
  --text-body-sm: 14px;
  --text-label-caps: 12px;
  --text-table-data: 13px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  /* Legacy aliases */
  --radius-2: 2px;
  --radius-4: var(--radius-sm);
  --radius-8: var(--radius-md);
  --radius-12: var(--radius-lg);

  /* Spacing */
  --space-base: 8px;
  --space-2: 16px;
  --space-gutter: 24px;
  --space-card-padding: 24px;
  --space-container-margin: 32px;
  --space-table-cell: 12px 16px;
  /* Legacy alias */
  --space-container: var(--space-container-margin);

  /* Elevation */
  --shadow-card:
    0 4px 12px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-modal: 0 12px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 15px var(--accent-glow);
  --shadow-glow-strong: 0 0 20px var(--accent-glow-strong);

  /* Motion */
  --motion-fast: 120ms cubic-bezier(0.2, 0, 0, 1);
  --motion-base: 200ms cubic-bezier(0.2, 0, 0, 1);
  --motion-chart: 500ms ease-out;

  /* Layout */
  --header-height: 64px;
  --max-content-width: 1440px;
  --bottom-nav-height: 56px;

  /* Z-index scale — explicit, no collisions with Stitch popovers (1000). */
  --z-base: 0;
  --z-bottom-nav: 60;
  --z-top-nav: 100;
  --z-popover: 1000;
  --z-modal-backdrop: 1099;
  --z-modal-1: 1100;
  --z-modal-2: 1200;
  --z-toast: 2000;
  /* Legacy aliases kept for component CSS that still reads them. */
  --z-nav-dropdown: var(--z-popover);
  --z-menu: var(--z-popover);
}

/* --------------------------------------------------------------------------
 * Base / reset
 * ------------------------------------------------------------------------ */

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

html,
body {
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: 300;
  line-height: 1.5;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-headline);
  color: var(--snow-white);
  margin: 0 0 var(--space-base);
  font-weight: 600;
  line-height: 1.25;
}

h1 {
  font-size: var(--text-headline-lg);
  font-weight: 700;
}
h2 {
  font-size: var(--text-title-md);
  font-weight: 700;
}
h3 {
  font-size: 1.125rem;
}
h4 {
  font-size: 1rem;
}

p {
  margin: 0 0 var(--space-base);
}

a {
  color: var(--peak-orange);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover {
  color: var(--snow-white);
  text-shadow: var(--glow-text);
}

button {
  font-family: inherit;
  color: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--peak-orange);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
 * Skip link + screen-reader-only helper (carry-over from pre-change HTML)
 * ------------------------------------------------------------------------ */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--summit-navy);
  color: var(--snow-white);
  padding: var(--space-base) var(--space-2);
  z-index: var(--z-toast);
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  left: var(--space-base);
  top: var(--space-base);
}

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

/* --------------------------------------------------------------------------
 * Helper classes — kept because the modal / glue CSS references them.
 * ------------------------------------------------------------------------ */

.label-caps {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: var(--text-label-caps);
  font-weight: 500;
  color: var(--text-secondary);
}

/* Material Symbols Outlined base — the Stitch HTML uses
 * `.material-symbols-outlined` directly; declare it here so the icon
 * font renders even where Tailwind does not apply. */
.material-symbols-outlined {
  font-family: var(--font-icons);
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'liga';
  vertical-align: middle;
  user-select: none;
}

.glow-text {
  text-shadow: var(--glow-text);
}

.text-peak-orange {
  color: var(--peak-orange);
}

.text-forest-green {
  color: var(--forest-green);
}

.font-title-md {
  font-family: var(--font-headline);
  font-size: var(--text-title-md);
  font-weight: 700;
  line-height: 1.333;
}

.font-label-caps {
  font-family: var(--font-headline);
  font-size: var(--text-label-caps);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.333;
}

/* --------------------------------------------------------------------------
 * Buttons (modal / form components)
 * ------------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px var(--space-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--surface-container);
  color: var(--text-primary);
  transition:
    background var(--motion-fast),
    border-color var(--motion-fast),
    color var(--motion-fast),
    box-shadow var(--motion-fast);
}
.btn:hover {
  background: var(--surface-container-high);
  border-color: var(--peak-orange);
  box-shadow: var(--shadow-glow);
}

.btn--primary {
  background: var(--peak-orange);
  color: var(--snow-white);
  border-color: var(--peak-orange);
}
.btn--primary:hover {
  background: var(--peak-orange-700);
  border-color: var(--peak-orange-700);
  box-shadow: var(--shadow-glow-strong);
}

.btn--secondary {
  background: transparent;
  color: var(--snow-white);
  border-color: rgba(255, 255, 255, 0.3);
}
.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--peak-orange);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-primary);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--peak-orange);
}

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

.btn--sm {
  padding: 4px 10px;
  font-size: 0.8125rem;
}
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
 * Inputs (form modals)
 * ------------------------------------------------------------------------ */

.input,
select.input,
textarea.input {
  display: block;
  width: 100%;
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--outline);
  border-radius: var(--radius-sm);
  transition:
    border-color var(--motion-fast),
    box-shadow var(--motion-fast),
    background var(--motion-fast);
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.5)' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
select.input option,
select.input optgroup {
  background: var(--summit-navy);
  color: var(--text-primary);
}

input[type='file'].input {
  padding: 6px 10px;
}

textarea.input {
  resize: vertical;
  min-height: 96px;
}

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

.input:focus {
  outline: none;
  border-color: var(--peak-orange);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(0, 0, 0, 0.3);
}

.input--error {
  border-color: var(--error);
}
.input--error:focus {
  box-shadow: 0 0 0 3px var(--error-tint);
}

/* --------------------------------------------------------------------------
 * Popover filter input (Markets nav-card). Sticky at the top of the
 * popover, transparent to match the dark glass, padding aligned with
 * `.popover-item` left padding (16px). Stops click/mousedown
 * propagation so the nav-card toggle handler does not close the
 * popover when the user clicks into the input.
 * ------------------------------------------------------------------------ */

.popover-menu__filter {
  padding: 10px 16px;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.input--filter-popover {
  width: 100%;
  padding: 6px 10px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--outline);
  border-radius: var(--radius-sm);
  transition:
    border-color var(--motion-fast),
    box-shadow var(--motion-fast);
}

.input--filter-popover::placeholder {
  color: var(--text-placeholder);
}

.input--filter-popover:focus {
  outline: none;
  border-color: var(--peak-orange);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-base) var(--space-2);
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.checkbox-inline input[type='checkbox'] {
  accent-color: var(--peak-orange);
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
 * Tables (modal drill-down + glue-populated tables reuse these rules)
 * ------------------------------------------------------------------------ */

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.table thead th {
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  text-align: left;
  padding: var(--space-table-cell);
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: var(--text-table-data);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--glass-border);
}

.table tbody td {
  padding: var(--space-table-cell);
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-secondary);
  vertical-align: middle;
}

.table tbody tr:nth-child(even) td {
  background: var(--surface);
}
.table tbody tr:nth-child(odd) td {
  background: transparent;
}

.table tbody tr {
  transition: background var(--motion-fast);
}

.table tbody tr:focus-visible,
.table tbody tr:focus-within {
  outline: 2px solid var(--peak-orange);
  outline-offset: -2px;
}

.table tbody tr:hover td {
  background: var(--glass-highlight);
  color: var(--text-primary);
}

.table tbody td .table-cell-strong {
  font-weight: 600;
  color: var(--snow-white);
}

.table--clickable tbody tr {
  cursor: pointer;
}

.table .th-sortable {
  cursor: pointer;
  user-select: none;
}
.table .th-sortable:hover {
  color: var(--peak-orange);
}
.table .th-sortable[aria-sort='ascending']::after {
  content: ' ▲';
  color: var(--peak-orange);
}
.table .th-sortable[aria-sort='descending']::after {
  content: ' ▼';
  color: var(--peak-orange);
}

/* --------------------------------------------------------------------------
 * Status chip
 * ------------------------------------------------------------------------ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  white-space: nowrap;
  background: var(--chip-new-bg);
  color: var(--chip-new-fg);
}
.chip--new {
  background: var(--chip-new-bg);
  color: var(--chip-new-fg);
}
.chip--active {
  background: var(--chip-active-bg);
  color: var(--chip-active-fg);
  text-shadow: 0 0 8px rgba(239, 132, 41, 0.4);
  font-weight: 600;
}
.chip--hired {
  background: var(--chip-hired-bg);
  color: var(--chip-hired-fg);
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
  font-weight: 600;
}
.chip--rejected {
  background: var(--chip-rejected-bg);
  color: var(--chip-rejected-fg);
}

/* --------------------------------------------------------------------------
 * Avatar / profile initials
 * ------------------------------------------------------------------------ */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--snow-white);
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-headline);
  text-transform: uppercase;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
 * Pagination (applicants table + modal filtered-applicants table)
 * ------------------------------------------------------------------------ */

.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-base) var(--space-card-padding);
  background: var(--glass-highlight);
  border-top: 1px solid var(--glass-border);
}
.pagination__indicator {
  margin-left: auto;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
 * Bar chart — only the legend + per-bar count/label helpers are kept
 * here. The Stitch inline `<style>` block provides `.bar-chart-container`,
 * `.bar-chart-grid`, `.grid-line`, `.neon-bar`, and `.bar-label`. The
 * glue modules reuse these and add a count overlay and a legend via
 * the helpers below.
 * ------------------------------------------------------------------------ */

.bar-chart__bar {
  position: relative;
  flex: 1 1 0;
  min-width: 36px;
  background: linear-gradient(180deg, rgba(239, 132, 41, 0.8) 0%, rgba(239, 132, 41, 0.1) 100%);
  border: 1px solid var(--peak-orange);
  box-shadow:
    0 0 15px rgba(239, 132, 41, 0.6),
    inset 0 4px 10px rgba(239, 132, 41, 0.8);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition:
    box-shadow var(--motion-fast),
    transform var(--motion-fast);
  cursor: pointer;
  min-height: 4px;
}
.bar-chart__bar:hover {
  box-shadow:
    0 0 25px rgba(239, 132, 41, 0.9),
    inset 0 4px 15px rgba(239, 132, 41, 1);
  transform: scaleY(1.02);
}
.bar-chart__bar:focus-visible {
  outline: 3px solid var(--snow-white);
  outline-offset: 2px;
}

.bar-chart__bar--green {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.8) 0%, rgba(74, 222, 128, 0.1) 100%);
  border-color: var(--success);
  box-shadow:
    0 0 15px rgba(74, 222, 128, 0.5),
    inset 0 4px 10px rgba(74, 222, 128, 0.8);
}
.bar-chart__bar--green:hover {
  box-shadow:
    0 0 25px rgba(74, 222, 128, 0.8),
    inset 0 4px 15px rgba(74, 222, 128, 1);
}

.bar-chart__bar--blue {
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.8) 0%, rgba(96, 165, 250, 0.1) 100%);
  border-color: var(--info);
  box-shadow:
    0 0 15px rgba(96, 165, 250, 0.5),
    inset 0 4px 10px rgba(96, 165, 250, 0.8);
}
.bar-chart__bar--blue:hover {
  box-shadow:
    0 0 25px rgba(96, 165, 250, 0.8),
    inset 0 4px 15px rgba(96, 165, 250, 1);
}

.bar-chart__bar--white {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.1) 100%);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow:
    0 0 15px rgba(255, 255, 255, 0.3),
    inset 0 4px 10px rgba(255, 255, 255, 0.4);
}
.bar-chart__bar--white:hover {
  box-shadow:
    0 0 25px rgba(255, 255, 255, 0.5),
    inset 0 4px 15px rgba(255, 255, 255, 0.6);
}

.bar-chart__bar-label {
  position: absolute;
  bottom: -28px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: var(--text-label-caps);
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--font-headline);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-chart__bar-count {
  position: absolute;
  top: -22px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--snow-white);
  text-shadow: var(--glow-text);
}

.bar-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-gutter);
  justify-content: center;
  margin-top: var(--space-2);
}

.bar-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-label-caps);
  color: var(--text-secondary);
  font-family: var(--font-headline);
}

.bar-chart__legend-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}
.bar-chart__legend-dot--orange {
  background: var(--peak-orange);
  box-shadow: 0 0 8px rgba(239, 132, 41, 0.8);
}
.bar-chart__legend-dot--green {
  background: var(--success);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.8);
}
.bar-chart__legend-dot--blue {
  background: var(--info);
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.8);
}
.bar-chart__legend-dot--white {
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* --------------------------------------------------------------------------
 * Modal
 * ------------------------------------------------------------------------ */

.modal-root {
  position: relative;
  z-index: var(--z-base);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-container-margin);
  overflow-y: auto;
  z-index: var(--z-modal-backdrop);
}

.modal {
  background: var(--glass-panel-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2 * var(--space-container-margin));
  position: relative;
  z-index: var(--z-modal-1);
  overflow: hidden;
}

.modal[aria-level='2'] {
  z-index: var(--z-modal-2);
}

.modal__header {
  display: flex;
  align-items: center;
  gap: var(--space-base);
  padding: var(--space-2) var(--space-card-padding);
  border-bottom: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--snow-white);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  flex-shrink: 0;
}
.modal__title {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.125rem;
  margin: 0;
  flex: 1;
  color: var(--snow-white);
}

.modal__body {
  padding: var(--space-card-padding);
  overflow-y: auto;
  color: var(--text-primary);
}
.modal__footer {
  padding: var(--space-2) var(--space-card-padding);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-base);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  flex-shrink: 0;
}

.modal[aria-level='2'] .modal__header {
  background: rgba(0, 0, 0, 0.35);
}

body.modal-open {
  overflow: hidden;
}

/* Detail grid used in applicant/job detail modals */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.detail-grid dt {
  font-size: var(--text-label-caps);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.detail-grid dd {
  margin: 0;
  color: var(--text-primary);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
 * Form
 * ------------------------------------------------------------------------ */

.form-row {
  margin-bottom: var(--space-2);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.form-row > * {
  flex: 1 1 0;
  min-width: 140px;
}
.form-field {
  margin-bottom: var(--space-2);
}
.form-error {
  color: #ff8a84;
  font-size: 0.8125rem;
  margin-top: 4px;
}
.error-list {
  color: #ff8a84;
  font-size: 0.8125rem;
  padding-left: var(--space-2);
}

/* --------------------------------------------------------------------------
 * Loading / error / empty state
 * ------------------------------------------------------------------------ */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--peak-orange);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.state-box {
  padding: var(--space-2);
  text-align: center;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: var(--space-base);
  align-items: center;
  justify-content: center;
  min-height: 96px;
}

.state-box--error {
  color: #ff8a84;
}
.state-box--error h4 {
  color: var(--error);
}
.state-box--empty {
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
 * Toasts
 * ------------------------------------------------------------------------ */

.toast-root {
  position: fixed;
  right: var(--space-container-margin);
  bottom: calc(var(--space-container-margin) + var(--bottom-nav-height));
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  background: var(--summit-navy);
  color: var(--snow-white);
  padding: 10px var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-modal);
  font-size: 0.875rem;
}
.toast--error {
  background: var(--error);
  border-color: rgba(255, 255, 255, 0.2);
}
.toast--success {
  background: var(--forest-green);
  border-color: rgba(255, 255, 255, 0.2);
}

/* --------------------------------------------------------------------------
 * Mobile toast positioning
 * ------------------------------------------------------------------------ */

@media (max-width: 767px) {
  .toast-root {
    left: var(--space-container-margin);
    right: var(--space-container-margin);
    max-width: none;
    bottom: calc(var(--bottom-nav-height) + var(--space-base));
  }

  .modal-overlay {
    padding: 0;
  }
  .modal {
    max-height: 100vh;
    border-radius: 0;
    max-width: 100%;
  }
  .modal__header {
    border-radius: 0;
  }
}

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(12px)) {
  .glass-panel,
  .glass-card {
    background: rgba(0, 27, 68, 0.92);
  }
}