/* ============================================
   Simulateur PER - Cabinet Premium
   Excellence en gestion de patrimoine
   Design sobre, précis, professionnel
   ============================================ */

/* ==================
   VARIABLES PREMIUM
   ================== */

:root {
  /* Couleurs Rivaria */
  --premium-navy: #023A68;
  --premium-blue: #1870EF;
  --premium-gold: #1870EF;
  --premium-silver: #8B9DC3;
  --premium-success: #2D7A4F;
  --premium-warning: #D97706;
  --premium-error: #B91C1C;

  /* Backgrounds */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F7F7F7;
  --bg-elevated: #FCFCFD;
  --bg-overlay: rgba(2, 58, 104, 0.95);

  /* Textes */
  --text-primary: #0A1628;
  --text-secondary: #4B5563;
  --text-tertiary: #9CA3AF;
  --text-inverse: #FFFFFF;

  /* Bordures */
  --border-light: #E5E7EB;
  --border-medium: #D1D5DB;
  --border-dark: #9CA3AF;

  /* Ombres Premium */
  --shadow-xs: 0 1px 2px 0 rgba(10, 22, 40, 0.05);
  --shadow-sm: 0 2px 4px -1px rgba(10, 22, 40, 0.06), 0 2px 2px -1px rgba(10, 22, 40, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(10, 22, 40, 0.08), 0 2px 4px -2px rgba(10, 22, 40, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(10, 22, 40, 0.10), 0 4px 6px -4px rgba(10, 22, 40, 0.06);
  --shadow-xl: 0 20px 25px -5px rgba(10, 22, 40, 0.12), 0 8px 10px -6px rgba(10, 22, 40, 0.08);

  /* Espacements Premium */
  --space-xs: 0.25rem;    /* 4px */
  --space-sm: 0.5rem;     /* 8px */
  --space-md: 1rem;       /* 16px */
  --space-lg: 1.5rem;     /* 24px */
  --space-xl: 2rem;       /* 32px */
  --space-2xl: 2.5rem;    /* 40px */
  --space-3xl: 3rem;      /* 48px */

  /* Radius Premium */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typographie Rivaria */
  --font-sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Poids */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Tailles */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
}

/* ==================
   RESET & BASE
   ================== */

body[data-sim="per"] {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body[data-sim="per"] .page {
  max-width: 1680px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-xl) var(--space-3xl);
  background: var(--bg-secondary);
}

/* ==================
   TOPBAR PREMIUM
   ================== */

.topbar {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-xl);
  max-width: 1680px;
  margin: 0 auto;
  gap: var(--space-lg);
}

/* Bouton Retour Accueil */
.topbar-back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  transition: all var(--transition-base);
}

.topbar-back-link:hover {
  background: var(--bg-secondary);
  border-color: var(--premium-gold);
  color: var(--premium-navy);
}

.topbar-back-link .back-arrow {
  font-size: var(--text-lg);
  color: var(--premium-gold);
  transition: transform var(--transition-base);
}

.topbar-back-link:hover .back-arrow {
  transform: translateX(-3px);
}

.topbar-back-link .back-text {
  letter-spacing: 0.02em;
}

/* Marque centrale */
.topbar-brand {
  flex: 1;
  text-align: center;
}

.topbar-brand .brand-name {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--premium-navy);
  letter-spacing: 0.03em;
}

/* Pill du simulateur */
.topbar-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: linear-gradient(135deg, var(--premium-navy) 0%, var(--premium-blue) 100%);
  color: var(--text-inverse);
  border-radius: 100px;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: 0.025em;
}

.topbar-pill .dot {
  width: 6px;
  height: 6px;
  background: var(--premium-gold);
  border-radius: 50%;
  animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Responsive topbar */
@media (max-width: 768px) {
  .topbar-inner {
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
  }

  .topbar-brand {
    order: -1;
    flex-basis: 100%;
    margin-bottom: var(--space-xs);
  }

  .topbar-brand .brand-name {
    font-size: var(--text-lg);
  }

  .topbar-back-link {
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--text-xs);
  }

  .topbar-pill {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-xs);
  }
}

/* ==================
   HERO PREMIUM
   ================== */

.hero {
  background: linear-gradient(135deg,
    var(--premium-navy) 0%,
    var(--premium-blue) 100%
  );
  color: var(--text-inverse);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-2xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(184, 134, 11, 0.05) 100%
  );
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3xl);
  padding: var(--space-3xl);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-left h1 {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  margin: 0 0 var(--space-md) 0;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.hero-left p {
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 var(--space-xl) 0;
  line-height: 1.6;
  max-width: 42rem;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.hero-actions button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
  cursor: pointer;
  transition: all var(--transition-base);
  border: 2px solid transparent;
  min-height: 48px; /* Accessibilité tactile */
}

.hero-actions .btn-calculate {
  background: var(--bg-primary);
  color: var(--premium-navy);
  border-color: var(--bg-primary);
}

.hero-actions .btn-calculate:hover {
  background: var(--bg-secondary);
  border-color: var(--bg-secondary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.hero-actions .btn-calculate:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}

.hero-actions .btn-help {
  background: transparent;
  color: var(--text-inverse);
  border-color: rgba(255, 255, 255, 0.3);
}

.hero-actions .btn-help:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.hero-actions .btn-pdf {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-inverse);
  border-color: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.hero-actions .btn-pdf:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.hero-logo {
  width: 180px;
  height: auto;
}

.hero-logo-img {
  width: 100%;
  height: auto;
  opacity: 0.95;
  filter: brightness(0) invert(1);
}

/* ==================
   LAYOUT PRINCIPAL - PLEINE LARGEUR
   ================== */

.sim-wrap {
  background: transparent;
}

.sim-shell {
  background: transparent;
}

.sim-shell .content-centered {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

/* Legacy support */
.sim-shell .content {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

/* ==================
   SECTION HYPOTHESES
   ================== */

.hypotheses-section {
  width: 100%;
}

.hypotheses-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.hypotheses-grid .section {
  width: 100%;
}

/* Section pleine largeur pour parametres investissement */
.hypotheses-grid .section:nth-child(3),
.hypotheses-grid .section:nth-child(5) {
  grid-column: 1 / -1;
}

/* Form rows for multi-columns layout */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-row .form-group {
  margin-bottom: 0;
}

/* 4 colonnes pour les sections pleine largeur */
.hypotheses-grid .section:nth-child(3) .form-row,
.hypotheses-grid .section:nth-child(5) .form-row {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
  .hypotheses-grid .section:nth-child(3) .form-row,
  .hypotheses-grid .section:nth-child(5) .form-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .hypotheses-grid .section:nth-child(3),
  .hypotheses-grid .section:nth-child(5) {
    grid-column: 1;
  }
}

@media (max-width: 768px) {
  .form-row,
  .hypotheses-grid .section:nth-child(3) .form-row,
  .hypotheses-grid .section:nth-child(5) .form-row {
    grid-template-columns: 1fr;
  }
}

/* ==================
   SECTION RESULTATS
   ================== */

.results-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
}

/* ==================
   SIDEBAR PREMIUM (legacy)
   ================== */

.sidebar {
  position: sticky;
  top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.sidebar .btn-calculate {
  width: 100%;
  padding: var(--space-lg) var(--space-xl);
  background: linear-gradient(135deg, var(--premium-navy) 0%, var(--premium-blue) 100%);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-weight: var(--font-bold);
  font-size: var(--text-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  min-height: 56px;
}

.sidebar .btn-calculate::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(184, 134, 11, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.sidebar .btn-calculate:hover::before {
  left: 100%;
}

.sidebar .btn-calculate:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.sidebar .btn-calculate:focus {
  outline: 3px solid rgba(28, 61, 90, 0.4);
  outline-offset: 2px;
}

.sidebar .btn-calculate:active {
  transform: translateY(0);
}

/* ==================
   SECTIONS PREMIUM
   ================== */

.sidebar .section,
.main-content .section {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

.sidebar .section:hover,
.main-content .section:hover {
  box-shadow: var(--shadow-md);
}

.sidebar .section:focus-within,
.main-content .section:focus-within {
  border-color: var(--premium-blue);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(28, 61, 90, 0.1);
}

.sidebar .section h3,
.main-content .section h3 {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--premium-navy);
  margin: 0 0 var(--space-xl) 0;
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.main-content .section h3 {
  font-size: var(--text-2xl);
  border-bottom-color: var(--premium-blue);
}

/* ==================
   FORMULAIRES PREMIUM
   ================== */

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  font-weight: var(--font-medium);
  transition: all var(--transition-base);
  min-height: 48px; /* Accessibilité tactile */
}

.form-group input:hover,
.form-group select:hover {
  border-color: var(--premium-blue);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--premium-blue);
  background: rgba(28, 61, 90, 0.02);
  box-shadow: 0 0 0 3px rgba(28, 61, 90, 0.1);
}

.form-group input:disabled,
.input-disabled {
  background: var(--bg-secondary) !important;
  color: var(--text-tertiary) !important;
  cursor: not-allowed !important;
  border-color: var(--border-light) !important;
}

/* États de validation */
.form-group input:invalid {
  border-color: var(--premium-error);
}

.form-group input:valid {
  border-color: var(--premium-success);
}

/* ==================
   CHECKBOX PREMIUM
   ================== */

.checkbox-group {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  transition: all var(--transition-base);
}

.checkbox-group:hover {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
}

.checkbox-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--premium-navy);
}

.checkbox-group label {
  margin: 0;
  cursor: pointer;
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  font-size: var(--text-sm);
  user-select: none;
}

/* ==================
   INFO BADGE PREMIUM
   ================== */

.info-badge {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: linear-gradient(135deg,
    rgba(28, 61, 90, 0.08) 0%,
    rgba(28, 61, 90, 0.04) 100%
  );
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--premium-navy);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  margin-top: var(--space-md);
}

.info-badge::before {
  content: '📊';
  font-size: var(--text-lg);
}

.info-badge strong {
  color: var(--text-primary);
  font-weight: var(--font-bold);
}

/* ==================
   TOOLTIPS PREMIUM
   ================== */

.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
  margin-left: var(--space-xs);
}

.tip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--premium-silver);
  color: var(--text-inverse);
  font-size: 11px;
  font-weight: var(--font-bold);
  font-style: normal;
  transition: all var(--transition-base);
  border: 2px solid var(--bg-primary);
}

.info-tip:hover .tip-icon,
.info-tip:focus .tip-icon {
  background: var(--premium-navy);
  transform: scale(1.1);
}

.tip-content {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--bg-overlay);
  color: var(--text-inverse);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: 1.6;
  white-space: normal;
  max-width: 340px;
  box-shadow: var(--shadow-xl);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  backdrop-filter: blur(10px);
}

.tip-content::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-bottom-color: var(--bg-overlay);
}

.info-tip:hover .tip-content,
.info-tip:focus .tip-content {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.tip-content strong {
  color: var(--premium-gold);
  font-weight: var(--font-bold);
}

/* ==================
   CARDS RÉSUMÉ PREMIUM
   ================== */

.results-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.summary-card {
  background: linear-gradient(135deg,
    var(--bg-primary) 0%,
    var(--bg-elevated) 100%
  );
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--premium-navy);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle,
    rgba(28, 61, 90, 0.03) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.summary-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-left-color: var(--premium-gold);
}

.summary-card h4 {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--text-secondary);
  margin: 0 0 var(--space-md) 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  z-index: 1;
}

.summary-card .value {
  font-size: var(--text-4xl);
  font-weight: var(--font-extrabold);
  color: var(--premium-navy);
  margin: var(--space-sm) 0;
  line-height: 1;
  position: relative;
  z-index: 1;
  font-family: var(--font-serif);
}

.summary-card .helper-text {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.summary-card .helper-text div {
  margin: var(--space-xs) 0;
}

.summary-card .helper-text strong {
  font-weight: var(--font-bold);
  color: var(--text-secondary);
}

/* Variantes couleurs */
.summary-card.secondary {
  border-left-color: var(--premium-success);
}

.summary-card.secondary .value {
  color: var(--premium-success);
}

.summary-card.tertiary {
  border-left-color: var(--premium-gold);
}

.summary-card.tertiary .value {
  color: var(--premium-gold);
}

/* ==================
   GRAPHIQUES PREMIUM
   ================== */

.chart-container {
  position: relative;
  height: 540px;
  margin-top: var(--space-xl);
  padding: var(--space-2xl);
  background: linear-gradient(135deg,
    var(--bg-primary) 0%,
    var(--bg-elevated) 100%
  );
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  overflow: hidden;
}

.chart-container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg,
    rgba(184, 134, 11, 0.1) 0%,
    transparent 50%,
    rgba(28, 61, 90, 0.05) 100%
  );
  border-radius: var(--radius-xl);
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.chart-container:hover::before {
  opacity: 1;
}

.chart-container:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.chart-container canvas {
  max-height: 480px;
  position: relative;
  z-index: 1;
}

/* ==================
   TABLEAUX SORTIE PREMIUM
   ================== */

.sortie-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.sortie-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.sortie-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--premium-blue);
}

.sortie-card h4 {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--premium-navy);
  margin: 0 0 var(--space-lg) 0;
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--border-light);
}

.sortie-card table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 var(--space-xs);
}

.sortie-card table tr {
  transition: background var(--transition-fast);
}

.sortie-card table tr:hover {
  background: var(--bg-secondary);
}

.sortie-card table td {
  padding: var(--space-md);
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.4;
}

.sortie-card table td:first-child {
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.sortie-card table td:last-child {
  font-weight: var(--font-bold);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sortie-card table tr.highlight-row td {
  background: linear-gradient(135deg,
    rgba(28, 61, 90, 0.06) 0%,
    rgba(28, 61, 90, 0.03) 100%
  );
  font-size: var(--text-base);
  font-weight: var(--font-extrabold);
  color: var(--premium-navy);
  padding: var(--space-lg) var(--space-md);
  border-radius: var(--radius-sm);
}

.sortie-card table tr.highlight-row td:first-child {
  font-weight: var(--font-bold);
  color: var(--premium-navy);
}

/* ==================
   TABLEAU PROJECTION PREMIUM
   ================== */

#projectionTable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

#projectionTable thead {
  background: linear-gradient(135deg,
    var(--premium-navy) 0%,
    var(--premium-blue) 100%
  );
  color: var(--text-inverse);
}

#projectionTable th {
  padding: var(--space-md) var(--space-lg);
  text-align: right;
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  letter-spacing: 0.025em;
  border-bottom: 2px solid var(--premium-gold);
}

#projectionTable th:first-child {
  text-align: left;
}

#projectionTable tbody tr {
  transition: background var(--transition-fast);
}

#projectionTable tbody tr:hover {
  background: var(--bg-secondary);
}

#projectionTable tbody tr:nth-child(even) {
  background: var(--bg-elevated);
}

#projectionTable tbody tr:nth-child(even):hover {
  background: var(--bg-secondary);
}

#projectionTable td {
  padding: var(--space-md) var(--space-lg);
  text-align: right;
  font-size: var(--text-sm);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
}

#projectionTable td:first-child {
  text-align: left;
  font-weight: var(--font-semibold);
  color: var(--premium-navy);
}

.table-empty-state {
  text-align: center !important;
  padding: var(--space-3xl) var(--space-xl) !important;
  color: var(--text-tertiary);
  font-style: italic;
}

/* ==================
   RESPONSIVE PREMIUM
   ================== */

@media (max-width: 1400px) {
  .sim-shell .content {
    grid-template-columns: 380px 1fr;
    gap: var(--space-xl);
  }
}

@media (max-width: 1200px) {
  .sim-shell .content {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .sidebar {
    position: static;
  }

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

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

  .hero-inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .hero-logo {
    width: 140px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  body[data-sim="per"] .page {
    padding: var(--space-md) var(--space-md) var(--space-2xl);
  }

  .hero-inner {
    padding: var(--space-xl);
  }

  .hero-left h1 {
    font-size: var(--text-3xl);
  }

  .hero-left p {
    font-size: var(--text-base);
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions button {
    width: 100%;
  }

  .sidebar .section,
  .main-content .section {
    padding: var(--space-lg);
  }

  .summary-card {
    padding: var(--space-lg);
  }

  .summary-card .value {
    font-size: var(--text-3xl);
  }

  .chart-container {
    height: 360px;
    padding: var(--space-lg);
  }

  .chart-container canvas {
    max-height: 300px;
  }

  .sortie-card {
    padding: var(--space-lg);
  }

  /* Tableau responsive */
  #projectionTable {
    font-size: var(--text-xs);
  }

  #projectionTable th,
  #projectionTable td {
    padding: var(--space-sm) var(--space-md);
  }
}

/* ==================
   FOCUS VISIBLE (Accessibilité)
   ================== */

*:focus-visible {
  outline: 3px solid var(--premium-gold);
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--premium-blue);
  outline-offset: 2px;
}

/* ==================
   PRINT STYLES
   ================== */

@media print {
  .topbar,
  .hero,
  .sidebar,
  .btn-calculate,
  .btn-help,
  .btn-pdf {
    display: none !important;
  }

  body[data-sim="per"] .page {
    max-width: 100%;
    padding: 0;
  }

  .sim-shell .content {
    grid-template-columns: 1fr;
  }
}

/* ==================
   ANIMATIONS SUBTILES
   ================== */

@media (prefers-reduced-motion: no-preference) {
  .summary-card {
    animation: fadeInUp 0.4s ease-out;
  }

  .summary-card:nth-child(2) {
    animation-delay: 0.1s;
  }

  .summary-card:nth-child(3) {
    animation-delay: 0.2s;
  }

  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================
   STATES & UTILITIES
   ================== */

.hidden {
  display: none !important;
}

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

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
  cursor: wait;
}

/* Error state */
.error {
  border-color: var(--premium-error) !important;
  background: rgba(185, 28, 28, 0.05) !important;
}

/* Success state */
.success {
  border-color: var(--premium-success) !important;
  background: rgba(45, 122, 79, 0.05) !important;
}
