/*
 * FIELD ATLAS — SKILLING OUTCOMES PLATFORM
 * Core Design Tokens, Typography, Layout, and Component Styles
 * Aesthetic: Civic Cartography (Deep Indigo, Field Teal, Ochre, Coral, Parchment)
 */

:root {
  /* Brand Color Palette */
  --color-deep-indigo: #1E2749;
  --color-teal: #0E8176;
  --color-teal-light: #E0F2F1;
  --color-indigo-blue: #49618B;
  --color-ochre: #D69541;
  --color-ochre-light: #FEF3E2;
  --color-coral: #D56F58;
  --color-coral-light: #FDECE9;
  
  /* Neutral & Surface Palette */
  --color-parchment: #F8F9FA;
  --color-surface: #FFFFFF;
  --color-surface-hover: #F1F5F9;
  --color-border: #E2E8F0;
  --color-border-subtle: #EDF2F7;
  --color-text-primary: #1E2749;
  --color-text-secondary: #49618B;
  --color-text-muted: #64748B;
  --color-text-inverse: #FFFFFF;

  /* Status Tokens */
  --status-verified: #0E8176;
  --status-pending: #D69541;
  --status-disputed: #D56F58;
  --status-active: #0E8176;
  --status-withdrawn: #64748B;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spatial & Elevation Tokens */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(30, 39, 73, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(30, 39, 73, 0.07), 0 2px 4px -2px rgba(30, 39, 73, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(30, 39, 73, 0.08), 0 4px 6px -4px rgba(30, 39, 73, 0.04);
  --shadow-popover: 0 20px 25px -5px rgba(30, 39, 73, 0.1), 0 8px 10px -6px rgba(30, 39, 73, 0.05);

  /* Layout Dimensions */
  --sidebar-width: 260px;
  --header-height: 64px;
  --bottom-nav-height: 60px;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  background-color: var(--color-parchment);
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background-color: var(--color-parchment);
  overflow-x: hidden;
  line-height: 1.5;
}

/* Accessible focus outlines */
:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-deep-indigo);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: 1.875rem; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }

p {
  color: var(--color-text-secondary);
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-teal);
}

/* Global App Shell Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Desktop Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--color-deep-indigo);
  color: var(--color-surface);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #FFFFFF;
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-teal), #18A89B);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: #FFFFFF;
}

.brand-subtitle {
  font-size: 0.7rem;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  padding: 1.25rem 0.75rem;
  flex: 1;
  overflow-y: auto;
}

.nav-group-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94A3B8;
  padding: 0.5rem 0.75rem;
  margin-top: 0.5rem;
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: #CBD5E1;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.925rem;
  transition: all var(--transition-fast);
  margin-bottom: 0.25rem;
  cursor: pointer;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.nav-link.active {
  background-color: var(--color-teal);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(14, 129, 118, 0.3);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background-color: rgba(0, 0, 0, 0.12);
}

.user-quick-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: var(--color-indigo-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
}

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

.user-profile-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-profile-role {
  font-size: 0.725rem;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* Top Navigation Bar */
.top-header {
  height: var(--header-height);
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-drawer-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-border);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  color: var(--color-deep-indigo);
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-deep-indigo);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.lang-selector-wrap {
  position: relative;
}

.lang-select {
  appearance: none;
  background-color: var(--color-parchment);
  border: 1px solid var(--color-border);
  padding: 0.45rem 2rem 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-deep-indigo);
  cursor: pointer;
  min-height: 40px;
}

.lang-icon {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--color-text-muted);
}

/* Content Container */
.content-body {
  padding: 1.75rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* Hero & Programme Pulse Section */
.hero-card {
  background: linear-gradient(135deg, #1E2749 0%, #2A3660 100%);
  border-radius: var(--radius-lg);
  color: #FFFFFF;
  padding: 2.25rem 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(14, 129, 118, 0.25) 0%, rgba(30, 39, 73, 0) 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.hero-card .eyebrow {
  color: #38BDF8;
  margin-bottom: 0.5rem;
  display: block;
}

.hero-title {
  color: #FFFFFF;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.hero-description {
  color: #CBD5E1;
  font-size: 1.05rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.hero-privacy-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #94A3B8;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Outcome Route Timeline */
.route-timeline-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.route-timeline-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  font-weight: 700;
}

.route-steps-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  position: relative;
  gap: 1rem;
}

.route-steps-grid::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 8%;
  right: 8%;
  height: 3px;
  background: var(--color-border);
  z-index: 1;
}

.route-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
}

.route-step-circle {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background-color: var(--color-surface);
  border: 3px solid var(--color-teal);
  color: var(--color-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 0.75rem;
  box-shadow: 0 0 0 4px var(--color-surface);
  transition: all var(--transition-fast);
}

.route-step-item.active .route-step-circle {
  background-color: var(--color-teal);
  color: #FFFFFF;
}

.route-step-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-deep-indigo);
  margin-bottom: 0.2rem;
}

.route-step-count {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--color-teal);
}

/* Metric KPI Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.metric-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.metric-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-deep-indigo);
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.metric-subtext {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-growth {
  color: var(--color-teal);
  font-weight: 700;
}

.badge-urgent {
  color: var(--color-coral);
  font-weight: 700;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.chart-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

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

.chart-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-deep-indigo);
}

.chart-legend-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}

.chart-container {
  position: relative;
  width: 100%;
  height: 260px;
}

/* Provider Pulse Leaderboard & Panels */
.provider-pulse-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.provider-list-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.provider-pulse-item {
  background-color: var(--color-parchment);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.provider-pulse-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-deep-indigo);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.provider-pulse-district {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.provider-pulse-stat {
  display: flex;
  justify-content: space-between;
  font-size: 0.825rem;
}

.progress-bar-bg {
  height: 6px;
  background-color: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.25rem;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--color-teal);
  border-radius: var(--radius-full);
}

/* Buttons and Controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  border: 1px solid transparent;
  min-height: 44px;
}

.btn-primary {
  background-color: var(--color-teal);
  color: #FFFFFF;
  border-color: var(--color-teal);
}

.btn-primary:hover {
  background-color: #0b685f;
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

.btn-outline {
  background-color: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-deep-indigo);
}

.btn-outline:hover {
  background-color: var(--color-surface-hover);
  border-color: #CBD5E1;
}

.btn-coral {
  background-color: var(--color-coral);
  color: #FFFFFF;
}

.btn-coral:hover {
  background-color: #be5d48;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  min-height: 36px;
}

/* Data Tables */
.table-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.table-toolbar {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.table-search-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.4rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  background-color: var(--color-parchment);
  color: var(--color-text-primary);
  min-height: 42px;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-select {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  min-height: 42px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table th {
  background-color: var(--color-parchment);
  color: var(--color-text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.725rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-deep-indigo);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: var(--color-surface-hover);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-teal { background-color: var(--color-teal-light); color: var(--color-teal); }
.badge-ochre { background-color: var(--color-ochre-light); color: #B2752A; }
.badge-coral { background-color: var(--color-coral-light); color: var(--color-coral); }
.badge-indigo { background-color: #EEF2FF; color: var(--color-indigo-blue); }
.badge-neutral { background-color: #F1F5F9; color: var(--color-text-muted); }

/* Follow-up Communication View Layout */
.followup-layout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.followup-queue-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.queue-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.queue-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  max-height: 520px;
}

.queue-item {
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-parchment);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.queue-item:hover {
  border-color: var(--color-teal);
  background-color: var(--color-surface);
}

.queue-item.selected {
  border-color: var(--color-teal);
  background-color: var(--color-teal-light);
  box-shadow: 0 0 0 1px var(--color-teal);
}

/* Simulated Message Simulator Panel */
.simulator-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.simulator-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

.simulator-tab-btn {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--color-text-muted);
}

.simulator-tab-btn.active {
  background-color: var(--color-deep-indigo);
  color: #FFFFFF;
}

.phone-preview-shell {
  background: #F1F5F9;
  border: 2px solid var(--color-border);
  border-radius: 20px;
  padding: 1.25rem;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.message-bubble {
  background-color: #FFFFFF;
  border-radius: 14px 14px 14px 0;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-sm);
  max-width: 85%;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--color-deep-indigo);
  position: relative;
}

.message-bubble.typing::after {
  content: ' ···';
  animation: typing-dots 1.5s infinite;
  font-weight: bold;
}

@keyframes typing-dots {
  0% { content: ' ·'; }
  50% { content: ' ··'; }
  100% { content: ' ···'; }
}

.simulator-response-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* Modals and Toasts */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(30, 39, 73, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-dialog {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  box-shadow: var(--shadow-popover);
  border: 1px solid var(--color-border);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-deep-indigo);
}

.modal-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 1.25rem;
  padding: 0.25rem;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: var(--color-parchment);
}

/* Form Styles */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-deep-indigo);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  min-height: 44px;
}

.form-control:focus {
  border-color: var(--color-teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 129, 118, 0.15);
}

/* Toast Alerts Container */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--color-deep-indigo);
  color: #FFFFFF;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.875rem;
  animation: slide-in 0.3s ease-out;
}

.toast-success { background-color: var(--color-teal); }
.toast-error { background-color: var(--color-coral); }
.toast-warning { background-color: var(--color-ochre); }

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Trainee Mobile-First Portal Styles */
.trainee-welcome-card {
  background: linear-gradient(135deg, var(--color-teal) 0%, #0A5D54 100%);
  border-radius: var(--radius-lg);
  color: #FFFFFF;
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}

.trainee-stage-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin: 1.5rem 0;
  padding: 0 0.5rem;
}

.trainee-stage-rail::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 5%;
  right: 5%;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  z-index: 1;
}

.trainee-stage-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  gap: 0.35rem;
}

.trainee-stage-dot {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid #FFFFFF;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.trainee-stage-step.active .trainee-stage-dot {
  background: #FFFFFF;
  color: var(--color-teal);
}

.trainee-stage-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #FFFFFF;
}

.trainee-action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.trainee-action-btn {
  padding: 0.85rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-deep-indigo);
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  min-height: 72px;
}

.trainee-action-btn:hover {
  border-color: var(--color-teal);
  background: var(--color-teal-light);
  transform: translateY(-2px);
}
