/* ============================================================
   OCÉA — Maquette refonte page Consultation
   Variables CSS — modifie les couleurs ici en haut
   ============================================================ */
:root {
  --primary: #C75998;
  --primary-dark: #A8447D;
  --primary-light: #F5E1ED;
  --primary-soft: #FCF4F8;
  --page-bg: #F5F5F5;
  --block-bg: #FFFFFF;
  --light-grey: #EFF1F3;
  --lighter-grey: #F8F9FB;
  --dark-text: #212353;
  --misc: #A1A1A7;
  --info: #6BD1EB;
  --error: #FE7E7D;
  --warning: #FFBF2F;
  --success: #8CD291;
  --border: #E8EAEF;
  --shadow-sm: 0 1px 3px rgba(73,101,148,.04), 0 2px 6px rgba(73,101,148,.03);
  --shadow-md: 0 4px 12px rgba(73,101,148,.06), 0 8px 24px rgba(73,101,148,.04);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--page-bg);
  color: var(--dark-text);
  font-size: 14px;
  line-height: 1.5;
}

/* ============ HEADER ============ */
.app-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--primary);
}

.logo-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700;
}

.search-bar {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border);
  border-radius: 24px;
  font-family: inherit;
  font-size: 14px;
  background: var(--lighter-grey);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}

.search-bar::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: 2px solid var(--misc);
  border-radius: 50%;
  opacity: .5;
}
.search-bar::after {
  content: "";
  position: absolute;
  left: 27px;
  top: 60%;
  width: 5px;
  height: 2px;
  background: var(--misc);
  transform: rotate(45deg);
  opacity: .5;
}

.user-avatar {
  margin-left: auto;
  width: 40px; height: 40px;
  background: #FFC857;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  color: var(--dark-text);
  cursor: pointer;
}

/* ============ LAYOUT ============ */
.layout {
  display: grid;
  grid-template-columns: 220px 1fr 320px;
  min-height: calc(100vh - 65px);
}

/* ============ SIDEBAR ============ */
.sidebar {
  background: white;
  border-right: 1px solid var(--border);
  padding: 24px 12px;
}

.sidebar-section { margin-bottom: 28px; }

.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--misc);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--dark-text);
  font-weight: 500;
  font-size: 13px;
  transition: all .15s;
  margin-bottom: 2px;
}

.nav-item:hover { background: var(--primary-soft); }
.nav-item.active { background: var(--primary); color: white; }

.nav-item .icon {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.nav-item .icon svg { width: 16px; height: 16px; }
.nav-item.active .icon svg { stroke: white; }

/* ============ MAIN ============ */
.main {
  padding: 24px 32px;
  max-width: 100%;
  overflow-x: hidden;
}

.patient-bar {
  background: white;
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.patient-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

.patient-info h2 { font-size: 18px; font-weight: 600; margin-bottom: 2px; }

.patient-meta {
  font-size: 12px;
  color: var(--misc);
  display: flex;
  gap: 12px;
}

.patient-meta span::after {
  content: "•";
  margin-left: 12px;
  color: var(--border);
}
.patient-meta span:last-child::after { content: ""; }

.header-actions { margin-left: auto; display: flex; gap: 8px; }

.btn {
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ghost { background: white; border-color: var(--border); color: var(--dark-text); }
.btn-ghost:hover { background: var(--lighter-grey); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: #2BAE76; color: white; }

/* ============ PROGRESS TRACKER ============ */
.progress-tracker {
  background: white;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 6px;
  transition: background .15s;
}

.progress-step:hover { background: var(--lighter-grey); }

.progress-step .num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--light-grey);
  color: var(--misc);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.progress-step.done .num { background: #2BAE76; color: white; }
.progress-step.done .num::before { content: "✓"; }
.progress-step.done .num span { display: none; }

.progress-step.current .num {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px var(--primary-light);
}

.progress-step .label { font-size: 12px; font-weight: 500; color: var(--misc); }
.progress-step.done .label { color: var(--dark-text); }
.progress-step.current .label { color: var(--primary); font-weight: 600; }

.progress-divider {
  flex: 0 0 16px;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
}
.progress-divider.done { background: #2BAE76; }

/* ============ CARDS ============ */
.card {
  background: white;
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: background .15s;
}

.card-header:hover { background: var(--lighter-grey); }
.card-header.open { border-bottom-color: var(--border); }

.card-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--primary);
}
.card-icon svg { width: 18px; height: 18px; stroke: var(--primary); }

.section-icon { width: 14px; height: 14px; flex-shrink: 0; stroke: #5B4FE3; }

.card-title { font-size: 15px; font-weight: 600; flex: 1; }
.card-subtitle { font-size: 12px; color: var(--misc); font-weight: 400; margin-top: 2px; }

.card-status {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--light-grey);
  color: var(--misc);
}
.card-status.complete { background: #E3F5EA; color: #2BAE76; }
.card-status.warning { background: #FFF6E0; color: #B8860B; }

.card-toggle {
  font-size: 18px;
  color: var(--misc);
  transition: transform .2s;
  margin-left: 4px;
}
.card-header.open .card-toggle { transform: rotate(180deg); }

.card-body { padding: 20px; display: none; }
.card-header.open + .card-body { display: block; }

/* ============ FORM ELEMENTS ============ */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 16px;
}

.form-row.three { grid-template-columns: 1fr 1fr 1fr; }

.field { display: flex; flex-direction: column; }

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--dark-text);
  margin-bottom: 6px;
}

.field label .req { color: var(--primary); }

.field input,
.field select,
.field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  background: white;
  color: var(--dark-text);
  transition: border-color .15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.field textarea { resize: vertical; min-height: 60px; font-family: inherit; }

::placeholder { color: #9CA3AF; }

.section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #5B4FE3;
  margin: 28px 0 14px 0;
  padding-bottom: 0;
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title:first-child { margin-top: 0; }

.subsection-title {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  margin: 24px 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============ DRAPEAUX ROUGES ============ */
.flags-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.flag-chip {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all .15s;
}

.flag-chip:hover { border-color: var(--primary); }

.flag-chip .ras {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #E3F5EA;
  color: #2BAE76;
}

.flag-chip.flagged {
  border-color: var(--error);
  background: #FFF1F1;
}
.flag-chip.flagged .ras { background: var(--error); color: white; }

/* ============ FACTEURS DE RISQUE ============ */
.risk-factors { display: flex; flex-direction: column; gap: 8px; }

.risk-factor {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--lighter-grey);
  border-radius: 6px;
}

.risk-label {
  font-size: 13px;
  font-weight: 500;
  min-width: 160px;
  color: var(--dark-text);
}

.ras-btn {
  padding: 5px 14px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: white;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  color: var(--misc);
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}

.ras-btn.active {
  background: #E3F5EA;
  border-color: #2BAE76;
  color: #2BAE76;
}

.ras-btn:not(.active) {
  background: #FFF1F1;
  border-color: var(--error);
  color: var(--error);
}

.risk-input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  background: white;
  color: var(--dark-text);
  transition: all .15s;
}

.risk-input:disabled {
  background: var(--lighter-grey);
  border-color: transparent;
  color: var(--misc);
}

.risk-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ============ EVA SLIDER ============ */
.intensity-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}
.intensity-row label { min-width: 120px; font-weight: 500; font-size: 13px; }
.intensity-row input[type=range] { flex: 1; accent-color: var(--primary); }
.intensity-value {
  min-width: 36px;
  text-align: center;
  font-weight: 600;
  color: var(--primary);
  font-size: 16px;
}

/* ============ BODY DIAGRAM ============ */
.body-diagram {
  display: flex;
  gap: 16px;
  align-items: center;
  background: var(--lighter-grey);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.body-thumbs { display: flex; flex-direction: column; gap: 8px; }
.body-thumb {
  width: 48px; height: 64px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px;
  color: var(--misc);
  font-weight: 500;
}
.body-thumb.selected { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

.body-main {
  flex: 1;
  height: 280px;
  background: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px dashed var(--border);
}

.body-diagram-capture {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.body-diagram-capture img {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
}

.pain-marker {
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--error);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--error);
}

/* ============ TRAME BANNER ============ */
.trame-banner {
  background: linear-gradient(135deg, var(--primary-soft) 0%, #FFF 100%);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.trame-banner-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
}

.trame-banner-text { flex: 1; font-size: 13px; }
.trame-banner-text strong { display: block; margin-bottom: 2px; }
.trame-banner-text span { color: var(--misc); font-size: 12px; }

.trame-banner select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--dark-text);
  cursor: pointer;
}

/* ============ EXAM TABLE ============ */
.exam-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 8px;
}

.exam-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--misc);
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 8px 12px;
  background: var(--lighter-grey);
}
.exam-table th:first-child { border-radius: 6px 0 0 6px; }
.exam-table th:last-child { border-radius: 0 6px 6px 0; }

.exam-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.exam-table input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12px;
  font-family: inherit;
}

.exam-table .label-cell { font-weight: 500; color: var(--dark-text); }
.exam-table .unit { color: var(--misc); font-size: 11px; margin-left: 4px; }

/* ============ EXAM GRID (2 colonnes desktop) ============ */
.exam-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.exam-col { display: flex; flex-direction: column; gap: 32px; }

.exam-block .section-title:first-child { margin-top: 0; }

.fields-stack { display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 1023px) {
  .exam-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .exam-col { gap: 0; }
  .exam-col-right { order: 0; }
}

/* ============ AMPLITUDE BUTTONS ============ */
.amplitude-grid { display: flex; flex-direction: column; gap: 8px; }

.amplitude-movement {
  background: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 8px;
}

.amplitude-label {
  font-weight: 500;
  font-size: 14px;
  color: #111827;
  margin: 24px 0 10px 0;
}

.amplitude-movement:first-child .amplitude-label { margin-top: 0; }

.amplitude-sides { display: flex; flex-direction: column; gap: 8px; }

.amplitude-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.side-label {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #EEF0FE;
  color: #5B4FE3;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.amplitude-btns { display: flex; gap: 6px; flex: 1; }

.amp-btn {
  flex: 1;
  padding: 8px 6px;
  border: none;
  border-radius: 6px;
  background: #F4F5F7;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: #6B7280;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}

.amp-btn:hover { background: #EDE9FE; color: #5B4FE3; }

/* --- État actif par défaut (violet sobre) --- */
.amp-btn.active {
  background: #5B4FE3;
  color: #FFFFFF;
}

/* --- Ancienneté : gradient urgent → installé --- */
[data-group="tf-anciennete"] .seg-btn[data-value="sa"].active { background: #FEE2E2; color: #111827; box-shadow: 0 1px 2px rgba(254,226,226,.5); }
[data-group="tf-anciennete"] .seg-btn[data-value="a"].active  { background: #FEF3C7; color: #111827; box-shadow: 0 1px 2px rgba(254,243,199,.5); }
[data-group="tf-anciennete"] .seg-btn[data-value="sub"].active { background: #DBEAFE; color: #111827; box-shadow: 0 1px 2px rgba(219,234,254,.5); }
[data-group="tf-anciennete"] .seg-btn[data-value="ch"].active { background: #E0E7FF; color: #111827; box-shadow: 0 1px 2px rgba(224,231,255,.5); }

/* --- Intensité : bénin → sévère --- */
[data-group="tf-intensite"] .seg-btn[data-value="fm"].active { background: #DCFCE7; color: #111827; box-shadow: 0 1px 2px rgba(220,252,231,.5); }
[data-group="tf-intensite"] .seg-btn[data-value="ie"].active { background: #FEE2E2; color: #111827; box-shadow: 0 1px 2px rgba(254,226,226,.5); }

/* --- Type de douleur : violet neutre (défaut seg-btn.active) --- */

/* --- Enraidissement musculaire : anatomique --- */
[data-group="tf-enraid-princ"] .seg-btn.active { background: #E0E7FF; color: #3730A3; box-shadow: 0 1px 2px rgba(224,231,255,.5); }

/* --- Type musculaire : neurologique --- */
[data-group="tf-enraid-princ-type"] .seg-btn.active,
[data-group="tf-enraid-assoc-type"] .seg-btn.active { background: #FEF3C7; color: #92400E; box-shadow: 0 1px 2px rgba(254,243,199,.5); }

/* --- Douloureux : binaire médical --- */
[data-group="tf-enraid-princ-doul"] .seg-btn[data-value="oui"].active,
[data-group="tf-enraid-assoc-doul"] .seg-btn[data-value="oui"].active { background: #FEE2E2; color: #991B1B; box-shadow: 0 1px 2px rgba(254,226,226,.5); }
[data-group="tf-enraid-princ-doul"] .seg-btn[data-value="non"].active,
[data-group="tf-enraid-assoc-doul"] .seg-btn[data-value="non"].active { background: #DCFCE7; color: #166534; box-shadow: 0 1px 2px rgba(220,252,231,.5); }

/* --- Réaction liquidienne : gradient gris → bleu --- */
[data-group="tf-reaction-liq"] .seg-btn[data-value="abs"].active { background: #F3F4F6; color: #111827; box-shadow: 0 1px 2px rgba(243,244,246,.5); }
[data-group="tf-reaction-liq"] .seg-btn[data-value="pv"].active  { background: #DBEAFE; color: #111827; box-shadow: 0 1px 2px rgba(219,234,254,.5); }
[data-group="tf-reaction-liq"] .seg-btn[data-value="v"].active   { background: #93C5FD; color: #111827; box-shadow: 0 1px 2px rgba(147,197,253,.5); }
[data-group="tf-reaction-liq"] .seg-btn[data-value="tv"].active  { background: #60A5FA; color: #FFFFFF; box-shadow: 0 1px 2px rgba(96,165,250,.5); }

/* ============ SEGMENTED CONTROL (amplitudes D/G) ============ */
.seg-control {
  max-width: 480px;
  background: #F4F5F7;
  border-radius: 10px;
  padding: 4px;
  display: flex;
  gap: 2px;
}

.seg-btn {
  flex: 1;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 150ms;
  background: transparent;
  color: #6B7280;
  border: none;
  border-radius: 8px;
  position: relative;
}

/* Séparateurs entre segments inactifs */
.seg-btn:not(:last-child):not(.active)::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 20%;
  height: 60%;
  width: 1px;
  background: #E5E7EB;
}
.seg-btn.active + .seg-btn::after,
.seg-btn:has(+ .active)::after { background: transparent; }

.seg-btn:not(.active):hover {
  background: #E5E7EB;
}

.seg-btn.active {
  background: #5B4FE3;
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(91, 79, 227, 0.25);
}

/* ============ TROUBLE FONCTIONNEL LAYOUT ============ */
.tf-body { display: flex; flex-direction: column; gap: 28px; }

.tf-block {}

.tf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.tf-col { display: flex; flex-direction: column; gap: 16px; }

.tf-field { margin: 0; }
.tf-field label { margin-bottom: 8px; }

.tf-pair {
  display: flex;
  gap: 24px;
}
.tf-pair > .field { flex: 1; }

.seg-control--full { max-width: none; }
.seg-control--full .seg-btn {
  white-space: normal;
  line-height: 1.2;
  padding: 8px 6px;
}

@media (max-width: 1023px) {
  .tf-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ============ ACTE LIST ============ */
.acte-list { display: flex; flex-direction: column; gap: 6px; }

.acte-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--lighter-grey);
  border-radius: 6px;
  transition: background .15s;
}

.acte-row:has(input[type=checkbox]:checked) {
  background: var(--primary-soft);
}

.acte-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-width: 180px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dark-text);
}

.acte-check input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.acte-detail {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  background: white;
  color: var(--dark-text);
  transition: all .15s;
}

.acte-detail:disabled {
  background: var(--lighter-grey);
  border-color: transparent;
  color: var(--misc);
}

.acte-detail:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ============ BILAN COMPARAISON ============ */
.bilan-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 40px;
  align-items: start;
}
.bilan-movement--full { grid-column: span 2; }

.bilan-label {
  font-weight: 500;
  font-size: 14px;
  color: #111827;
  margin: 0 0 12px 0;
}

.bilan-sides { display: flex; flex-direction: column; gap: 16px; }

.bilan-side-block {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.bilan-side-block .side-label { margin-top: 6px; }

.bilan-stack { flex: 1; display: flex; flex-direction: column; gap: 6px; }

.bilan-line-v {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bilan-line-v .seg-control { max-width: none; flex: 1; }

.bilan-tag {
  font-size: 10px;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: .3px;
  min-width: 38px;
  flex-shrink: 0;
}

/* Avant : gris neutre / Après : violet */
.seg-control--avant .seg-btn.active {
  background: #9CA3AF;
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(156,163,175,.25);
}
.seg-control--apres .seg-btn.active {
  background: #5B4FE3;
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(91,79,227,.25);
}

/* Bilan bottom : conseils + prochain RDV */
.bilan-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  margin-top: 8px;
}

.bilan-bottom-col {}

.label-with-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.label-with-actions label { margin-bottom: 0; }

.label-actions { display: flex; gap: 8px; }

.action-icon {
  width: 16px; height: 16px;
  color: #6B7280;
  cursor: pointer;
  transition: color .15s;
}
.action-icon:hover { color: #5B4FE3; }

.btn-agenda {
  width: 100%;
  padding: 10px 16px;
  background: #F4F5F7;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .15s;
}
.btn-agenda:hover { background: #ECEDF1; }

@media (max-width: 1023px) {
  .bilan-grid-2col { grid-template-columns: 1fr; }
  .bilan-movement--full { grid-column: span 1; }
  .bilan-bottom-grid { grid-template-columns: 1fr; }
}

/* ============ PAYMENT ============ */
.payment-methods {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.pay-method {
  padding: 14px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all .15s;
}
.pay-method:hover { border-color: var(--primary); }
.pay-method.selected { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.pay-method .icon { font-size: 18px; display: block; margin-bottom: 4px; }
.pay-method .icon svg { width: 20px; height: 20px; stroke: var(--misc); }
.pay-method.selected .icon svg { stroke: var(--primary); }

/* ============ RIGHT PANEL ============ */
.right-panel {
  background: white;
  border-left: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
}

.panel-section { margin-bottom: 24px; }

.panel-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--misc);
  margin-bottom: 10px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-row .key { color: var(--misc); }
.info-row .val { font-weight: 500; }

.history-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--lighter-grey);
  margin-bottom: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s;
}
.history-item:hover { background: var(--primary-soft); }
.history-item .date {
  font-weight: 600;
  color: var(--primary);
  display: block;
  margin-bottom: 2px;
}
.history-item .motif { color: var(--dark-text); }

/* ============ AUTOSAVE ============ */
.autosave {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--misc);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
}
.autosave .dot {
  width: 8px; height: 8px;
  background: #2BAE76;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

.shortcut {
  display: inline-block;
  padding: 1px 6px;
  background: var(--lighter-grey);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
  font-family: monospace;
  color: var(--misc);
}

/* ============ PROPOSAL BANNER ============ */
.proposal-banner {
  background: #FFF6E0;
  border-bottom: 1px solid #F0D78A;
  padding: 8px 24px;
  font-size: 12px;
  color: #8A6500;
  text-align: center;
  font-weight: 500;
}
.proposal-banner strong { color: #5C4400; }
