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

/*
 * lib/theme.css — the canonical ERP theme for Aspen Bravo Core.
 *
 * Every abc frontend consumes this file via
 *   <link rel="stylesheet" href="lib/theme.css">
 * through the `lib -> ../../../lib` symlink. The <link> order in each
 * app's index.html is: theme → boot-veil → app overrides (so app
 * overrides win the cascade).
 *
 * This file carries:
 *   - The `:root` design-token ladder (colors, glass surfaces, text,
 *     typography, radii, spacing, motion, z-index).
 *   - Base element styles (html, body, h1-h6, p, a, button, input,
 *     :focus-visible).
 *   - The `@media screen` themed scrollbar.
 *   - Accessibility helpers (.skip-link, .sr-only).
 *   - Typographic helpers (.label-caps, .material-symbols-outlined,
 *     .glow-text, .text-*, .font-*).
 *   - The mountain background + boot-veil mountain-arrival animation
 *     (@keyframes mountain-arrive, .mountain-bg, .mountain-bg-2).
 *   - Glass surfaces (.glass-panel, .glass-card, .neon-glow).
 *   - Component classes: .btn, .input, .list-picker, .checkbox-group,
 *     .table, .chip, .pagination, .bar-chart, .popover-menu,
 *     .popover-item, .search-input, .app-bar, .search-wrap,
 *     .account-btn, .main-content, .nav-card, .widget-grid,
 *     .widget-panel, .bottom-nav, .search-field-dropdown, .modal,
 *     .detail-grid, .form-row, .form-field, .spinner, .state-box,
 *     .toast.
 *
 * The theme SHALL NOT contain app-specific selectors (element IDs,
 * app-specific class names like .applicant-name-link, .stage-chip,
 * .avatar, .picker, .chooser). App-specific overrides live in the
 * app's css/styles.css.
 *
 * 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;
}

/* --------------------------------------------------------------------------
 * Global themed scrollbar
 *
 * Applied to every scrollable surface (page scroll, .modal__body,
 * overflow-x containers, popover menus). Firefox uses `scrollbar-width`
 * + `scrollbar-color`; WebKit/Chromium uses the `::-webkit-scrollbar`
 * family. Thumb color is Peak Orange; track is dark glass. Tunable via
 * the existing color tokens.
 * ------------------------------------------------------------------------ */

@media screen {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--peak-orange) rgba(0, 0, 0, 0.2);
  }
  *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  *::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
  }
  *::-webkit-scrollbar-thumb {
    background: var(--peak-orange);
    border-radius: 5px;
  }
  *::-webkit-scrollbar-thumb:hover {
    background: var(--peak-orange-700);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: 300;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-gradient-start);
  background-image: var(--bg-gradient);
  -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);
  line-height: 1.25;
}

/* Per-tag sizes/weights. The `:is(h1)` form keeps specificity at
 * (0,0,1) but is more specific than Tailwind CDN's preflight
 * `h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit }`
 * because the preflight injects a <style> at runtime that lands AFTER
 * this stylesheet in the cascade. Using `:is()` doesn't help here;
 * instead we scope the rule under `body` to bump specificity to
 * (0,0,2) so it always wins regardless of injection order. */
body h1 {
  font-size: 32px;
  font-weight: 700;
}
body h2 {
  font-size: 24px;
  font-weight: 700;
}
body h3 {
  font-size: 20px;
  font-weight: 600;
}
body h4 {
  font-size: 18px;
  font-weight: 600;
}
body h5 {
  font-size: 16px;
  font-weight: 500;
}
body h6 {
  font-size: 14px;
  font-weight: 500;
}

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;
}

/* --------------------------------------------------------------------------
 * Shell — mountain background + boot-veil mountain-arrival animation.
 * Migrated from the Stitch inline `<style>` block in index.html by the
 * `ats-remove-tailwind` change. The keyframe name `mountain-arrive` and
 * the class names `.mountain-bg`, `.mountain-bg-2`, `.mountain-arriving`,
 * `.mountain-arrived` are preserved verbatim — they are JS contracts
 * with `lib/boot-veil.js` (`ev.animationName === 'mountain-arrive'`)
 * and `tests/unit/boot-veil.test.js`. See Design Decision 2.
 * ------------------------------------------------------------------------ */

.mountain-bg {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60vh;
  pointer-events: none;
  /* z-index 0: above the body background, below dashboard
     content (z-10+) and the boot veil (z-index 9990). */
  z-index: 0;
  /* Resting decorative opacity — barely visible after the
     boot veil drops. Dimmed from the booting brightness
     (0.35–0.60) by lib/boot-veil.js in sync with the veil
     fade. */
  opacity: 0.04;
  background:
    polygon(0% 100%, 20% 40%, 40% 80%, 60% 30%, 80% 70%, 100% 20%, 100% 100%) center/cover no-repeat;
  clip-path: polygon(0% 100%, 15% 50%, 35% 85%, 55% 35%, 75% 75%, 100% 25%, 100% 100%);
  background-color: var(--peak-orange);
  filter: blur(2px);
  transition: opacity 400ms ease-out, transform 400ms ease-out;
}

.mountain-bg-2 {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 75vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  clip-path: polygon(0% 100%, 25% 30%, 45% 65%, 70% 20%, 90% 55%, 100% 45%, 100% 100%);
  background-color: var(--forest-green);
  transition: opacity 400ms ease-out, transform 400ms ease-out;
}

/* Boot veil — mountain-arrival animation (Reading A from
 * openspec/changes/add-boot-veil/design.md, refined to a
 * looping breathe per operator feedback). While the boot
 * veil is up, the mountains loop a gentle opacity+rise
 * breathe so there is continuous motion during slow boots
 * (the one-shot rise-from-below left the mountains frozen
 * mid-arrival on slow networks). When `hideBootVeil()` runs,
 * it removes `.mountain-arriving` and the mountains dim to
 * their resting decorative opacity (0.04 / 0.03) in sync
 * with the 400ms veil fade.
 */
@keyframes mountain-arrive {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  50% { opacity: 0.60; transform: translateY(-12px); }
}
@keyframes mountain-arrive-bg-2 {
  0%, 100% { opacity: 0.22; transform: translateY(0); }
  50% { opacity: 0.40; transform: translateY(-8px); }
}
.mountain-bg.mountain-arriving {
  animation: mountain-arrive 2.4s ease-in-out infinite;
  animation-delay: 200ms;
}
.mountain-bg-2.mountain-arriving {
  animation: mountain-arrive-bg-2 2.4s ease-in-out infinite;
  animation-delay: 0ms;
}
@media (prefers-reduced-motion: reduce) {
  .mountain-bg.mountain-arriving,
  .mountain-bg-2.mountain-arriving {
    animation: none !important;
    transform: none !important;
  }
  .mountain-bg { opacity: 0.04; }
  .mountain-bg-2 { opacity: 0.03; }
}

/* --------------------------------------------------------------------------
 * Shell — glass surfaces + glow (migrated from the Stitch inline
 * `<style>` block). The `theme('colors.peak-orange')` calls in the
 * original block are translated to `var(--peak-orange)`.
 * ------------------------------------------------------------------------ */

.glass-panel {
  background: var(--glass-panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}
.glass-card {
  background: var(--glass-card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border-strong);
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
}
.glass-card:hover {
  background: var(--glass-highlight);
  border-color: rgba(239, 132, 41, 0.5);
  box-shadow: 0 0 15px rgba(239, 132, 41, 0.2);
}
.glass-card.active {
  border-color: var(--peak-orange);
  box-shadow: 0 0 20px rgba(239, 132, 41, 0.4);
  color: #fff;
}
.neon-glow {
  box-shadow: 0 0 10px var(--peak-orange), inset 0 0 5px var(--peak-orange);
  border-color: var(--peak-orange);
}

/* --------------------------------------------------------------------------
 * 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);
}

/* --------------------------------------------------------------------------
 * List picker (ASD market picker + HQ chooser) — generic scrollable
 * list of rows with title + meta + hover. Renamed from the ATS-specific
 * `.picker` / `.chooser` class families to the generic `.list-picker`
 * BEM convention.
 *
 * Mirrors the `.popover-menu` / `.popover-item` styling: vertical stack,
 * `padding: 10px 16px`, `border-bottom` between rows, hover orange-tint
 * with `padding-left` bump. The title/meta inside each row stack
 * vertically so each row reads as a single item.
 * ------------------------------------------------------------------------ */

.list-picker,
.list-picker__list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.list-picker__row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
}

.list-picker__row:last-child {
  border-bottom: none;
}

.list-picker__row:hover {
  background: var(--peak-orange-tint);
  color: #fff;
  padding-left: 20px;
}

.list-picker__title,
.list-picker__meta {
  display: block;
}

.list-picker__meta {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

/* "Open" status indicator (injected by asd-market-picker.js). */
.list-picker__meta--open {
  color: var(--peak-orange);
}

/* Container for job rows in the headquarters chooser (injected by
 * headquarters-chooser.js). */
.list-picker__jobs {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.list-picker__create-btn {
  margin-bottom: var(--space-2);
}

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 (generic severity)
 *
 * The ATS-specific chip variants (.chip--new, .chip--active,
 * .chip--hired, .chip--rejected) are renamed to generic severity
 * levels (.chip--info, .chip--success, .chip--warning,
 * .chip--danger). The ATS status → severity mapping lives in
 * apps/ats/frontend/js/constants.js (severityForStatus). The
 * .chip--selected class is for filter-chip selected state (not a
 * severity).
 * ------------------------------------------------------------------------ */

.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--info {
  background: var(--chip-new-bg);
  color: var(--chip-new-fg);
}
.chip--success {
  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--warning {
  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--danger {
  background: var(--chip-rejected-bg);
  color: var(--chip-rejected-fg);
}
.chip--selected {
  background: var(--chip-active-bg);
  color: var(--chip-active-fg);
  text-shadow: 0 0 8px rgba(239, 132, 41, 0.4);
  font-weight: 600;
}

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

.pagination__indicator {
  margin-left: auto;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.pagination__btn-group {
  display: flex;
  gap: 8px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  background: transparent;
  border-top: none;
  padding: 0;
}

/* --------------------------------------------------------------------------
 * Bar chart — container, grid, axis, bar, bar-label, legend.
 * Migrated from the Stitch inline `<style>` block; the flat Stitch
 * class names are renamed to the `glassmorphic-design-system` spec
 * canonical BEM names (`.bar-chart-container` → `.bar-chart`,
 * `.neon-bar` → `.bar-chart__bar`, `.bar-chart-grid` →
 * `.bar-chart__grid`, `.grid-line` → `.bar-chart__grid-line`,
 * `.bar-label` → `.bar-chart__bar-label`). The glue modules in
 * `js/widgets/bar-chart.js` inject the renamed classes at runtime.
 * The live chart colors bars via `filter: hue-rotate()` on
 * `.bar-chart__bar`; the dead `--green/blue/white` bar variants
 * were removed by the `ats-remove-tailwind` audit (Design Decision 9).
 * The legend-dot variants are kept — `bar-chart.js` injects them.
 * ------------------------------------------------------------------------ */

.bar-chart {
  position: relative;
  height: 300px;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 32px 16px 24px 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.bar-chart__grid {
  position: absolute;
  top: 32px;
  left: 48px;
  right: 16px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  z-index: 0;
}

.bar-chart__grid-line {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.1);
  width: 100%;
}

.bar-chart__axis {
  position: absolute;
  left: 16px;
  top: 32px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-headline);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transform: translateY(5px);
}

.bar-chart__axis-tick {
  line-height: 1;
}

.bar-chart__empty {
  width: 100%;
}

.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-label {
  position: absolute;
  bottom: -28px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-headline);
  font-size: var(--text-label-caps);
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: 1px;
  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: var(--space-2) 0;
}

.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-text {
  font-family: var(--font-headline);
  font-size: var(--text-label-caps);
  color: var(--text-secondary);
}

.bar-chart__legend-dot {
  width: 12px;
  height: 12px;
  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);
}

/* --------------------------------------------------------------------------
 * Shell — popover menu + items (migrated from the Stitch inline
 * `<style>` block). z-index references `--z-popover` (Design Decision 10).
 * ------------------------------------------------------------------------ */

.popover-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 15, 31, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(239, 132, 41, 0.5);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(239, 132, 41, 0.2);
  min-width: 180px;
  z-index: var(--z-popover);
  display: none;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
}

.popover-menu.show {
  display: flex;
}

.popover-item {
  padding: 10px 16px;
  color: var(--text-secondary);
  font-size: var(--text-table-data);
  cursor: pointer;
  transition: all var(--motion-fast);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
  /* Reset <button> UA background so popover-item buttons (the
     search-field dropdown options) render transparent like the
     navcard popover <div> items. */
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
}

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

.popover-item:hover {
  background: var(--peak-orange-tint);
  color: #fff;
  padding-left: 20px;
}

/* Benched markets in the Market nav-card popover — visually
   dimmed so the user can distinguish them from active markets
   at a glance. The bench signal comes from `core.markets.status`
   (sourced via `GET /markets`); the frontend does NOT compute
   bench status client-side. See openspec/changes/db-backed-markets/. */
.popover-item.benched {
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
}

.popover-item.benched::after {
  content: " · benched";
  color: rgba(239, 132, 41, 0.6);
  font-size: 11px;
  font-style: normal;
}

/* --------------------------------------------------------------------------
 * Shell — search input + helper classes (migrated from the Stitch
 * inline `<style>` block and the companion `<style>` block).
 * ------------------------------------------------------------------------ */

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  padding: 10px 16px 10px 48px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 300;
  transition:
    border-color var(--motion-fast),
    box-shadow var(--motion-fast),
    background var(--motion-fast);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.search-input::placeholder {
  color: var(--text-placeholder);
}
.search-input:focus {
  outline: none;
  border-color: var(--peak-orange);
  box-shadow: 0 0 0 1px var(--peak-orange), 0 0 15px rgba(239, 132, 41, 0.3);
}

/* Safe area padding for mobile nav */
.pb-safe {
  padding-bottom: max(env(safe-area-inset-bottom), 16px);
}
/* Hide scrollbar for glass cards */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* --------------------------------------------------------------------------
 * App bar (top nav) + search wrapper + account button.
 * Translated from Tailwind utilities in index.html.
 * ------------------------------------------------------------------------ */

.app-bar {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: var(--z-top-nav);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--glass-panel-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border);
}

.app-bar__inner {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px var(--space-gutter);
  max-width: var(--max-content-width);
  margin: 0 auto;
  gap: var(--space-2);
}

.app-bar__brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.app-bar__logo {
  height: 40px;
  width: 40px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(239, 132, 41, 0.6));
}

.app-bar__title {
  font-family: var(--font-headline);
  font-size: 22px;
  font-weight: 700;
  color: var(--snow-white);
  letter-spacing: 0.025em;
  text-shadow: var(--glow-text);
  /* hidden by default (Tailwind `hidden sm:inline-block`); shown ≥640px */
  display: none;
}

.app-bar__search {
  flex-grow: 1;
  max-width: 42rem;
  /* hidden by default (Tailwind `hidden md:block`); shown ≥768px */
  display: none;
}

.app-bar__actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-wrap__field {
  position: relative;
  flex-grow: 1;
}

.search-wrap__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  z-index: 10;
  pointer-events: none;
  transition: color var(--motion-fast);
}
.search-wrap:focus-within .search-wrap__icon {
  color: var(--peak-orange);
}

.account-btn {
  padding: 8px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition:
    background var(--motion-fast),
    color var(--motion-fast),
    box-shadow var(--motion-fast);
}
.account-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--peak-orange);
  box-shadow: 0 0 10px rgba(239, 132, 41, 0.4);
}

.account-btn__label {
  font-family: var(--font-headline);
  font-size: var(--text-label-caps);
  color: var(--text-primary);
  margin-left: 4px;
}

/* --------------------------------------------------------------------------
 * Main content + nav-card row + nav-card. Translated from Tailwind
 * utilities in index.html. The responsive behavior (mobile 2-col grid
 * + per-id orders, desktop flex) is in the `@media` blocks at the
 * bottom of this file.
 * ------------------------------------------------------------------------ */

.main-content {
  flex-grow: 1;
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 16px var(--space-gutter) 128px;
  position: relative;
  z-index: 0;
}

.nav-card-row {
  width: 100%;
  position: relative;
  z-index: var(--z-top-nav);
  margin-bottom: 16px;
}

.nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--glass-card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-lg);
  transition:
    color var(--motion-fast),
    background var(--motion-fast),
    border-color var(--motion-fast);
}
.nav-card:hover {
  color: var(--snow-white);
}

.nav-card--back {
  flex: 0 0 auto;
  text-decoration: none;
}

.nav-card--new {
  color: var(--peak-orange);
}
.nav-card--new:hover {
  color: var(--snow-white);
  background: rgba(239, 132, 41, 0.2);
}

.nav-card--admin {
  min-width: 120px;
  border-style: dashed;
  border-width: 2px;
  border-color: rgba(45, 76, 59, 0.5);
}

.nav-card__label {
  font-family: var(--font-headline);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: var(--text-body-sm);
  color: inherit;
}

.nav-card__label--admin {
  color: var(--peak-orange);
  text-shadow: var(--glow-text);
}

.nav-card__subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.nav-card__icon {
  margin-right: 4px;
  font-size: 16px;
}

.nav-card__admin-flag {
  position: absolute;
  top: -8px;
  left: 16px;
  background: var(--bg-gradient-start);
  padding: 0 8px;
  font-family: var(--font-headline);
  font-size: 10px;
  color: var(--forest-green);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-card__inner {
  display: flex;
  align-items: center;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
 * Widget grid + widget panel. Translated from Tailwind utilities.
 * The responsive grid (`lg:grid-cols-12`) lives in the `@media`
 * blocks at the bottom of this file.
 * ------------------------------------------------------------------------ */

.widget-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-gutter);
  position: relative;
  z-index: 0;
}

.widget-panel {
  background: var(--glass-panel-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
}

.widget-grid__col-4,
.widget-grid__col-8,
.widget-grid__col-12 {
  /* Default (mobile): single column. ≥1024px spans set in @media. */
}

.widget-panel__header {
  padding: var(--space-card-padding);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
}

.widget-panel__header--split {
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  /* ≥768px: row + center (in @media block) */
}

.widget-panel__title {
  font-family: var(--font-headline);
  font-size: var(--text-title-md);
  font-weight: 700;
  color: var(--snow-white);
  letter-spacing: 0.025em;
  margin: 0;
}

.widget-panel__link {
  color: var(--peak-orange);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-headline);
  font-size: var(--text-label-caps);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--motion-fast), filter var(--motion-fast);
}
.widget-panel__link:hover {
  color: var(--snow-white);
  filter: drop-shadow(0 0 8px rgba(239, 132, 41, 0.8));
}

.widget-panel__icon {
  color: var(--text-muted);
}

.widget-panel__body {
  overflow-x: auto;
}

.widget-panel__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  color: var(--text-secondary);
  font-size: var(--text-body-sm);
  width: 100%;
  /* ≥640px: row + center; ≥768px: width auto (in @media block) */
}

.widget-panel__csv-btn {
  width: 100%;
  justify-content: center;
}

/* --------------------------------------------------------------------------
 * Table row + cell variants (used by runtime-injected rows in
 * `js/widgets/*.js`). The base `.table` rule is already declared above.
 * ------------------------------------------------------------------------ */

.table__head {
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  font-family: var(--font-headline);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.table__cell {
  padding: var(--space-table-cell);
  color: var(--text-secondary);
}

.table__cell--head {
  font-weight: 600;
  color: var(--text-primary);
}

.table__cell--last {
  padding-right: var(--space-card-padding);
}

.table__cell--strong {
  font-weight: 600;
  color: var(--snow-white);
}

.table__cell--right {
  text-align: right;
}

.table__body {
  font-family: var(--font-headline);
  font-size: var(--text-table-data);
  color: var(--text-secondary);
  font-weight: 300;
}

.table__row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background var(--motion-fast);
}
.table__row:hover td {
  background: rgba(255, 255, 255, 0.1);
}

.table__row--alt td {
  background: rgba(0, 0, 0, 0.1);
}

.table--wide {
  min-width: 800px;
}

/* --------------------------------------------------------------------------
 * Bottom nav (mobile only). Default hidden; shown <768px in the
 * `@media` block below. Translated from Tailwind `md:hidden` utility.
 * ------------------------------------------------------------------------ */

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  width: 100%;
  padding: 8px;
  justify-content: space-around;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: max(env(safe-area-inset-bottom), 16px);
  z-index: var(--z-bottom-nav);
  background: var(--glass-panel-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
}

.bottom-nav__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--motion-fast);
}
.bottom-nav__btn:hover {
  color: var(--snow-white);
}

.bottom-nav__btn--admin {
  color: var(--forest-green);
}
.bottom-nav__btn--admin:hover {
  color: var(--peak-orange);
}

.bottom-nav__btn-label {
  font-family: var(--font-headline);
  font-size: 10px;
  margin-top: 4px;
}

/* --------------------------------------------------------------------------
 * Search field dropdown trigger (ats-search-field-dropdown web
 * component). The class is asserted by `search-field-dropdown.test.js`.
 * ------------------------------------------------------------------------ */

.search-field-dropdown__trigger {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  padding: 10px 16px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 300;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition:
    border-color var(--motion-fast),
    box-shadow var(--motion-fast);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.search-field-dropdown__trigger:hover {
  border-color: var(--peak-orange);
}
.search-field-dropdown__trigger:focus {
  outline: none;
  border-color: var(--peak-orange);
  box-shadow: 0 0 0 1px var(--peak-orange);
}

.search-field-dropdown__caret {
  font-size: 14px;
  color: var(--text-muted);
}

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

.modal-root {
  position: relative;
  /* Must sit above the sticky top nav (z-top-nav = 100) so the
     * overlay (z-modal-backdrop = 1099, a child of .modal-root) is
     * not trapped in a stacking context below the nav. Without this,
     * the modal title scrolls under the sticky top nav. */
  z-index: var(--z-modal-backdrop);
}

.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: center;
  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: min(95vw, 1200px);
  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;
  flex: 1 1 auto;
  min-height: 0;
  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);
}
/* Allow grid items to shrink below content size so long strings
   (e.g., a long email) wrap inside their cell instead of pushing
   into the adjacent cell. See
   openspec/changes/ats-applicant-view-fixes/ Decision 10. */
.detail-grid > div {
  min-width: 0;
}
.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;
  /* Break long strings at any character so they wrap inside the
      cell. Without this, a long email pushes the grid item wider
      than 200px and overflows into the adjacent cell. */
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
 * 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);
  }
}

/* --------------------------------------------------------------------------
 * Responsive layout. Translated from Tailwind `md:` / `lg:` / `sm:`
 * utilities by the `ats-remove-tailwind` change (Design Decisions 4, 7).
 *
 * Mobile (<768px): bottom-nav is visible.
 * ≥640px: app-bar title shows inline; widget-panel actions go row;
 *   CSV button + pagination go auto width.
 * ≥768px: app-bar search shows; main content gets extra top padding;
 *   nav-card row becomes a flex row (Back/New narrow, filters growing);
 *   widget-panel split headers go row.
 * ≥1024px: widget grid becomes 12 cols; col-span 4/8/12.
 * ------------------------------------------------------------------------ */

/* Mobile (<768px): bottom-nav visible. */
@media (max-width: 767px) {
  .bottom-nav {
    display: flex;
  }
}

/* ≥640px: app-bar title + widget-panel actions row + auto widths. */
@media (min-width: 640px) {
  .app-bar__title {
    display: inline-block;
  }
  .widget-panel__actions {
    flex-direction: row;
    align-items: center;
    width: auto;
  }
  .widget-panel__csv-btn {
    width: auto;
  }
  .pagination {
    width: auto;
  }
}

/* ≥768px: app-bar search + main padding + nav-card flex row +
   widget-panel split header row. */
@media (min-width: 768px) {
  .app-bar__search {
    display: block;
  }
  .main-content {
    padding-top: 32px;
  }
  .nav-card-row {
    margin-bottom: 32px;
  }
  .widget-panel__header--split {
    flex-direction: row;
    align-items: center;
  }
  .widget-panel__actions {
    width: auto;
  }
}

/* ≥1024px: widget grid 12 cols + col-span 4/8/12. */
@media (min-width: 1024px) {
  .widget-grid {
    grid-template-columns: repeat(12, 1fr);
  }
  .widget-grid__col-4 {
    grid-column: span 4;
  }
  .widget-grid__col-8 {
    grid-column: span 8;
  }
  .widget-grid__col-12 {
    grid-column: span 12;
  }
}