:root {
  --bg: #07111f;
  --bg-soft: #0d1b2d;
  --bg-panel: rgba(12, 24, 42, 0.72);
  --bg-panel-strong: rgba(12, 24, 42, 0.92);
  --line: rgba(158, 184, 224, 0.14);
  --text: #edf4ff;
  --muted: #98a8c4;
  --accent: #73b6ff;
  --accent-2: #7af3d4;
  --danger: #ff5a79;
  --warning: #ffb650;
  --success: #60de8b;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

/* Personnalisation globale des barres de défilement (Chrome, Edge, Safari) */
::-webkit-scrollbar {
    width: 6px;  /* Rend la barre verticale très fine */
    height: 6px; /* Rend l'éventuelle barre horizontale très fine */
}

::-webkit-scrollbar-track {
    background: transparent; /* Rend le rail de la barre invisible */
}

::-webkit-scrollbar-thumb {
    background: rgba(158, 184, 224, 0.2); /* Couleur discrète (basée sur votre variable --line) */
    border-radius: 10px; /* Bords bien arrondis */
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(115, 182, 255, 0.4); /* S'illumine légèrement au survol (basé sur votre --accent) */
}

/* Compatibilité pour Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(158, 184, 224, 0.2) transparent;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, rgba(67, 125, 255, 0.18), transparent 32%),
    radial-gradient(circle at 85% 15%, rgba(85, 235, 207, 0.12), transparent 26%),
    linear-gradient(145deg, #030914 0%, #081220 38%, #07111f 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    radial-gradient(2px 2px at 8% 18%, rgba(255,255,255,0.8), transparent 70%),
    radial-gradient(2px 2px at 24% 74%, rgba(255,255,255,0.55), transparent 70%),
    radial-gradient(1.5px 1.5px at 47% 21%, rgba(255,255,255,0.65), transparent 70%),
    radial-gradient(1.5px 1.5px at 63% 67%, rgba(255,255,255,0.7), transparent 70%),
    radial-gradient(2px 2px at 88% 34%, rgba(255,255,255,0.8), transparent 70%),
    radial-gradient(1.5px 1.5px at 79% 82%, rgba(255,255,255,0.5), transparent 70%);
  opacity: 0.55;
}

body::after {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 16%, transparent 84%, rgba(255,255,255,0.03));
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 420px 1fr;
}

.sidebar {
    /* 1. On supprime complètement la transparence et le flou */
    backdrop-filter: none; 
    
    /* 2. On casse la monotonie du bleu avec un gris ardoise très sombre et totalement opaque */
    background: #111824; 
    
    /* 3. Une bordure franche, droite et plus neutre (sans lueur) */
    border-right: 1px solid #364459; 
    
    /* 4. Une vraie ombre noire classique pour détacher la colonne sans utiliser de couleurs */
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.4);
    
    position: relative;
    z-index: 10;

    /* 5. On conserve vos paramètres de structure d'origine */
    padding: 26px 22px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    max-height: 100vh;
    overflow-y: auto;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, rgba(115,182,255,0.22), rgba(122,243,212,0.14));
  border: 1px solid rgba(115,182,255,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  font-weight: 700;
}

h1, h2, h3, h4, p {
  margin: 0;
}

h1 {
  font-size: 1.35rem;
  line-height: 1.2;
}

.glass {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.user-card {
  padding: 18px;
  border-radius: 22px;
}


.user-card__row,
.section-header,
.panel-header,
.chat-meta,
.custom-bid__footer,
.ladder-header,
.topbar,
.topbar-actions,
.decision-actions,
.chat-input,
.alert-card__top,
.alert-card__metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.user-card__label,
.metric-label,
.chat-meta__label {
  color: var(--muted);
  font-size: 0.78rem;
}

.user-card__name {
  margin-top: 8px;
  font-weight: 700;
  font-size: 1.06rem;
}

.user-card__meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.status-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8fa1bc;
  box-shadow: 0 0 0 6px rgba(143, 161, 188, 0.08);
}

.status-dot.online::before {
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(96, 222, 139, 0.08);
}

.sidebar-section {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-header h2 {
  font-size: 1rem;
}

.ghost-btn,
.secondary-btn,
.primary-btn,
.chip,
.ladder-step {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  transition: 160ms ease;
}

.ghost-btn {
  padding: 10px 14px;
  color: var(--muted);
}

.ghost-btn:hover,
.secondary-btn:hover,
.chip:hover,
.ladder-step:hover {
  transform: translateY(-1px);
  border-color: rgba(115,182,255,0.28);
  background: rgba(115,182,255,0.08);
}

.primary-btn {
  padding: 13px 18px;
  background: linear-gradient(135deg, rgba(115,182,255,0.28), rgba(122,243,212,0.16));
  border-color: rgba(115,182,255,0.32);
  font-weight: 700;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(32, 98, 191, 0.2);
}

.secondary-btn {
  padding: 13px 16px;
}

.warning {
  color: #ffc2cf;
}

.alert-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding-right: 4px;
}

.alert-card {
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text);
}

.alert-card.active {
  background: linear-gradient(135deg, rgba(115,182,255,0.14), rgba(122,243,212,0.08));
  border-color: rgba(115,182,255,0.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 12px 28px rgba(10, 25, 44, 0.3);
}

.alert-card__top {
  margin-bottom: 14px;
}

.sat-pair {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.alert-card__metrics div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.risk {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.risk-low { background: rgba(96, 222, 139, 0.12); color: #8ef2ae; border-color: rgba(96, 222, 139, 0.16); }
.risk-medium { background: rgba(255, 182, 80, 0.12); color: #ffcf87; border-color: rgba(255, 182, 80, 0.16); }
.risk-high { background: rgba(255, 120, 89, 0.12); color: #ffb29b; border-color: rgba(255, 120, 89, 0.16); }
.risk-critical { background: rgba(255, 90, 121, 0.12); color: #ff9cb1; border-color: rgba(255, 90, 121, 0.16); }

.main-layout { 
  padding: 24px; 
  display: flex; 
  flex-direction: column; 
  gap: 20px; 
  height: 100%; 
  max-height: 100vh; 
  overflow-y: auto; /* Conserve le défilement */
  /* overflow: visible; a été supprimé */
}

.topbar {
  padding: 20px 22px;
  border-radius: 24px;
}

.topbar h2 {
  font-size: 1.55rem;
}

.topbar-actions {
  flex-wrap: wrap;
}

.pill {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  min-width: 180px;
}

.pill__label {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-bottom: 4px;
}

.pill__value {
  font-weight: 700;
}

.hero-grid { 
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 20px; 
  flex-shrink: 0; /* Ajout : empêche l'écrasement par flexbox */
  /* min-height: 0; <-- À supprimer */
}

.auction-panel,
.chat-panel {
  border-radius: 28px;
  padding: 22px;
}

.panel-header {
  margin-bottom: 18px;
}

.panel-header.compact {
  margin-bottom: 12px;
}

.live-badge {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: #b7fff0;
  border: 1px solid rgba(122,243,212,0.24);
  background: rgba(122,243,212,0.08);
}

.auction-overview {
  display: grid;
  grid-template-columns: 2.5fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.orbital-track {
  min-height: 260px;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(115,182,255,0.08), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
}

/* --- NOUVEAU SCHÉMA DE CONJONCTION --- */
.trajectory {
  position: absolute;
  width: 200%; /* Ligne longue pour traverser l'écran */
  height: 1px;
  z-index: 1;
}

/* Trajectoire A (Rouge) et B (Vert) */
.traj-a { background: linear-gradient(90deg, transparent, rgba(255, 90, 121, 0.6), transparent); }
.traj-b { background: linear-gradient(90deg, transparent, rgba(96, 222, 139, 0.6), transparent); }

.covariance {
  position: absolute;
  border-radius: 50%;
  width: 140px; /* Longueur de l'ellipsoïde */
  height: 40px; /* Épaisseur de l'ellipsoïde */
  z-index: 2;
}

/* Covariance A (Rouge) */
.cov-a {
  background: radial-gradient(ellipse, rgba(255, 90, 121, 0.25), rgba(255, 90, 121, 0.05));
  border: 1px solid rgba(255, 90, 121, 0.4);
}

/* Covariance B (Vert) */
.cov-b {
  background: radial-gradient(ellipse, rgba(96, 222, 139, 0.25), rgba(96, 222, 139, 0.05));
  border: 1px solid rgba(96, 222, 139, 0.4);
}

.sat {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  z-index: 3;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.sat-a { background: #ff5a79; } /* Rouge */
.sat-b { background: #60de8b; } /* Vert */

.auction-kpis {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.kpi-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.kpi-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 8px;
}

.kpi-card strong {
  font-size: 1.12rem;
}

.kpi-card.accent {
  background: linear-gradient(135deg, rgba(115,182,255,0.12), rgba(122,243,212,0.08));
  border-color: rgba(115,182,255,0.18);
}

.auction-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.bid-ladder,
.decision-card {
  padding: 20px;
  border-radius: 24px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
}

.ladder-header {
  margin-bottom: 16px;
}

.ladder-header span {
  color: var(--muted);
  font-size: 0.82rem;
}

.ladder-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.ladder-step {
  padding: 16px 12px;
  font-weight: 700;
}

.ladder-step.active {
  background: linear-gradient(135deg, rgba(115,182,255,0.2), rgba(122,243,212,0.1));
  border-color: rgba(115,182,255,0.36);
}

.custom-bid {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.custom-bid label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
}

input[type="range"] {
  width: 100%;
  accent-color: #86c4ff;
}

.custom-bid__footer {
  margin-top: 12px;
}

.custom-bid__footer span {
  color: var(--muted);
  font-size: 0.86rem;
}

.decision-card h4 {
  margin-bottom: 18px;
}

.decision-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 22px;
}

.timeline-step {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
}

.timeline-step span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-top: 4px;
  border: 2px solid rgba(255,255,255,0.16);
}

.timeline-step.done span {
  background: var(--success);
  border-color: transparent;
}

.timeline-step.active span {
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 0 0 7px rgba(115,182,255,0.1);
}

.timeline-step p {
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.45;
}

.decision-actions {
  flex-wrap: wrap;
}

.chat-meta {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.chat-window {
  min-height: 430px;
  max-height: 630px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 6px;
}

.message {
  max-width: 86%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}

.message--me {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(115,182,255,0.14), rgba(122,243,212,0.08));
}

.message__author {
  display: block;
  margin-bottom: 8px;
  font-size: 0.76rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.message__time {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.74rem;
}

.message p {
  line-height: 1.5;
}

.chat-input input {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
}

.chat-input input::placeholder {
  color: #72839d;
}

/* Cache les étiquettes de criticité quand le bouton est désactivé */
.hide-criticality .risk {
    display: none;
}

/* Style du bouton "Filter" lorsqu'il est activé */
.ghost-btn.active {
    background: rgba(115,182,255,0.15);
    color: var(--accent);
    border-color: rgba(115,182,255,0.3);
}

/* 1. État par défaut / Désactivé (Très en évidence pour montrer qu'il existe) */
#toggleAlertsBtn {
    color: var(--accent);
    border: 1px solid var(--accent);
    background: rgba(115, 182, 255, 0.05); /* Fond très légèrement bleuté */
    box-shadow: 0 0 12px rgba(115, 182, 255, 0.2); /* Halo permanent autour du bouton */
    transition: all 0.2s ease;
}

/* 2. État Activé (Clairement distinct : on inverse les couleurs et on accentue le halo) */
#toggleAlertsBtn.active {
    background: var(--accent); /* Le bouton se remplit de couleur */
    color: var(--bg); /* Le texte devient sombre pour contraster au maximum */
    box-shadow: 0 0 20px rgba(115, 182, 255, 0.5); /* Le halo s'intensifie façon "néon allumé" */
}

/* --- TCHAT : OPTIONS DE RÉPONSE RAPIDE --- */

.quick-responses {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 12px;
}

.quick-responses .chip {
  height: 40px; /* Hauteur fixe stricte */
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border-radius: 20px; /* Arrondi plus doux qui matche avec l'interface */
  white-space: nowrap; /* Empêche le texte de se casser sur deux lignes */
}

/* Style spécifique pour le bouton Deny (basé sur votre variable --danger) */
.chip.danger {
  border-color: rgba(255, 90, 121, 0.3);
  color: #ffb29b;
}

.chip.danger:hover {
  background: rgba(255, 90, 121, 0.1);
  border-color: var(--danger);
}

/* L'astuce visuelle : un conteneur qui ressemble à un gros bouton */
.chip-input {
  height: 40px; /* La même hauteur exacte que les boutons .chip */
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px 0 14px; /* On ajuste le padding pour centrer visuellement */
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Le champ de texte transparent à l'intérieur */
.chip-input input {
  width: 90px; /* <-- On a élargi le champ de 65px à 90px */
  height: 28px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font-size: 0.85rem;
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease;
  
  /* Masque les flèches sur Firefox */
  /* -moz-appearance: textfield;  */
}

/* .chip-input input::-webkit-outer-spin-button,
.chip-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
} */

.chip-input input:focus {
  border-color: var(--accent);
}

/* Le petit bouton de validation intégré */
.chip-action {
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  transition: all 0.2s ease;
}

.chip-action:hover {
  transform: scale(1.05);
  background: var(--accent-2);
}

@media (max-width: 1280px) {
  .hero-grid {
    flex-shrink: 0;
  }
  .hero-grid,
  .auction-body,
  .auction-overview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .sidebar, .main-layout {
    height: auto; 
    overflow-y: visible; 
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .main-layout,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .auction-panel,
  .chat-panel {
    padding: 18px;
    border-radius: 22px;
  }

  .topbar,
  .panel-header,
  .chat-meta,
  .custom-bid__footer,
  .ladder-header,
  .decision-actions,
  .chat-input,
  .topbar-actions,
  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .ladder-steps,
  .auction-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .message {
    max-width: 100%;
  }
}