@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ================== Base ================== */

* {
  font-family: 'Inter', sans-serif;
}

/* Largeur de la sidebar (toutes tailles) */
#sidebar.sidebar-collapsed {
  width: 4rem;
}

#sidebar.sidebar-expanded {
  width: 16rem;
}

/* Légère marge des sous-menus */
.submenu-item {
  margin-left: 0.75rem;
}

/* ================== Carrousel ================== */

.carousel-container {
  scroll-behavior: smooth;
}

.carousel-container::-webkit-scrollbar {
  display: none;
}

.carousel-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ================== Scrollbar sidebar ================== */

.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.3);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 163, 175, 0.5);
}

.dark .sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(75, 85, 99, 0.4);
}

.dark .sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(75, 85, 99, 0.6);
}

/* Firefox scrollbar */
.sidebar-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 163, 175, 0.3) transparent;
}

.dark .sidebar-scroll {
  scrollbar-color: rgba(75, 85, 99, 0.4) transparent;
}

/* Scrollbar visible uniquement au survol */
.sidebar-scroll::-webkit-scrollbar-thumb {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-scroll:hover::-webkit-scrollbar-thumb {
  opacity: 1;
}

/* ================== Badge notification ================== */

.notification-badge {
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ================== États de menu ================== */

.menu-item-active {
  background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
  color: white;
  border-left: 4px solid #2dd4bf;
  border-radius: 0 0.5rem 0.5rem 0;
}

.menu-item-active .menu-icon {
  color: white;
}

.submenu-active {
  background-color: rgba(45, 212, 191, 0.1);
  border-left: 4px solid #2dd4bf;
  border-radius: 0 0.5rem 0.5rem 0;
}

.dark .submenu-active {
  background-color: rgba(45, 212, 191, 0.2);
}

/* ================== Divers ================== */

.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.sidebar-overlay {
  backdrop-filter: blur(4px);
}

/* En mode réduit, on cache le texte du menu */
.sidebar-collapsed .menu-text {
  display: none;
}

/* Tooltip en mode réduit */
.sidebar-collapsed .tooltip .tooltip-text {
  bottom: 50%;
  left: 100%;
  transform: translateY(50%);
  margin-left: 10px;
}

/* ================== Tooltip menu ================== */

.menu-tooltip {
  position: fixed;
  background-color: #1f2937;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.2s ease-in-out;
  white-space: nowrap;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.menu-tooltip.show {
  opacity: 1;
}

/* Bulle sous l’icône module (bandeau header) */
.menu-tooltip.menu-tooltip--header {
  transform: translateX(-50%);
  font-size: 0.8125rem;
  max-width: 16rem;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
}

.menu-tooltip.menu-tooltip--header::before {
  top: -5px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: #1f2937;
  border-right-color: transparent;
}

.dark .menu-tooltip.menu-tooltip--header::before {
  border-bottom-color: #374151;
}

.menu-tooltip::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -5px;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #1f2937;
}

.dark .menu-tooltip {
  background-color: #374151;
}

.dark .menu-tooltip::before {
  border-right-color: #374151;
}

/* ================== Layout RTL ================== */

/* Sidebar à droite en RTL */
html[dir="rtl"] #sidebar {
  left: auto;
  right: 0;
  border-right-width: 0;
  border-left-width: 1px;
}

/* Sous-menus : inversion du décalage */
html[dir="rtl"] .submenu-item {
  padding-left: 0 !important;
  margin-left: 0 !important;
  margin-right: 0.75rem !important;
}

/* États actifs : bordure à droite en RTL */
html[dir="rtl"] .menu-item-active {
  border-left: 0 !important;
  border-right: 4px solid #2dd4bf !important;
  border-radius: 0.5rem 0 0 0.5rem !important;
}

html[dir="rtl"] .submenu-active {
  border-left: 0 !important;
  border-right: 4px solid #2dd4bf !important;
  border-radius: 0.5rem 0 0 0.5rem !important;
}

/* Tooltip : flèche inversée en RTL */
html[dir="rtl"] .menu-tooltip::before {
  left: auto !important;
  right: -5px !important;
  border-right-color: transparent !important;
  border-left-color: #1f2937 !important;
}

html.dark[dir="rtl"] .menu-tooltip::before {
  border-left-color: #374151 !important;
}

/* ================== Positionnement du contenu (desktop / tablette) ================== */
/* Piloté par la classe .is-collapsed ajoutée par main-shell.js                         */

/* Valeurs par défaut : pas de marge (utile pour mobile aussi) */
#main-content {
  margin-left: 0;
  margin-right: 0;
}

/* Saisie soin / devis / dossier : occupe toute la hauteur sous le header (pt-16) */
#main-content:has(.jade-saisie-page),
#main-content:has(.jade-dossier-page) {
  box-sizing: border-box;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#main-content:has(.jade-saisie-page) > .jade-saisie-page,
#main-content:has(.jade-dossier-page) > .jade-dossier-page {
  flex: 1 1 auto;
  min-height: 0;
}

/* Contenu SPA : largeur max sur grands écrans (sidebar exclue) */
#main-content > * {
  width: 100%;
}

@media (min-width: 1536px) {
  #main-content > * {
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
  }
}

.jade-page-shell {
  width: 100%;
  max-width: 1920px;
  margin-left: auto;
  margin-right: auto;
}

/* Overlay drawer sidebar (mobile / tablette ≤1023px) */
#mobile-overlay {
  z-index: 25;
}

#mobile-overlay.is-visible {
  display: block;
}

/* ================== Dossier patient : datatables + actions ================== */
.dossier-layout {
  flex-direction: row;
  min-height: 0;
}

.dossier-layout .tableaux {
  min-width: 0;
  flex: 1 1 auto;
}

.dossier-actions-col {
  width: 10rem;
  flex: 0 0 10rem;
  border-right: 1px solid rgb(226 232 240);
  background-color: rgb(248 250 252);
  padding: 0.5rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.dark .dossier-actions-col {
  border-right-color: rgb(51 65 85);
  background-color: rgb(15 23 42);
}

/* Ne jamais écraser Tailwind .hidden sur les panneaux d'onglets */
.dossier-actions-col > [id^="actions-"].hidden {
  display: none !important;
}

.dossier-actions-col > [id^="actions-"]:not(.hidden) {
  display: block;
  width: 100%;
}

.dossier-actions-col > [id^="actions-"]:not(.hidden).space-y-2 > button,
.dossier-actions-col > [id^="actions-"]:not(.hidden) > button {
  width: 100%;
}

.dossier-actions-col > [id^="actions-"]:not(.hidden).space-y-2 {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (max-width: 767px) {
  .dossier-layout {
    flex-direction: column;
  }

  .dossier-actions-col {
    width: 100%;
    flex: 0 0 auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid rgb(226 232 240);
    overflow-x: auto;
    overflow-y: visible;
  }

  .dark .dossier-actions-col {
    border-bottom-color: rgb(51 65 85);
  }

  .dossier-actions-col > [id^="actions-"]:not(.hidden).space-y-2 {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .dossier-actions-col > [id^="actions-"]:not(.hidden).space-y-2 > button {
    flex: 1 1 calc(50% - 0.375rem);
    min-width: 7rem;
    width: auto !important;
  }
}

@media (min-width: 1280px) {
  .dossier-actions-col {
    width: 10rem;
    flex-basis: 10rem;
  }
}

.jade-data-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}

.jade-data-table th,
.jade-data-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

#table-devis .jade-data-table th:nth-child(1),
#table-devis .jade-data-table td:nth-child(1) { width: 2.25rem; }
#table-devis .jade-data-table th:nth-child(2),
#table-devis .jade-data-table td:nth-child(2) { width: 7%; }
#table-devis .jade-data-table th:nth-child(3),
#table-devis .jade-data-table td:nth-child(3) { width: 7%; }
#table-devis .jade-data-table th:nth-child(7),
#table-devis .jade-data-table td:nth-child(7) { width: 9%; }
#table-devis .jade-data-table th:nth-child(8),
#table-devis .jade-data-table td:nth-child(8) { width: 9%; }
#table-devis .jade-data-table th:nth-child(9),
#table-devis .jade-data-table td:nth-child(9) { width: 24%; white-space: normal; word-break: break-word; }
#table-devis .jade-data-table th:nth-child(10),
#table-devis .jade-data-table td:nth-child(10) { width: 8%; }
#table-devis .jade-data-table th:nth-child(11),
#table-devis .jade-data-table td:nth-child(11) { width: 11%; }

@media (max-width: 1279px) {
  #table-devis .jade-data-table th:nth-child(3),
  #table-devis .jade-data-table td:nth-child(3) { display: none; }
}

@media (max-width: 1023px) {
  #table-devis .jade-data-table th:nth-child(4),
  #table-devis .jade-data-table td:nth-child(4),
  #table-devis .jade-data-table th:nth-child(5),
  #table-devis .jade-data-table td:nth-child(5),
  #table-devis .jade-data-table th:nth-child(6),
  #table-devis .jade-data-table td:nth-child(6) { display: none; }
}

@media (max-width: 767px) {
  #table-devis .jade-data-table th:nth-child(8),
  #table-devis .jade-data-table td:nth-child(8),
  #table-devis .jade-data-table th:nth-child(11),
  #table-devis .jade-data-table td:nth-child(11) { display: none; }
}

/* PLAN */
#table-plan table.jade-data-table th:nth-child(1),
#table-plan table.jade-data-table td:nth-child(1) { width: 2.25rem; }
#table-plan table.jade-data-table th:nth-child(6),
#table-plan table.jade-data-table td:nth-child(6) { width: 32%; white-space: normal; word-break: break-word; }

@media (max-width: 1279px) {
  #table-plan table.jade-data-table th:nth-child(2),
  #table-plan table.jade-data-table td:nth-child(2) { display: none; }
}

@media (max-width: 1023px) {
  #table-plan table.jade-data-table th:nth-child(3),
  #table-plan table.jade-data-table td:nth-child(3),
  #table-plan table.jade-data-table th:nth-child(4),
  #table-plan table.jade-data-table td:nth-child(4),
  #table-plan table.jade-data-table th:nth-child(5),
  #table-plan table.jade-data-table td:nth-child(5) { display: none; }
}

@media (max-width: 767px) {
  #table-plan table.jade-data-table th:nth-child(8),
  #table-plan table.jade-data-table td:nth-child(8) { display: none; }
}

/* RÉALISÉ */
#table-realise table.jade-data-table th:nth-child(1),
#table-realise table.jade-data-table td:nth-child(1) { width: 2.25rem; }
#table-realise table.jade-data-table th:nth-child(8),
#table-realise table.jade-data-table td:nth-child(8) { width: 28%; white-space: normal; word-break: break-word; }

@media (max-width: 1279px) {
  #table-realise table.jade-data-table th:nth-child(5),
  #table-realise table.jade-data-table td:nth-child(5),
  #table-realise table.jade-data-table th:nth-child(6),
  #table-realise table.jade-data-table td:nth-child(6) { display: none; }
}

@media (max-width: 1023px) {
  #table-realise table.jade-data-table th:nth-child(3),
  #table-realise table.jade-data-table td:nth-child(3),
  #table-realise table.jade-data-table th:nth-child(4),
  #table-realise table.jade-data-table td:nth-child(4),
  #table-realise table.jade-data-table th:nth-child(7),
  #table-realise table.jade-data-table td:nth-child(7) { display: none; }
}

@media (max-width: 767px) {
  #table-realise table.jade-data-table th:nth-child(10),
  #table-realise table.jade-data-table td:nth-child(10) { display: none; }
}

/* FACTURES */
#table-factures table.jade-data-table th:nth-child(1),
#table-factures table.jade-data-table td:nth-child(1) { width: 2.25rem; }
#table-factures table.jade-data-table th:nth-child(4),
#table-factures table.jade-data-table td:nth-child(4) { width: 34%; white-space: normal; word-break: break-word; }

@media (max-width: 1279px) {
  #table-factures table.jade-data-table th:nth-child(6),
  #table-factures table.jade-data-table td:nth-child(6) { display: none; }
}

@media (max-width: 1023px) {
  #table-factures table.jade-data-table th:nth-child(7),
  #table-factures table.jade-data-table td:nth-child(7) { display: none; }
}

@media (max-width: 767px) {
  #table-factures table.jade-data-table th:nth-child(2),
  #table-factures table.jade-data-table td:nth-child(2) { display: none; }
}

/* RÈGLEMENTS */
#table-reglements table.jade-data-table th:nth-child(1),
#table-reglements table.jade-data-table td:nth-child(1) { width: 2.25rem; }
#table-reglements table.jade-data-table th:nth-child(5),
#table-reglements table.jade-data-table td:nth-child(5) { width: 30%; white-space: normal; word-break: break-word; }
#table-reglements table.jade-data-table th:nth-child(6),
#table-reglements table.jade-data-table td:nth-child(6) { width: 11%; }

@media (max-width: 1279px) {
  #table-reglements table.jade-data-table th:nth-child(3),
  #table-reglements table.jade-data-table td:nth-child(3) { display: none; }
}

@media (max-width: 1023px) {
  #table-reglements table.jade-data-table th:nth-child(4),
  #table-reglements table.jade-data-table td:nth-child(4),
  #table-reglements table.jade-data-table th:nth-child(7),
  #table-reglements table.jade-data-table td:nth-child(7) { display: none; }
}

@media (max-width: 767px) {
  #table-reglements table.jade-data-table th:nth-child(8),
  #table-reglements table.jade-data-table td:nth-child(8) { display: none; }
}

.jade-toolbar-btn {
  flex: 1 1 auto;
  min-width: 5.5rem;
  padding: 0.5rem 0.75rem !important;
  font-size: clamp(0.65rem, 1.8vw, 0.75rem) !important;
  white-space: nowrap;
}

/* Actions patient : onglets style Jade Win32 / Delphi (On / Off) — tous visibles (wrap) */
.jade-dossier-actions-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 2px;
  overflow-x: visible;
  padding: 7px 8px 0;
  background-color: #c5ced9;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.35) 0.6px, transparent 0.7px),
    linear-gradient(180deg, #d5dde6 0%, #b8c2cf 100%);
  background-size: 3px 3px, 100% 100%;
  border-bottom: 1px solid #6b7280;
}

.jade-dossier-action-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: flex-end;
}

.jade-dossier-action-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 0;
  margin: 0;
  margin-bottom: 0;
  padding: 0.28rem 0.55rem 0.32rem;
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  color: #9aa0a8;
  background: linear-gradient(180deg, #f4f6f8 0%, #e4e8ee 55%, #d8dde5 100%);
  border: 1px solid #8b93a0;
  border-bottom: none;
  border-radius: 5px 5px 0 0;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.95),
    inset -1px 0 0 rgba(120, 128, 140, 0.35);
  transition: none;
}

.jade-dossier-action-tab.is-off {
  color: #9aa0a8;
  z-index: 1;
}

.jade-dossier-action-tab.is-on {
  z-index: 3;
  color: #111827;
  font-weight: 600;
  padding-bottom: 0.42rem;
  margin-bottom: -1px;
  background: linear-gradient(180deg, #fbfbfc 0%, #f3f4f6 100%);
  border-color: #6b7280;
  box-shadow:
    inset 1px 1px 0 #fff,
    inset -1px 0 0 rgba(120, 128, 140, 0.25);
}

/* Coupe la ligne basse sous l’onglet actif (relié au panneau) */
.jade-dossier-action-tab.is-on::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: #f3f4f6;
}

.jade-dossier-action-tab:hover.is-off {
  color: #6b7280;
  background: linear-gradient(180deg, #f7f8fa 0%, #e9edf2 100%);
}

.jade-dossier-action-badge {
  position: absolute;
  top: 2px;
  right: 3px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ef4444;
  border: 1px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  z-index: 4;
}

.jade-dossier-action-tab .status-dot.jade-dossier-action-badge {
  top: 2px;
  right: 3px;
}

.dark .jade-dossier-actions-tabs {
  background-color: #334155;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.06) 0.6px, transparent 0.7px),
    linear-gradient(180deg, #475569 0%, #334155 100%);
  border-bottom-color: #94a3b8;
}

.dark .jade-dossier-action-tab {
  color: #94a3b8;
  background: linear-gradient(180deg, #64748b 0%, #475569 100%);
  border-color: #94a3b8;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.18),
    inset -1px 0 0 rgba(0, 0, 0, 0.25);
}

.dark .jade-dossier-action-tab.is-on {
  color: #f8fafc;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-color: #cbd5e1;
}

.dark .jade-dossier-action-tab.is-on::after {
  background: #0f172a;
}

@media (min-width: 640px) {
  .jade-dossier-action-tab {
    font-size: 0.78rem;
    padding: 0.32rem 0.85rem 0.36rem;
    min-width: 5.25rem;
  }
}

.jade-quick-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .jade-quick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .jade-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

#tab-montant-total-bar .flex {
  min-width: 0 !important;
  width: 100%;
}

/* ================== Dossier patient : grille principale ================== */
.jade-dossier-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr);
  grid-template-rows: auto minmax(280px, 1fr);
  grid-template-areas:
    "patient dental"
    "tables tables";
  min-height: 0;
  height: 100%;
}

#menuDossier,
.jade-saisie-side {
  grid-area: patient;
  min-width: 0;
  min-height: 0;
}

/* Dossier / Visu RDV : même norme visuelle que Soins
   Colonne gauche patient | droite = classeur DEVIS→RÈGL. (schéma = vignette header) */
.jade-dossier-page.jade-dossier-grid {
  grid-template-columns: minmax(220px, 30%) minmax(0, 1fr);
  grid-template-areas: "patient tables";
  grid-template-rows: minmax(0, 1fr);
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
  box-sizing: border-box;
}

@media (min-width: 1536px) {
  .jade-dossier-page.jade-dossier-grid {
    grid-template-columns: minmax(260px, 28%) minmax(0, 1fr);
  }
}

.jade-dossier-page #menuDossier {
  height: 100% !important;
  min-height: 0 !important;
  align-self: stretch;
  display: flex !important;
  flex-direction: column !important;
}

.jade-dossier-page #infoDossier {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  border-width: 4px !important;
  border-color: #14b8a6 !important;
  background: #fffbeb;
  border-radius: 0.75rem;
  overflow: hidden;
}

.dark .jade-dossier-page #infoDossier {
  background: #1e293b;
  border-color: #0d9488 !important;
}

.jade-dossier-page #infoDossier > .flex-1 {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex;
  flex-direction: column;
}

.jade-dossier-page #tab-patient {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Critique : sans ça, display:flex ci-dessus écrase .hidden → Visu RDV laisse
   l’espace patient (vide + synthèse) au-dessus des RDV. */
.jade-dossier-page #tab-patient.hidden {
  display: none !important;
}

.jade-dossier-page #jade-fin-synthese {
  margin-top: 0;
  flex-shrink: 0;
}

/* Arcade synthèse (lecture seule) dans la colonne patient */
.jade-dossier-page .jade-synthese-schema {
  min-height: 160px;
  max-height: min(46vh, 340px);
  border: 1px solid rgb(203 213 225);
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #f8fafc 0%, #eef6f4 100%);
  overflow: hidden;
}
.dark .jade-dossier-page .jade-synthese-schema {
  border-color: rgb(51 65 85);
  background: linear-gradient(180deg, #0f172a 0%, #134e4a 120%);
}
.jade-dossier-page .jade-synthese-schema__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem 0.2rem;
}
.jade-dossier-page .jade-synthese-schema__title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgb(15 118 110);
}
.dark .jade-dossier-page .jade-synthese-schema__title {
  color: rgb(94 234 212);
}
.jade-dossier-page .jade-synthese-schema__hint {
  font-size: 0.65rem;
  color: rgb(100 116 139);
}
.jade-dossier-page .jade-synthese-schema__slot {
  position: relative;
  padding: 0.15rem 0.35rem 0.45rem;
  pointer-events: none; /* informatif : pas de sélection / popup */
  user-select: none;
}
.jade-dossier-page .jade-synthese-schema__canvas {
  width: 100%;
  height: 100%;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jade-dossier-page .jade-synthese-schema__canvas svg {
  width: 100% !important;
  height: 100% !important;
  max-height: 300px;
  display: block;
  pointer-events: none !important;
}
.jade-dossier-page .jade-synthese-schema__empty {
  font-size: 0.75rem;
  color: rgb(100 116 139);
  text-align: center;
  padding: 1.5rem 0.75rem;
}

.jade-dossier-page #tab-visu {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

.jade-dossier-page #tab-visu:not(.hidden) {
  display: flex !important;
}

/* Visu RDV : liste en haut, plus de « trou » au-dessus */
.jade-dossier-page #tab-visu:not(.hidden) #rdv-filters {
  order: 0;
}
.jade-dossier-page #tab-visu:not(.hidden) #rdv-list {
  order: 1;
}
.jade-dossier-page #tab-visu:not(.hidden) #btn-ouvrir-jade-agenda {
  order: 2;
}

.jade-dossier-page #rdv-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
}

/* Schéma plein écran retiré du dossier : vignette header (comme Soins) */
.jade-dossier-page #paneauShema {
  display: none !important;
}

.jade-dossier-page #sectionBasse {
  grid-area: tables !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Plan de traitement / réalisation : masqué par défaut.
   display:flex !important uniquement si .is-panel-open (sinon reste figé sous DEVIS). */
.jade-dossier-page #sectionBasse > #modal-pat-ppt-main,
.jade-dossier-page #sectionBasse > #modal-pra-ppt-realisation,
#sectionBasse > #modal-pat-ppt-main,
#sectionBasse > #modal-pra-ppt-realisation {
  flex: 1 1 auto !important;
  align-self: stretch !important;
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  flex-direction: column !important;
  overflow: hidden !important;
  display: none !important;
}

.jade-dossier-page #sectionBasse > #modal-pat-ppt-main.is-panel-open,
.jade-dossier-page #sectionBasse > #modal-pra-ppt-realisation.is-panel-open,
#sectionBasse > #modal-pat-ppt-main.is-panel-open,
#sectionBasse > #modal-pra-ppt-realisation.is-panel-open {
  display: flex !important;
}

.jade-dossier-page #sectionBasse > #modal-pat-ppt-main > div:last-child,
.jade-dossier-page #sectionBasse > #modal-pra-ppt-realisation > div:last-child,
#sectionBasse > #modal-pat-ppt-main > div:last-child,
#sectionBasse > #modal-pra-ppt-realisation > div:last-child {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}

.jade-dossier-page #sectionBasse #blocTableaux {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 0.65rem !important;
  overflow: hidden !important;
}

/* Gestion Arcade : masquer totalement le classeur DEVIS/PLAN/… */
.jade-dossier-page #sectionBasse.is-arcade-mode #blocTableaux,
#sectionBasse.is-arcade-mode #blocTableaux {
  display: none !important;
}

/* Modal Gestion Arcade : masquée par défaut, plein panneau si .is-panel-open */
.jade-dossier-page #sectionBasse #modalGestionArcade,
#sectionBasse #modalGestionArcade {
  flex: 1 1 auto !important;
  align-self: stretch !important;
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  flex-direction: column !important;
  overflow: hidden !important;
  display: none !important;
  border-radius: 0.65rem !important;
}

.jade-dossier-page #sectionBasse #modalGestionArcade.is-panel-open,
#sectionBasse #modalGestionArcade.is-panel-open {
  display: flex !important;
}

.jade-dossier-page #sectionBasse #modalGestionArcade.is-panel-open > div:last-child,
#sectionBasse #modalGestionArcade.is-panel-open > div:last-child {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

/* Mode PLAN : barre d'onglets DEVIS/PLAN/… visible ; contenu grille masqué ; panel PDT dessous */
.jade-dossier-page #sectionBasse.is-ppt-mode #blocTableaux,
#sectionBasse.is-ppt-mode #blocTableaux {
  display: flex !important;
  flex: 0 0 auto !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.jade-dossier-page #sectionBasse.is-ppt-mode #blocTableaux > .w-full,
#sectionBasse.is-ppt-mode #blocTableaux > .w-full {
  flex: 0 0 auto !important;
  height: auto !important;
  overflow: visible !important;
}

.jade-dossier-page #sectionBasse.is-ppt-mode #blocTableaux > .w-full > :not(.jade-classeur-onglets__tabs),
#sectionBasse.is-ppt-mode #blocTableaux > .w-full > :not(.jade-classeur-onglets__tabs) {
  display: none !important;
}

.jade-dossier-page #sectionBasse.is-ppt-mode #modal-pat-ppt-main .jade-ppt-panel-head,
.jade-dossier-page #sectionBasse.is-ppt-mode #modal-pra-ppt-realisation .jade-ppt-panel-head,
#sectionBasse.is-ppt-mode #modal-pat-ppt-main .jade-ppt-panel-head,
#sectionBasse.is-ppt-mode #modal-pra-ppt-realisation .jade-ppt-panel-head {
  display: none !important;
}

.jade-dossier-page #sectionBasse.is-ppt-mode > #modal-pat-ppt-main.is-panel-open,
.jade-dossier-page #sectionBasse.is-ppt-mode > #modal-pra-ppt-realisation.is-panel-open,
#sectionBasse.is-ppt-mode > #modal-pat-ppt-main.is-panel-open,
#sectionBasse.is-ppt-mode > #modal-pra-ppt-realisation.is-panel-open {
  flex: 1 1 auto !important;
  height: auto !important;
  min-height: 0 !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}

/* Onglets gestion dossier = même chrome que classeur Soins */
.jade-dossier-page #blocTableaux.jade-classeur-onglets > .jade-classeur-onglets__tabs,
.jade-dossier-page #blocTableaux > .jade-classeur-onglets__tabs {
  display: flex !important;
  flex-shrink: 0;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.jade-dossier-page #blocTableaux .jade-classeur-onglets__tab {
  flex: 1 1 0;
  min-width: 4.5rem;
}

.jade-dossier-page #blocTableaux .dossier-layout,
.jade-dossier-page #blocTableaux .tableaux {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}

.jade-saisie-page.jade-dossier-grid {
  grid-template-columns: minmax(220px, 30%) minmax(0, 1fr);
  grid-template-areas: "patient dental";
  grid-template-rows: minmax(0, 1fr);
  /* Remplit #main-content (hauteur viewport sous le header) */
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
  box-sizing: border-box;
}

@media (min-width: 1536px) {
  .jade-saisie-page.jade-dossier-grid {
    grid-template-columns: minmax(260px, 28%) minmax(0, 1fr);
  }
}

/* Colonnes saisie / classeur : toute la hauteur */
.jade-saisie-page .jade-saisie-side,
.jade-saisie-page #paneauShema {
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  align-self: stretch;
}

.jade-saisie-page #paneauShema {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.jade-saisie-page #paneauShema > #jade-schema-actes-row {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
  align-self: stretch;
}

.jade-saisie-page #jade-classeur-onglets,
.jade-saisie-page .jade-classeur-onglets {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
}

.jade-saisie-page #jade-classeur-onglets .jade-classeur-onglets__panels,
.jade-saisie-page #jade-classeur-onglets .jade-actes-onglets__panels {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

.jade-saisie-page #jade-classeur-onglets .jade-actes-onglets__panel.is-on,
.jade-saisie-page #jade-classeur-panel-gestion.is-on {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100%;
}

.jade-saisie-page #jade-classeur-panel-gestion > #sectionBasse,
.jade-saisie-page #jade-classeur-panel-gestion #blocTableaux,
.jade-saisie-page #jade-classeur-panel-gestion #blocTableaux > .w-full,
.jade-saisie-page #jade-classeur-panel-gestion .dossier-layout {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.jade-saisie-page #jade-classeur-panel-gestion .tableaux {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}

/* Flux gestion monté dans le classeur (plus en grille tables) */
.jade-saisie-page #paneauShema > #sectionBasse {
  display: none !important;
}

/* /devis : #sectionBasse orphelin (pas de classeur) — ne doit PAS créer une 2e rangée
   grid-area:tables qui coupe l'écran en deux sous patient|dental */
.jade-saisie-page > #sectionBasse {
  display: none !important;
  grid-area: unset !important;
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  pointer-events: none !important;
}

.jade-saisie-page #sectionBasse #blocTableaux.jade-gestion-onglets,
.jade-saisie-page #blocTableaux.jade-gestion-onglets {
  border-radius: 0.65rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.jade-gestion-onglets__tabs {
  display: flex !important;
  flex-shrink: 0;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  scrollbar-width: none;
}

/* Doublon interdit : la barre DEVIS/PLAN… dans #sectionBasse est remplacée par le classeur */
#sectionBasse .jade-gestion-onglets__tabs,
#blocTableaux > .jade-gestion-onglets__tabs,
#jade-classeur-panel-gestion .jade-gestion-onglets__tabs,
.jade-gestion-onglets__tabs[hidden],
.jade-gestion-onglets__tabs.hidden {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

.jade-gestion-onglets__tabs::-webkit-scrollbar {
  display: none;
}

.dark .jade-gestion-onglets__tabs {
  border-bottom-color: #334155 !important;
  background: #1e293b !important;
}

.jade-gestion-onglets__tab,
.jade-gestion-onglets__tabs > [data-table] {
  flex: 1 1 0;
  margin: 0;
  padding: 0.45rem 0.4rem !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  border-radius: 0 !important;
}

.jade-gestion-onglets__tabs > [data-table]:hover {
  color: #0f766e !important;
  background: #f0fdfa !important;
}

.jade-gestion-onglets__tabs > [data-table].data-table-active,
.jade-gestion-onglets__tabs > [data-table].data-tab-active,
.jade-gestion-onglets__tabs > [data-table].border-b-2 {
  color: #1e40af !important;
  background: #eff6ff !important;
  border-bottom-color: #3b82f6 !important;
}

.jade-gestion-onglets__tabs > [data-table][data-table="plan"].data-table-active,
.jade-gestion-onglets__tabs > [data-table][data-table="plan"].data-tab-active {
  color: #9a3412 !important;
  background: #fff7ed !important;
  border-bottom-color: #ea580c !important;
}

.jade-gestion-onglets__tabs > [data-table][data-table="realise"].data-table-active,
.jade-gestion-onglets__tabs > [data-table][data-table="realise"].data-tab-active {
  color: #166534 !important;
  background: #f0fdf4 !important;
  border-bottom-color: #22c55e !important;
}

.jade-gestion-onglets__tabs > [data-table][data-table="factures"].data-table-active,
.jade-gestion-onglets__tabs > [data-table][data-table="factures"].data-tab-active {
  color: #a16207 !important;
  background: #fefce8 !important;
  border-bottom-color: #eab308 !important;
}

.jade-gestion-onglets__tabs > [data-table][data-table="reglements"].data-table-active,
.jade-gestion-onglets__tabs > [data-table][data-table="reglements"].data-tab-active {
  color: #6d28d9 !important;
  background: #f5f3ff !important;
  border-bottom-color: #8b5cf6 !important;
}

#paneauShema {
  grid-area: dental;
  min-width: 0;
  min-height: 0;
}

/* Plan dentaire : occupe la colonne, marge 5px */
#paneauShema > #teethContainer,
#paneauShema .jade-dental-panel {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-width: 0;
  width: 100%;
  padding: 5px;
  box-sizing: border-box;
}

.jade-dental-header {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.jade-dental-chart-wrap {
  flex: 0 1 auto;
  width: 100%;
  min-width: 0;
  display: flex;
  justify-content: stretch;
  align-items: stretch;
  padding: 5px;
  margin: 0;
  box-sizing: border-box;
}

#paneauShema #teeth-svg {
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  flex-shrink: 0;
  display: block;
}

#sectionBasse {
  grid-area: tables;
  min-width: 0;
  min-height: 0;
}

#sectionBasse #blocTableaux {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}

/* ≤ 15" : tableaux sous le plan / actes (colonne droite) */
@media (max-width: 1535px) {
  .jade-dossier-grid:not(.jade-saisie-page) {
    grid-template-areas:
      "patient dental"
      "patient tables";
    grid-template-rows: auto minmax(220px, 1fr);
  }

  .jade-saisie-page.jade-dossier-grid {
    grid-template-areas: "patient dental";
    grid-template-rows: minmax(0, 1fr);
  }

  .jade-dossier-page.jade-dossier-grid {
    grid-template-areas: "patient tables";
    grid-template-rows: minmax(0, 1fr);
  }

  #menuDossier {
    align-self: start;
  }

  .jade-dossier-page #menuDossier,
  .jade-saisie-page .jade-saisie-side {
    align-self: stretch !important;
  }

  /* Schéma dossier masqué (vignette header) */
  .jade-dossier-page #paneauShema {
    display: none !important;
  }

  .jade-dossier-page #paneauShema > #teethContainer {
    max-height: none;
  }

  /* Soins / Devis : colonne droite = classeur (schéma en vignette header) */
  .jade-saisie-page #paneauShema {
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .jade-saisie-page #paneauShema > #teethContainer.jade-schema-is-vignette,
  .jade-saisie-page #paneauShema > #teethContainer.jade-schema-vignette-in-header {
    display: none !important;
  }

  .jade-dossier-page #paneauShema #teeth-svg,
  .jade-saisie-page #paneauShema #teeth-svg {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: none;
  }

  /* Boutons d'action DEVIS/PLAN… sous le tableau (pas en colonne à gauche) */
  .dossier-layout {
    flex-direction: column;
  }

  .dossier-layout .tableaux {
    order: 1;
    flex: 1 1 auto;
    min-height: 200px;
  }

  .dossier-actions-col {
    order: 2;
    width: 100%;
    flex: 0 0 auto;
    max-height: none;
    border-right: none;
    border-top: 1px solid rgb(226 232 240);
    overflow-x: auto;
    overflow-y: visible;
  }

  .dark .dossier-actions-col {
    border-top-color: rgb(51 65 85);
  }

  .dossier-actions-col > [id^="actions-"]:not(.hidden).space-y-2 {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .dossier-actions-col > [id^="actions-"]:not(.hidden).space-y-2 > button {
    flex: 1 1 auto;
    min-width: 7.5rem;
    width: auto !important;
  }
}

/* Tablette / mobile : empilement classique */
@media (max-width: 1023px) {
  .jade-dossier-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "patient"
      "dental"
      "tables";
    grid-template-rows: auto auto minmax(240px, 1fr);
  }

  #paneauShema {
    max-height: none;
  }

  #paneauShema #teeth-svg {
    max-height: none;
  }
}

/* Table synthèse financière : champs fluides dans la colonne patient */
#table-synthese-financiere {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

#table-synthese-financiere th:nth-child(1) { width: 36%; }
#table-synthese-financiere th:nth-child(2),
#table-synthese-financiere th:nth-child(3) { width: 32%; }

#table-synthese-financiere input[readonly] {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  box-sizing: border-box;
}

#table-synthese-financiere td > div {
  width: 100%;
  min-width: 0;
}

#table-synthese-financiere td {
  overflow: hidden;
}

/* Écrasé uniquement à partir du breakpoint desktop (aligné Tailwind lg = 1024px) */
@media (min-width: 1024px) {

  /* LTR : sidebar à gauche */
  html[dir="ltr"] #main-content {
    margin-left: 16rem;
    /* sidebar ouverte */
    margin-right: 0;
  }

  html[dir="ltr"] #main-content.is-collapsed {
    margin-left: 4rem;
    /* sidebar réduite */
    margin-right: 0;
  }

  /* RTL : sidebar à droite */
  html[dir="rtl"] #main-content {
    margin-right: 16rem;
    margin-left: 0;
  }

  html[dir="rtl"] #main-content.is-collapsed {
    margin-right: 4rem;
    margin-left: 0;
  }

  /* En desktop, aucune translation : la sidebar est fixe */
  #sidebar {
    transform: none;
  }
}

/* ================== Mobile / petite tablette (≤ 1024px) ================== */
/*  - La sidebar se comporte comme un drawer qui glisse au-dessus du contenu
    - Le contenu n’a plus jamais de marge gauche/droite liée à la sidebar    */

@media (max-width: 1024px) {

  /* On force une largeur confortable pour le drawer */
  #sidebar {
    width: 16rem;
  }

  /* LTR : drawer qui vient de la gauche */
  html[dir="ltr"] #sidebar.sidebar-collapsed {
    transform: translateX(-100%);
  }

  html[dir="ltr"] #sidebar.sidebar-expanded {
    transform: translateX(0);
  }

  /* RTL : drawer qui vient de la droite */
  html[dir="rtl"] #sidebar.sidebar-collapsed {
    transform: translateX(100%);
  }

  html[dir="rtl"] #sidebar.sidebar-expanded {
    transform: translateX(0);
  }

  /* Le contenu occupe toute la largeur, sans réserver de place */
  #main-content,
  #main-content.is-collapsed {
    margin-left: 0;
    margin-right: 0;
  }
}

/* Le bouton de menu reste cliquable au-dessus de la sidebar */
#sidebar-toggle {
  position: relative;
  z-index: 50;
}
 

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.regime-content {
  display: none;
}

.regime-content.active {
  display: block;
}

.dark {
  color-scheme: dark;
}

.modal {
  display: none;
}

.modal.active {
  display: flex;
}

.required-field::after {
  content: " *";
  color: #ef4444;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}


@view-transition {
  navigation: auto;
}


        #tooth-info {
            margin: 20px auto;
            padding: 15px;
            background: #e6f7ff;
            border-radius: 8px;
            border-left: 4px solid #4682b4;
            max-width: 600px;
        }

        .tooth-section {
            opacity: 0.9;
            transition: opacity 0.3s;
        }

        .tooth-section:hover {
            opacity: 1;
        }

        .tooth-palette {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 20px;
            padding: 15px;
            background: #ecf0f1;
            border-radius: 10px;
        }

        .palette-tooth {
            width: 40px;
            height: 60px;
            background-color: #fff8f0;
            border: 2px solid #95a5a6;
            border-radius: 5px 5px 15px 15px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            font-weight: bold;
            cursor: grab;
            user-select: none;
            box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
        }

        .palette-tooth .tooth-number {
            font-size: 12px;
        }

        .palette-tooth .tooth-type {
            font-size: 10px;
            color: #7f8c8d;
        }

        .bouche {
            fill: #09c;
        }


        .gencive {
            fill: #fd8484;
        }

        .cls-3 {
            letter-spacing: -0.06em;
        }

        .numSerie {
            font-size: 72px;
        }

        .numSerie,
        .numDent {
            fill: #fcee21;
            font-family: Arial-BoldMT, Arial;
            font-weight: 700;
        }

        .numSerie,
        .numDent,
        .lignSeparateur,
        .emailDent {
            stroke-miterlimit: 10;
        }

        .numSerie,
        .numDent,
        .emailDent {
            stroke: #000;
        }

        .numDent {
            font-size: 48px;
        }

        .lignSeparateur {
            fill: none;
            stroke: #fcee21;
            stroke-width: 12px;
        }

        .racineDent {
            fill: #eaeaea;
        }

        .emailDent {
            fill: #ffffff;
            stroke-width: 0.25px;
        }

        .cacher {
            fill: #fbfbfb00;
        }

        .pocheDent {
            fill: #fc2424;
        }

        .canalRacine {
            fill: #fda1a1;
        }

        .carie {
            fill: #666;
        }

        .nerve {
            fill: #ff5559;
        }
 

        .contactPocheDent {
            fill: #232422;
        }

        .zoneDent {
            opacity: .48;
            stroke-width: 1px;
            stroke: #000;
        }

        .zoneDent {
            stroke-miterlimit: 10;
        }

        .faux-moignon {
            fill: #7a7a7a;
        }

        .active-zone {
            background-color: #007bff !important;
            color: white !important;
            border: 2px solid #0056b3 !important;
        }
        .dentAbsente{
            fill: #6495ed00;
            stroke: none;
        }

        .tooth-hover path,
        .tooth-hover rect { 
            stroke: #00f !important;
            stroke-width: 4px !important;
        }

          .color-legend {
        display: inline-block;
        width: 16px;
        height: 16px;
        border: 2px solid black;
        margin-right: 5px;
    }
      .tooth-label {
            font-size: 11px;
            text-anchor: middle;
            pointer-events: none;
            font-weight: 600;
            fill: #333;
        }

        .tooth-type {
            font-size: 13px;
            text-anchor: middle;
            font-weight: 600;
            fill: #2f4f4f;
        }
                #teeth-svg {
            display: block;
            width: 100%;
            max-width: 100%;
            height: auto;
            margin: 0;
            background: #fff;
            border-radius: 10px;
        }
        .tooth {
            stroke: #555;
            stroke-width: 1.2;
            fill: #fffaf0;
            cursor: move;

            filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.1));
        }

        .tooth:hover,
        .tooth:hover * {
          stroke: darkblue;
          stroke-width: 4;
        }

        .tooth.selected,
        .tooth.selected * { 
            stroke: #1d4ed8;
            stroke-width: 4;
            filter: drop-shadow(0 0 6px rgba(37, 99, 235, 0.55));
        }

        /* Halo visible (dossier / popup schéma) — y compris doublon vue face */
        #teeth-svg g.tooth.selected,
        #Dents > g.tooth.selected {
          outline: 3px solid rgba(37, 99, 235, 0.85);
          outline-offset: 2px;
        }
        #dents-front > g[data-number].selected > .emailDent {
          stroke: #1d4ed8 !important;
          stroke-width: 3px !important;
          filter: drop-shadow(0 0 4px rgba(37, 99, 235, 0.5));
        }

        /* Libellés / fond ne doivent jamais voler les clics dents */
        #teeth-svg #background-svg,
        #teeth-svg #numero,
        #teeth-svg .numDent,
        #teeth-svg .numSerie,
        #teeth-svg .lignSeparateur {
          pointer-events: none !important;
        }
        #teeth-svg g.tooth,
        #teeth-svg #Dents > g[data-number],
        #teeth-svg #dents-front > g[data-number] {
          pointer-events: auto !important;
          cursor: pointer;
        }

/* ================== Modules applicatifs (bandeau contexte) ================== */

#jade-top-modules .jade-module-btn--header,
#jade-top-modules-compact .jade-module-btn--header,
#jade-top-modules-mobile .jade-module-btn--header {
  color: inherit;
  text-decoration: none;
  min-width: 2rem;
  min-height: 2rem;
}

#jade-top-modules .jade-module-btn--header:hover,
#jade-top-modules-compact .jade-module-btn--header:hover,
#jade-top-modules-mobile .jade-module-btn--header:hover,
#jade-top-modules .jade-module-btn--header:focus-visible,
#jade-top-modules-compact .jade-module-btn--header:focus-visible,
#jade-top-modules-mobile .jade-module-btn--header:focus-visible {
  background: rgba(45, 212, 191, 0.12);
  outline: none;
}

#jade-top-modules .jade-module-btn--header.is-active,
#jade-top-modules-compact .jade-module-btn--header.is-active,
#jade-top-modules-mobile .jade-module-btn--header.is-active {
  background: rgba(6, 182, 212, 0.14);
  box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.35);
}

#jade-top-modules .jade-module-btn--header.is-active i,
#jade-top-modules-compact .jade-module-btn--header.is-active i,
#jade-top-modules-mobile .jade-module-btn--header.is-active i {
  color: #0891b2;
}

body.jade-module-agenda #page-title {
  color: #0e7490;
}

body.jade-module-active.jade-module-agenda #main-content {
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
}

.jade-agenda-embed-wrap {
  width: 100%;
  min-height: calc(100vh - 5.5rem);
  height: calc(100vh - 5.5rem);
  background: #f8fafc;
}

.jade-agenda-embed-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 5.5rem);
  border: 0;
}

/* ================== Palette CRUD globale — compacte, lisible, toujours présente ================== */
.jade-crud-palette {
  position: fixed;
  z-index: 9990;
  width: clamp(11.5rem, 16vw, 14rem);
  max-height: min(70vh, 32rem);
  display: flex;
  flex-direction: column;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow:
    0 12px 32px rgba(15, 23, 42, 0.28),
    0 2px 8px rgba(15, 23, 42, 0.18);
  background: #4c1d95;
  color: #fff;
  user-select: none;
  pointer-events: auto;
  touch-action: none;
  font-size: 0.8125rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.jade-crud-palette.hidden {
  display: none !important;
}

.jade-crud-palette.is-dragging {
  opacity: 0.95;
  cursor: grabbing;
}

.jade-crud-palette.is-collapsed {
  width: 2.75rem;
}

.jade-crud-palette.is-collapsed .jade-crud-palette__title,
.jade-crud-palette.is-collapsed .jade-crud-palette__label,
.jade-crud-palette.is-collapsed .jade-crud-palette__empty {
  display: none;
}

.jade-crud-palette.is-collapsed .jade-crud-palette__action {
  justify-content: center;
  padding: 0.4rem;
}

.jade-crud-palette__head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem;
  background: rgba(0, 0, 0, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  cursor: grab;
  flex-shrink: 0;
}

.jade-crud-palette.is-dragging .jade-crud-palette__head {
  cursor: grabbing;
}

.jade-crud-palette__drag {
  opacity: 0.9;
  padding: 0.15rem 0.2rem;
}

.jade-crud-palette__title {
  flex: 1;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.jade-crud-palette__pin,
.jade-crud-palette__collapse {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.jade-crud-palette__pin.is-active {
  background: rgba(255, 255, 255, 0.32);
}

.jade-crud-palette__body {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.4rem;
  min-height: 2.5rem;
  background: #5b21b6;
}

.jade-crud-palette__empty {
  font-size: 0.72rem;
  opacity: 0.9;
  text-align: center;
  padding: 0.65rem 0.35rem;
  line-height: 1.35;
}

.jade-crud-palette__list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.jade-crud-palette__action {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  border: none;
  border-radius: 0.5rem;
  padding: 0.45rem 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.jade-crud-palette__action:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
  transform: translateX(1px);
}

.jade-crud-palette__orb {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ede9fe;
  box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.jade-crud-palette__orb i {
  color: #5b21b6;
  font-size: 0.7rem;
  line-height: 1;
}

.jade-crud-palette__action.is-off {
  cursor: not-allowed;
  opacity: 0.55;
}

.jade-crud-palette__action.is-off .jade-crud-palette__orb {
  background: #cbd5e1;
}

.jade-crud-palette__action.is-off .jade-crud-palette__orb i {
  color: #64748b;
}

.jade-crud-palette__label {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pas de redondance : dès que la palette existe (sauf désactivée),
   toutes les sources CRUD inline / colonnes actions / boutons tagués disparaissent.
   La palette reste le seul point d’entrée. */
body:has(#jade-crud-palette):not(.jade-crud-palette-off) .jade-crud-source,
body:has(#jade-crud-palette):not(.jade-crud-palette-off) .dossier-actions-col,
body:has(#jade-crud-palette):not(.jade-crud-palette-off) [data-jade-crud]:not([data-jade-crud-ignore="1"]),
body.jade-crud-palette-on .jade-crud-source,
body.jade-crud-palette-on .dossier-actions-col,
body.jade-crud-palette-on [data-jade-crud]:not([data-jade-crud-ignore="1"]) {
  display: none !important;
}

/* Ne pas appliquer le masquage à l’intérieur de la palette */
#jade-crud-palette .jade-crud-source,
#jade-crud-palette [data-jade-crud],
#jade-crud-palette .dossier-actions-col {
  display: revert !important;
}

/* ================== Prototype catalogue hiérarchique Famille | Actes ================== */
.jade-cat-hier {
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  background: #fff;
  overflow: hidden;
}

.dark .jade-cat-hier {
  border-color: #475569;
  background: #0f172a;
}

.jade-cat-hier__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.dark .jade-cat-hier__head {
  border-bottom-color: #334155;
  background: #1e293b;
}

.jade-cat-hier__tabs {
  display: flex;
  gap: 0.15rem;
  flex: 1;
}

.jade-cat-hier__tabs [data-cat-tab] {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
}

.jade-cat-hier__tabs [data-cat-tab].is-active {
  color: #0f766e;
  border-bottom-color: #0f766e;
}

.dark .jade-cat-hier__tabs [data-cat-tab].is-active {
  color: #5eead4;
  border-bottom-color: #5eead4;
}

.jade-cat-hier__tabs [data-cat-tab].is-disabled,
.jade-cat-hier__tabs [data-cat-tab]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.jade-cat-hier__badge {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f766e;
  background: #ccfbf1;
  border-radius: 9999px;
  padding: 0.15rem 0.45rem;
  flex-shrink: 0;
}

.dark .jade-cat-hier__badge {
  color: #99f6e4;
  background: #134e4a;
}

.jade-cat-hier [data-cat-panel] > .mb-4 {
  margin-bottom: 0 !important;
  padding: 0.5rem;
}

.jade-cat-hier__legacy-title {
  display: none !important;
}

.jade-cat-hier__list {
  height: min(42vh, 18rem) !important;
  max-height: 18rem;
}

.jade-cat-hier__search {
  position: relative;
  margin-bottom: 0.5rem;
}

.jade-cat-hier__search input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.45rem 2rem 0.45rem 0.65rem;
  font-size: 0.75rem;
  background: #fff;
  color: #0f172a;
}

.dark .jade-cat-hier__search input {
  border-color: #475569;
  background: #1e293b;
  color: #f1f5f9;
}

.jade-cat-hier__search i {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: #94a3b8;
  pointer-events: none;
}

.jade-cat-hier__toggle {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.4rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 9999px;
  cursor: pointer;
}

.dark .jade-cat-hier__toggle {
  color: #99f6e4;
  background: #134e4a;
  border-color: #115e59;
}

#soinsActes tbody tr.selected td,
#soinsfamille tbody tr.selected td {
  background: #cffafe;
}

.dark #soinsActes tbody tr.selected td,
.dark #soinsfamille tbody tr.selected td {
  background: #155e75;
}
/* ================== PROTO ÉCRAN COMPLET (maquette Saisie soin) ================== */
body.jade-ecran-proto {
  --jade-proto-rail: 0rem;
  --jade-proto-teal: #0f766e;
  --jade-proto-teal-soft: #ccfbf1;
}

body.jade-ecran-proto #main-content,
body.jade-ecran-proto .jade-saisie-page {
  padding-right: 0 !important;
}

body.jade-ecran-proto .jade-saisie-page {
  background: #f1f5f9;
  gap: 0.5rem !important;
  padding-top: 0.35rem !important;
}

body.jade-ecran-proto .jade-ecran-proto-bar,
#jade-ecran-proto-bar,
.jade-ecran-proto-enter,
#jade-ecran-proto-enter {
  display: none !important;
}

body.jade-ecran-proto .jade-ecran-proto-bar {
  grid-column: 1 / -1;
  display: none !important;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.65rem;
  margin-bottom: 0.25rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
}

body.jade-ecran-proto .jade-ecran-proto-bar__brand {
  font-size: 0.85rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

body.jade-ecran-proto .jade-ecran-proto-bar__patient {
  flex: 1;
  min-width: 10rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}

body.jade-ecran-proto .jade-ecran-proto-bar__modes {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.15rem;
  background: #f1f5f9;
  border-radius: 9999px;
}

body.jade-ecran-proto .jade-ecran-proto-bar__modes button {
  border: none;
  background: transparent;
  padding: 0.3rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  border-radius: 9999px;
  cursor: pointer;
}

body.jade-ecran-proto .jade-ecran-proto-bar__modes button.is-active {
  background: var(--jade-proto-teal);
  color: #fff;
}

body.jade-ecran-proto .jade-ecran-proto-bar__quit {
  border: 1px solid #fca5a5;
  background: #fff;
  color: #b91c1c;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.3rem 0.55rem;
  border-radius: 9999px;
  cursor: pointer;
}

/* Catalogue : look maquette */
body.jade-ecran-proto .jade-saisie-side {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-width: 1px !important;
  box-shadow: none !important;
  border-radius: 0.75rem !important;
}

body.jade-ecran-proto .jade-saisie-side > .flex.border-b {
  background: #f8fafc !important;
}

/* Masquer onglets verticaux rotés → chips */
body.jade-ecran-proto .jade-saisie-side .w-10.bg-primary-600,
body.jade-ecran-proto .jade-saisie-side .w-10.bg-primary-700,
body.jade-ecran-proto .soins-tab-vertical {
  display: none !important;
}

body.jade-ecran-proto .jade-ecran-proto-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.35rem 0 0.55rem;
}

body.jade-ecran-proto .jade-ecran-proto-chip {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 9999px;
  cursor: pointer;
}

body.jade-ecran-proto .jade-ecran-proto-chip.is-active {
  background: var(--jade-proto-teal-soft);
  border-color: #5eead4;
  color: var(--jade-proto-teal);
}

body.jade-ecran-proto #paneauShema {
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.75rem !important;
  box-shadow: none !important;
}

body.jade-ecran-proto .jade-dental-chart-wrap {
  background: linear-gradient(180deg, #eff6ff 0%, #fff 48%, #fdf2f8 100%) !important;
}

/* Rail Actions ancré — DÉSACTIVÉ : ACTIONS sous menus sidebar */
body.jade-ecran-proto #jade-crud-palette.jade-ecran-proto-rail,
body.jade-ecran-proto #jade-crud-palette {
  /* styles remplacés par .jade-crud-palette--sidebar */
}

/* ================== ACTIONS sous les menus (sidebar) ================== */
#jade-crud-palette-slot.jade-crud-palette-slot {
  border-top: 1px solid #cbd5e1;
  padding-top: 0.5rem;
  margin-top: 0.35rem;
}

#jade-crud-palette.jade-crud-palette--sidebar,
body.jade-ecran-proto #jade-crud-palette.jade-crud-palette--sidebar,
body.jade-ecran-proto #jade-crud-palette {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  height: auto !important;
  border-radius: 0.65rem !important;
  background: #fff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
  z-index: 1 !important;
  overflow: hidden;
  transform: none !important;
  touch-action: auto;
}

#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__head,
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__head {
  background: #0f766e !important;
  color: #fff !important;
  cursor: default !important;
}

#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__title {
  font-size: 0.72rem !important;
}

#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__pin,
#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__collapse,
#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__drag,
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__pin,
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__collapse,
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__drag {
  display: none !important;
}

#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__body,
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__body {
  background: #f8fafc !important;
  overflow-y: visible !important;
  max-height: none !important;
  flex: 0 0 auto;
  padding: 0.35rem !important;
}

#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__action,
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__action {
  background: #fff !important;
  color: #0f172a !important;
  border: 1px solid #e2e8f0 !important;
  width: 100%;
}

#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__action:hover:not(:disabled),
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__action:hover:not(:disabled) {
  background: #f0fdfa !important;
  border-color: #99f6e4 !important;
  transform: none;
}

#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__action.is-off,
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__action.is-off {
  opacity: 0.45;
}

#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__orb,
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__orb {
  background: #ccfbf1 !important;
}

#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__orb i,
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__orb i {
  color: #0f766e !important;
}

/* Seul « Valider » est primaire teal — « Enregistrer le plan » reste secondaire */
#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__action.jade-crud-btn--validate,
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__action.jade-crud-btn--validate {
  background: #0f766e !important;
  color: #fff !important;
  border-color: #0f766e !important;
}

#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__action.jade-crud-btn--validate .jade-crud-palette__orb,
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__action.jade-crud-btn--validate .jade-crud-palette__orb {
  background: rgba(255, 255, 255, 0.2) !important;
}

#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__action.jade-crud-btn--validate .jade-crud-palette__orb i,
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__action.jade-crud-btn--validate .jade-crud-palette__orb i {
  color: #fff !important;
}

#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__action.jade-crud-btn--save:not(.is-off),
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__action.jade-crud-btn--save:not(.is-off) {
  background: #fff !important;
  color: #9a3412 !important;
  border-color: #fdba74 !important;
}

#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__action.jade-crud-btn--save:not(.is-off) .jade-crud-palette__orb,
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__action.jade-crud-btn--save:not(.is-off) .jade-crud-palette__orb {
  background: #fff7ed !important;
}

#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__action.jade-crud-btn--save:not(.is-off) .jade-crud-palette__orb i,
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__action.jade-crud-btn--save:not(.is-off) .jade-crud-palette__orb i {
  color: #c2410c !important;
}

#jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__action.jade-crud-btn--delete,
body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__action.jade-crud-btn--delete {
  border-color: #fecaca !important;
  color: #b91c1c !important;
}

/* Sidebar repliée : ACTIONS en icônes seules (comme le menu) */
.sidebar-collapsed #jade-crud-palette-slot {
  display: block !important;
  padding-left: 0.2rem !important;
  padding-right: 0.2rem !important;
  margin-top: 0.25rem;
}

.sidebar-collapsed #jade-crud-palette.jade-crud-palette--sidebar,
.sidebar-collapsed body.jade-ecran-proto #jade-crud-palette {
  width: 100% !important;
  max-width: 100% !important;
  border-radius: 0.5rem !important;
}

.sidebar-collapsed #jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__head {
  justify-content: center;
  padding: 0.35rem 0.15rem !important;
}

.sidebar-collapsed #jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__title {
  display: none !important;
}

.sidebar-collapsed #jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__body {
  padding: 0.25rem 0.15rem !important;
}

.sidebar-collapsed #jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__list {
  align-items: center;
  gap: 0.2rem;
}

.sidebar-collapsed #jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__action,
.sidebar-collapsed body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__action {
  justify-content: center !important;
  padding: 0.3rem 0.15rem !important;
  width: auto !important;
  min-width: 0;
  border-radius: 0.45rem !important;
}

.sidebar-collapsed #jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__label,
.sidebar-collapsed #jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__empty {
  display: none !important;
}

.sidebar-collapsed #jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__orb,
.sidebar-collapsed body.jade-ecran-proto #jade-crud-palette .jade-crud-palette__orb {
  width: 1.85rem;
  height: 1.85rem;
  margin: 0;
}

.sidebar-collapsed #jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__action.jade-crud-btn--validate,
.sidebar-collapsed #jade-crud-palette.jade-crud-palette--sidebar .jade-crud-palette__action.jade-crud-btn--save {
  padding: 0.3rem 0.15rem !important;
}

body.jade-ecran-proto .jade-cat-hier__badge {
  display: none;
}

.jade-ecran-proto-enter {
  display: inline-flex;
  margin: 0 0 0.4rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  background: #0f766e;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
}

body.jade-ecran-proto .jade-ecran-proto-enter {
  display: none !important;
}

/* Règle dents → menus */
.jade-ecran-proto-chip.is-locked,
.jade-ecran-proto-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed !important;
  filter: grayscale(0.35);
}

.jade-ecran-proto-dent-hint {
  margin: 0 0 0.5rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.35;
  color: #9a3412;
  background: #ffedd5;
  border: 1px solid #fdba74;
  border-radius: 0.5rem;
}

.jade-ecran-proto-dent-hint[hidden] {
  display: none !important;
}

body.jade-dents-requises #jade-cat-hier [data-cat-panel="famille"],
body.jade-dents-requises #jade-cat-hier [data-cat-panel="actes"] {
  opacity: 1;
}

body.jade-dents-requises #soinsfamille,
body.jade-dents-requises #soinsActes {
  pointer-events: auto;
}

.jade-cat-hier__tabs [data-cat-tab].is-dents-locked {
  opacity: 0.5;
}

/* ================== Schéma dentaire : carte ~10cm (gauche) + MODALE ================== */
.jade-schema-win__hdr {
  display: flex !important;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.4rem 0.55rem !important;
  min-height: 0;
}

.jade-schema-win__hdr--card {
  align-items: center;
  flex-wrap: nowrap;
}

.jade-schema-win__title,
.jade-schema-win__hdr h3 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 700;
  order: 2;
}

.jade-schema-win__controls {
  display: none !important;
}

.jade-schema-win__btn {
  display: none !important;
}

/*
 * Anti-FOUC Soins/Devis : le SVG « ancien format » ne doit jamais
 * apparaître en haut de l’écran avant le park vignette/modale.
 * (exceptions déjà définies : .jade-schema-card__visual et #jade-schema-modal-body)
 * Mode expanded (saisie) : schéma inline visible — règles plus bas.
 */
.jade-saisie-page #teethContainer.jade-schema-is-vignette > .jade-dental-chart-wrap,
.jade-saisie-page #teethContainer.jade-schema-is-vignette .jade-dental-chart-wrap {
  position: fixed !important;
  left: -12000px !important;
  top: 0 !important;
  width: 1100px !important;
  height: 520px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

/* Soins / Devis : schéma = vignette header (clic → modale). Colonne droite = classeur. */
.jade-saisie-page #teethContainer.jade-schema-is-vignette,
.jade-saisie-page #teethContainer.jade-schema-vignette-in-header {
  display: none !important;
}

.jade-saisie-page .jade-schema-actes-row {
  flex-direction: row !important;
  align-items: stretch !important;
}

.jade-saisie-page .jade-schema-actes-row > #jade-classeur-onglets {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  width: 100% !important;
  max-width: none !important;
}


/* Conteneur vignette : bandeau bas, place pour les tables */
#teethContainer.jade-schema-is-vignette {
  max-height: none;
  flex: 0 0 auto !important;
  padding-bottom: 0.2rem !important;
  position: relative;
}

/*
 * Fallback park HORS écran (si carte pas encore montée).
 * Interdit display:none : getBBox() casse alors (dents empilées en 0,0).
 */
#teethContainer.jade-schema-is-vignette .jade-schema-chart-park {
  position: fixed !important;
  left: -12000px !important;
  top: 0 !important;
  width: 1100px !important;
  height: 520px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

#teethContainer.jade-schema-is-vignette > .jade-dental-chart-wrap {
  position: fixed !important;
  left: -12000px !important;
  top: 0 !important;
  width: 1100px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Vignette schéma dans la barre top (après nom patient) */
.jade-header-schema-slot {
  display: inline-flex;
  align-items: center;
  margin-left: 0.15rem;
}

/* Recherche universelle (après vignette) — DEVIS → RÈGL. */
.jade-header-search {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.35rem;
  /* +2 cm ≈ 76px → min/max élargis */
  min-width: 16.5rem;
  width: 20rem;
  max-width: 24rem;
  height: 2.35rem;
  padding: 0 0.65rem 0 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  box-sizing: border-box;
  vertical-align: middle;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.jade-header-search:focus-within {
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.2);
}

.jade-header-search.hidden,
.jade-header-search[hidden] {
  display: none !important;
}

.dark .jade-header-search {
  border-color: #475569;
  background: #1e293b;
}

.dark .jade-header-search:focus-within {
  border-color: #2dd4bf;
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.25);
}

.jade-header-search__icon {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: #0f766e;
}

.jade-header-search__input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  font-size: 0.78rem;
  color: #0f172a;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  -webkit-appearance: none;
  appearance: none;
}

/* Chrome/Safari : décorations type=search (carré / croix / contour) */
.jade-header-search__input::-webkit-search-decoration,
.jade-header-search__input::-webkit-search-cancel-button,
.jade-header-search__input::-webkit-search-results-button,
.jade-header-search__input::-webkit-search-results-decoration {
  display: none !important;
  -webkit-appearance: none;
}

.jade-header-search__input:focus,
.jade-header-search__input:focus-visible,
.jade-header-search__input:active {
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

.dark .jade-header-search__input {
  color: #e2e8f0;
}

.jade-header-search__input::placeholder {
  color: #94a3b8;
}

/* Masque la barre locale dès que la recherche header est active */
body.jade-header-search-on #main-content .dossier-toolbar > .relative:has(#search-input),
body.jade-header-search-on #main-content #search-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

@media (max-width: 1023px) {
  .jade-header-search {
    display: none !important;
  }
  body.jade-header-search-on #main-content .dossier-toolbar > .relative:has(#search-input),
  body.jade-header-search-on #main-content #search-input {
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

#jade-schema-vignette-slot.jade-schema-card--header,
.jade-schema-vignette-slot.jade-schema-card--header {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.35rem;
  order: 0;
  width: auto !important;
  max-width: none !important;
  height: 2.35rem;
  margin: 0;
  padding: 0.15rem 0.4rem 0.15rem 0.15rem;
  border: 1px solid #99f6e4;
  border-radius: 0.45rem;
  background: linear-gradient(165deg, #f0fdfa 0%, #fff 55%, #fdf2f8 100%);
  box-shadow: none;
  cursor: pointer;
  vertical-align: middle;
}

#jade-schema-vignette-slot.jade-schema-card--header:hover,
.jade-schema-vignette-slot.jade-schema-card--header:hover {
  border-color: #14b8a6;
  box-shadow: 0 1px 4px rgba(15, 118, 110, 0.15);
  transform: none;
}

.jade-schema-card--header .jade-schema-card__visual {
  width: 4.6rem !important;
  height: 2.05rem !important;
  aspect-ratio: auto !important;
  flex-shrink: 0;
  border-radius: 0.3rem;
}

.jade-schema-card--header .jade-schema-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  line-height: 1.1;
}

.jade-schema-card--header .jade-schema-vignette-slot__label {
  font-size: 0.65rem !important;
  font-weight: 800;
  color: #0f766e;
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jade-schema-card--header .jade-schema-card__hint {
  font-size: 0.55rem;
  color: #64748b;
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#teethContainer.jade-schema-vignette-in-header,
.jade-schema-actes-row > #teethContainer.jade-schema-is-vignette.jade-schema-vignette-in-header {
  display: none !important;
}

.jade-dental-header--empty {
  display: none !important;
}

.jade-schema-actes-row > #jade-classeur-onglets {
  flex: 1 1 auto;
  max-width: 100%;
}

/* Carte schéma (fallback hors header) */
.jade-schema-vignette-slot.jade-schema-card:not(.jade-schema-card--header),
#jade-schema-vignette-slot.jade-schema-card:not(.jade-schema-card--header) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
  order: 1;
  width: min(10cm, 42vw, 380px);
  max-width: min(10cm, 48%);
  margin: 0;
  padding: 0.35rem 0.4rem 0.4rem;
  border: 1px solid #99f6e4;
  background: linear-gradient(165deg, #f0fdfa 0%, #ffffff 48%, #fdf2f8 100%);
  color: #0f766e;
  border-radius: 0.65rem;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: left;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.12);
  flex-shrink: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.jade-schema-vignette-slot.jade-schema-card:not(.jade-schema-card--header):hover {
  border-color: #14b8a6;
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.18);
  transform: translateY(-1px);
}

.jade-schema-card--has-sel {
  border-color: #0d9488 !important;
  background: linear-gradient(165deg, #ccfbf1 0%, #ffffff 55%, #fce7f3 100%) !important;
}

.jade-schema-card--open .jade-schema-card__visual {
  opacity: 0.45;
}

.jade-schema-card__visual {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2275 / 1046;
  border-radius: 0.45rem;
  overflow: hidden;
  background: linear-gradient(135deg, #eff6ff 0%, #fdf2f8 100%);
  border: 1px solid #bae6fd;
}

/* Vrai schéma : remplit la vignette (viewBox) — plus de crop 1100px non réduit */
.jade-schema-card__visual > .jade-dental-chart-wrap {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 1 !important;
  pointer-events: none !important;
  z-index: 1 !important;
  transform: none !important;
  overflow: hidden !important;
  background: transparent !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

.jade-schema-card__visual > .jade-dental-chart-wrap #teeth-svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

.jade-schema-card__svg {
  display: none !important;
}

.jade-schema-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  padding: 0 0.15rem;
}

.jade-schema-vignette-slot.jade-schema-card .jade-schema-vignette-slot__label {
  flex: none;
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f766e;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jade-schema-card__hint {
  font-size: 0.62rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
}

.jade-schema-vignette-slot__preview,
.jade-schema-vignette-slot__cta {
  display: none !important;
}

/* Ancien style barre (si encore présent) */
.jade-schema-vignette-slot:not(.jade-schema-card) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: calc(100% - 0.5rem);
  margin: 0.15rem 0.25rem 0.25rem;
  padding: 0.4rem 0.65rem;
  border: 1px dashed #5eead4;
  background: #f0fdfa;
  color: #0f766e;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
}

.jade-schema-vignette-slot:hover {
  background: #ccfbf1;
  border-style: solid;
}

.jade-schema-vignette-slot__preview {
  width: 2rem;
  height: 1.15rem;
  border-radius: 0.25rem;
  background: linear-gradient(180deg, #fda4af 0%, #93c5fd 55%, #fda4af 100%);
  flex-shrink: 0;
}

.jade-schema-vignette-slot__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jade-schema-vignette-slot__cta {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: #0f766e;
  color: #fff;
}

/* Modale par-dessus — le SVG reste interactif */
.jade-schema-modal.hidden {
  display: none !important;
}

.jade-schema-modal {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.jade-schema-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.jade-schema-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(96vw, 1100px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 0.85rem;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
}

.dark .jade-schema-modal__dialog {
  background: #0f172a;
  border-color: #334155;
}

.jade-schema-modal__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}

.dark .jade-schema-modal__head {
  background: #1e293b;
  border-bottom-color: #334155;
}

.jade-schema-modal__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.dark .jade-schema-modal__title {
  color: #f1f5f9;
}

.jade-schema-modal__hint {
  margin: 0;
  flex: 1;
  font-size: 0.72rem;
  color: #64748b;
}

.jade-schema-modal__btn-done {
  border: 1px solid #0f766e;
  background: #0f766e;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.35rem 0.75rem;
  border-radius: 0.4rem;
  cursor: pointer;
}

.jade-schema-modal__btn-done:hover {
  background: #0d9488;
}

.jade-schema-modal__close {
  width: 2rem;
  height: 2rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 0.4rem;
  cursor: pointer;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.jade-schema-modal__close:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.jade-schema-modal__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.5rem;
  background: #fff;
}

.jade-schema-modal__body .jade-dental-chart-wrap {
  max-height: none !important;
  overflow: visible !important;
  cursor: default !important;
  display: block !important;
  width: 100% !important;
  position: relative !important;
  left: auto !important;
  top: auto !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.jade-schema-modal__body .jade-dental-chart-wrap::after {
  display: none !important;
}

.jade-schema-modal__body #teeth-svg {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: min(78vh, 720px) !important;
}

body.jade-schema-modal-on {
  overflow: hidden;
}

/* ===== Repli sélection dents (liste / grille) si SVG absent ===== */
.jade-dent-fallback {
  padding: 0.65rem 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: 720px;
  margin: 0 auto;
}
.jade-dent-fallback__msg {
  margin: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 0.45rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 0.82rem;
  font-weight: 600;
}
.jade-dent-fallback__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.45rem;
}
.jade-dent-fallback__combo-lab {
  font-size: 0.75rem;
  font-weight: 700;
  color: #334155;
  padding-top: 0.25rem;
}
.jade-dent-fallback__combo {
  min-width: 9rem;
  flex: 1 1 10rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  padding: 0.25rem;
  font-size: 0.8rem;
  background: #fff;
}
.jade-dent-fallback__apply-combo {
  border: 1px solid #0d9488;
  background: #f0fdfa;
  color: #0f766e;
  border-radius: 0.4rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.jade-dent-fallback__row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.jade-dent-fallback__lab {
  flex: 0 0 7.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
}
.jade-dent-fallback__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}
.jade-dent-pick {
  min-width: 2.15rem;
  height: 2.15rem;
  padding: 0 0.35rem;
  border: 1px solid #94a3b8;
  border-radius: 0.4rem;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.jade-dent-pick:hover {
  border-color: #0d9488;
  background: #ccfbf1;
}
.jade-dent-pick.is-on {
  border-color: #0f766e;
  background: #0d9488;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.25);
}
.jade-dent-fallback__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.25rem;
}
.jade-dent-fallback__clear {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #64748b;
  border-radius: 0.4rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.jade-dent-fallback__ok {
  border: 1px solid #0f766e;
  background: #0d9488;
  color: #fff;
  border-radius: 0.4rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.jade-dent-fallback__resume {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f766e;
}

/* ================== Rangée vignette + onglets actes ================== */
.jade-schema-actes-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  padding: 0.4rem 0.45rem 0.5rem;
  box-sizing: border-box;
}

.jade-schema-actes-row > #teethContainer.jade-schema-is-vignette {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: min(10.5cm, 40%);
  border-bottom: none !important;
  padding: 0 !important;
}

.jade-schema-actes-row > #teethContainer .jade-dental-header {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
}

.jade-schema-actes-row .jade-schema-win__title,
.jade-schema-actes-row .jade-dental-header > h3 {
  display: none !important;
}

.jade-schema-actes-row #jade-schema-vignette-slot.jade-schema-card {
  width: min(10cm, 100%);
  max-width: 10cm;
}

.jade-actes-onglets {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #fff;
  overflow: hidden;
}

.dark .jade-actes-onglets {
  border-color: #334155;
  background: #0f172a;
}

.jade-actes-onglets__tabs {
  display: flex;
  flex-shrink: 0;
  gap: 0;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.dark .jade-actes-onglets__tabs {
  border-bottom-color: #334155;
  background: #1e293b;
}

.jade-actes-onglets__tab {
  flex: 1 1 50%;
  margin: 0;
  padding: 0.45rem 0.6rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.jade-actes-onglets__tab:hover {
  color: #0f766e;
  background: #f0fdfa;
}

.jade-actes-onglets__tab.is-on[data-actes-tab-btn="arealiser"] {
  color: #92400e;
  background: #fffbeb;
  border-bottom-color: #d97706;
}

.jade-actes-onglets__tab.is-on[data-actes-tab-btn="realises"] {
  color: #1e40af;
  background: #eff6ff;
  border-bottom-color: #3b82f6;
}

.jade-actes-onglets__panels {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.jade-actes-onglets__panel {
  display: none;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.jade-actes-onglets__panel.is-on {
  display: flex;
}

.jade-actes-onglets__panel[data-actes-panel="arealiser"].is-on {
  background: rgba(255, 251, 235, 0.45);
}

.jade-actes-onglets__hint {
  flex-shrink: 0;
  padding: 0.25rem 0.55rem;
  font-size: 0.62rem;
  font-weight: 600;
  color: #b45309;
}

.jade-actes-onglets__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* Tables (Actes) : rangée prend la place sous / à côté */
.jade-saisie-page #paneauShema {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

/* Classeur unique : À réaliser | Réalisés | DEVIS | PLAN | … */
.jade-classeur-onglets,
#jade-classeur-onglets {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #fff;
  overflow: hidden;
}

.dark .jade-classeur-onglets,
.dark #jade-classeur-onglets {
  border-color: #334155;
  background: #0f172a;
}

.jade-classeur-onglets__tabs {
  display: flex !important;
  flex-shrink: 0;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  scrollbar-width: thin;
}

.dark .jade-classeur-onglets__tabs {
  border-bottom-color: #334155;
  background: #1e293b;
}

.jade-classeur-onglets__tab {
  flex: 1 1 0;
  min-width: 4.5rem;
  margin: 0;
  padding: 0.5rem 0.4rem !important;
  border: none !important;
  border-bottom: 3px solid transparent !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  line-height: 1.15;
}

.jade-classeur-onglets__tab:hover {
  color: #0f766e !important;
  background: #f0fdfa !important;
}

.jade-classeur-onglets__tab.is-on[data-classeur-tab="arealiser"],
.jade-classeur-onglets__tab.is-on[data-actes-tab-btn="arealiser"] {
  color: #92400e !important;
  background: #fffbeb !important;
  border-bottom-color: #d97706 !important;
}

.jade-classeur-onglets__tab.is-on[data-classeur-tab="realises"],
.jade-classeur-onglets__tab.is-on[data-actes-tab-btn="realises"],
.jade-classeur-onglets__tab.is-on[data-classeur-tab="realise"],
.jade-classeur-onglets__tab.data-table-active[data-classeur-tab="realise"] {
  color: #166534 !important;
  background: #f0fdf4 !important;
  border-bottom-color: #22c55e !important;
}

.jade-classeur-onglets__tab.is-on[data-classeur-tab="devis"],
.jade-classeur-onglets__tab.data-table-active[data-classeur-tab="devis"] {
  color: #1e40af !important;
  background: #eff6ff !important;
  border-bottom-color: #3b82f6 !important;
}

.jade-classeur-onglets__tab.is-on[data-classeur-tab="plan"],
.jade-classeur-onglets__tab.data-table-active[data-classeur-tab="plan"] {
  color: #9a3412 !important;
  background: #fff7ed !important;
  border-bottom-color: #ea580c !important;
}

.jade-classeur-onglets__tab.is-on[data-classeur-tab="factures"],
.jade-classeur-onglets__tab.data-table-active[data-classeur-tab="factures"] {
  color: #a16207 !important;
  background: #fefce8 !important;
  border-bottom-color: #eab308 !important;
}

.jade-classeur-onglets__tab.is-on[data-classeur-tab="reglements"],
.jade-classeur-onglets__tab.data-table-active[data-classeur-tab="reglements"] {
  color: #6d28d9 !important;
  background: #f5f3ff !important;
  border-bottom-color: #8b5cf6 !important;
}

/* Filtres praticien sous le classeur — pills charte */
button[class*="praticien-filter-"] {
  border-radius: 9999px !important;
  border: 1px solid #cbd5e1;
  font-weight: 600 !important;
  padding-left: 0.85rem !important;
  padding-right: 0.85rem !important;
}

button[class*="praticien-filter-"].bg-blue-500,
button[class*="praticien-filter-"].bg-primary-600 {
  border-color: transparent !important;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

button[class*="praticien-filter-"]:not(.bg-blue-500):not(.bg-primary-600) {
  background: #fff !important;
  color: #334155 !important;
}

.dark button[class*="praticien-filter-"]:not(.bg-blue-500):not(.bg-primary-600) {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}

.jade-classeur-onglets__panels {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.jade-classeur-onglets__panel-gestion {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.jade-classeur-onglets__panel-gestion.is-on {
  display: flex !important;
  flex-direction: column;
}

#jade-classeur-panel-gestion > #sectionBasse,
.jade-section-basse--classeur {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
}

#jade-classeur-panel-gestion #blocTableaux {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  height: 100%;
}

.jade-saisie-page #paneauShema > #jade-schema-actes-row {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
}

@media (max-width: 900px) {
  .jade-schema-actes-row {
    flex-direction: column;
  }
  .jade-schema-actes-row > #teethContainer.jade-schema-is-vignette {
    max-width: none;
  }
  .jade-schema-actes-row #jade-schema-vignette-slot.jade-schema-card {
    max-width: min(10cm, 100%);
  }
}
