/* Style « Frutiger Aero » : ciel aqua, verre dépoli, boutons brillants, bulles. */

:root {
  --aqua: #14b8a6;
  --aqua-clair: #5eead4;
  --aqua-fonce: #0d9488;
  --aqua-bleu: #0ea5e9;
  --vert-pale: #e6f5f2;
  --texte: #123538;
  --gris: #4f6f75;
  --bordure: rgba(255, 255, 255, .85);
  --verre: rgba(255, 255, 255, .62);
  --erreur: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texte);
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(255, 255, 255, .8) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, #c4ecfa 0%, #a4def2 30%, #74c8e7 60%, #47abda 85%, #3599c9 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Bulles décoratives en fond (aucun clic possible dessus) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle 140px at 92% 18%, rgba(255, 255, 255, .28) 0%, rgba(255, 255, 255, .28) 58%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(circle 90px at 88% 16%, rgba(255, 255, 255, .38) 0%, rgba(255, 255, 255, .38) 58%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(circle 60px at 6% 42%, rgba(255, 255, 255, .35) 0%, rgba(255, 255, 255, .35) 58%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(circle 34px at 9% 38%, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, .45) 58%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(circle 110px at 96% 72%, rgba(255, 255, 255, .25) 0%, rgba(255, 255, 255, .25) 58%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(circle 48px at 94% 69%, rgba(255, 255, 255, .4) 0%, rgba(255, 255, 255, .4) 58%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(circle 70px at 12% 88%, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .3) 58%, rgba(255, 255, 255, 0) 62%);
}

::selection { background: rgba(20, 184, 166, .3); }

/* ===== Décor aqua : eau, rayons, bulles, poissons, vagues ===== */
.fond-aqua {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* Rayons de lumière qui plongent dans l'eau */
.rayons {
  position: absolute;
  top: -12%;
  left: 15%;
  width: 70%;
  height: 130%;
  background: repeating-linear-gradient(
    112deg,
    rgba(255, 255, 255, .13) 0 26px,
    rgba(255, 255, 255, 0) 26px 110px
  );
  filter: blur(28px);
  transform: rotate(3deg);
}

/* Vagues qui glissent le long du bas de l'écran */
.vagues { position: absolute; left: 0; right: 0; bottom: 0; height: 150px; }
.vague {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100%;
  fill: rgba(255, 255, 255, .25);
  animation: glisser 24s linear infinite;
}
.vague-2 {
  fill: rgba(14, 116, 144, .3);
  bottom: -16px;
  opacity: .7;
  animation-duration: 38s;
  animation-direction: reverse;
}
@keyframes glisser { to { transform: translateX(-50%); } }

/* Bulles qui remontent */
.bulle {
  position: absolute;
  bottom: -50px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .25) 55%, rgba(255, 255, 255, .08) 100%);
  box-shadow: inset -2px -2px 6px rgba(255, 255, 255, .55), 0 0 4px rgba(255, 255, 255, .35);
  animation: monter 12s linear infinite;
}
.b1 { left: 7%;  width: 14px; height: 14px; animation-duration: 11s; }
.b2 { left: 19%; width: 8px;  height: 8px;  animation-duration: 15s; animation-delay: -6s; }
.b3 { left: 34%; width: 18px; height: 18px; animation-duration: 10s; animation-delay: -3s; }
.b4 { left: 52%; width: 10px; height: 10px; animation-duration: 13s; animation-delay: -9s; }
.b5 { left: 68%; width: 22px; height: 22px; animation-duration: 12s; animation-delay: -5s; }
.b6 { left: 84%; width: 12px; height: 12px; animation-duration: 14s; animation-delay: -2s; }
.b7 { left: 94%; width: 9px;  height: 9px;  animation-duration: 16s; animation-delay: -11s; }
@keyframes monter {
  0%   { transform: translateY(0); opacity: 0; }
  8%   { opacity: .8; }
  88%  { opacity: .8; }
  100% { transform: translateY(-112vh); opacity: 0; }
}

/* Poissons : dessin SVG coloré par la classe */
.poisson { position: absolute; }
.poisson .corps, .poisson .queue, .poisson .nageoire { fill: currentColor; }
.poisson .queue { opacity: .85; }
.poisson .brillant { fill: #fff; opacity: .45; }
.poisson .oeil { fill: #123538; }
.poisson .reflet-oeil { fill: #fff; }
.poisson .ouie { fill: none; stroke: rgba(18, 53, 56, .25); stroke-width: 2.5; stroke-linecap: round; }

/* Un poisson traverse lentement tout l'écran */
.nageur {
  position: absolute;
  top: 24%;
  left: -170px;
  width: 110px;
  color: #ff8c42;
  animation: nager 80s linear infinite;
}
.nageur .poisson {
  position: static;
  width: 100%;
  animation: onduler 4.5s ease-in-out infinite alternate;
}
@keyframes nager { to { transform: translateX(calc(100vw + 340px)); } }
@keyframes onduler { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }

/* Les autres poissons restent sur place et ondulent doucement */
.flotte { animation: flotter 6s ease-in-out infinite alternate; }
.flotte-a { top: 15%; left: 5%;  width: 72px; color: #ff8c42; }
.flotte-b { top: 58%; left: 82%; width: 92px; color: #f4657f; animation-duration: 8s; }
.flotte-c { top: 76%; left: 18%; width: 54px; color: #ffd23f; animation-duration: 7s; animation-delay: -3s; }
.regarde-gauche { animation-name: flotter-gauche; }
@keyframes flotter {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes flotter-gauche {
  0%, 100% { transform: scaleX(-1) translateY(0); }
  50%      { transform: scaleX(-1) translateY(-12px); }
}

/* Si l'utilisateur préfère limiter les animations : décor figé */
@media (prefers-reduced-motion: reduce) {
  .fond-aqua * { animation: none !important; }
}

/* En-tête et onglets : bandeau de verre */
.entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .42));
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 4px 18px rgba(13, 148, 136, .12);
}
.marque { display: flex; align-items: center; gap: 12px; }
.entete h1 {
  margin: 0; font-size: 18px; font-weight: 700; line-height: 1.2;
  background: linear-gradient(180deg, #0f766e, #134e4a);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.entete p { margin: 0; font-size: 12.5px; color: var(--gris); }

/* Logo : bille brillante façon aqua */
.logo {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 13px;
  background:
    radial-gradient(90% 55% at 30% 12%, rgba(255, 255, 255, .85) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #5eead4 0%, #14b8a6 55%, #0d9488 100%);
  color: #fff; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 4px 10px rgba(13, 148, 136, .35);
  text-shadow: 0 1px 2px rgba(15, 118, 110, .5);
}

.onglets {
  display: flex;
  gap: 4px;
  padding: 6px 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .3));
  backdrop-filter: blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border-top: 1px solid rgba(255, 255, 255, .8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 3px 12px rgba(13, 148, 136, .08);
  overflow-x: auto;
}
.onglet {
  font: inherit;
  padding: 9px 16px;
  margin: 4px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--gris);
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.onglet:hover { color: var(--texte); background: rgba(255, 255, 255, .45); }
.onglet.actif {
  color: #0b5c54; font-weight: 600;
  background: linear-gradient(180deg, #ffffff 0%, #d6f7f0 100%);
  border-color: rgba(255, 255, 255, .95);
  box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(13, 148, 136, .22);
}

/* Mise en page */
.contenu {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 32px;
}
.page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.page[hidden] { display: none; }

.suivi {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.colonne, .principal { display: grid; gap: 20px; min-width: 0; }
.principal[hidden], .carte[hidden] { display: none; }

@media (max-width: 900px) {
  .suivi { grid-template-columns: minmax(0, 1fr); }
  .entete, .onglets, .contenu { padding-left: 16px; padding-right: 16px; }
}

/* Cartes : panneaux de verre dépoli */
.carte {
  background: var(--verre);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  border: 1px solid var(--bordure);
  border-radius: 16px;
  padding: 20px 22px;
  min-width: 0;
  overflow-x: auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    0 10px 28px rgba(12, 74, 110, .12);
}
.carte h2 {
  margin: 0 0 12px; font-size: 16px; font-weight: 700;
  color: #0b5c54;
}
.carte-titre {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.carte-titre h2 { margin: 0; }
.sous-titre { margin: 20px 0 10px; font-size: 14px; }

/* Fiche patiente */
.carte label + label { margin-top: 10px; }
.pastilles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pastilles:empty { display: none; }

.pastille {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe3e7, #fbd5da);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 1px 3px rgba(164, 22, 43, .2);
  color: #a4162b;
  font-size: 12px;
  font-weight: 600;
}
.pastille.neutre {
  background: linear-gradient(180deg, #ffffff, #e7eef2);
  color: #344054; font-weight: 500;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 3px rgba(52, 64, 84, .18);
}
.pastille.bon {
  background: linear-gradient(180deg, #e6fbe9, #cff3d6);
  color: #166534;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 1px 3px rgba(22, 101, 52, .18);
}
.pastille.alerte {
  background: linear-gradient(180deg, #feeaea, #fcd4d4);
  color: #991b1b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 1px 3px rgba(153, 27, 27, .2);
}
.pastille.attention {
  background: linear-gradient(180deg, #fef6d8, #fdeab8);
  color: #92400e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 1px 3px rgba(146, 64, 14, .2);
}
.pastille.orientation {
  background: linear-gradient(180deg, #efecfe, #ded8fb);
  color: #3730a3;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 1px 3px rgba(55, 48, 163, .2);
}

/* Équipe référente */
.equipe { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.equipe li { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 32px; height: 32px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff; font-size: 12px; font-weight: 700;
  background:
    radial-gradient(90% 55% at 30% 12%, rgba(255, 255, 255, .7) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, #5eead4, #0d9488);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 2px 6px rgba(13, 148, 136, .3);
  text-shadow: 0 1px 2px rgba(15, 118, 110, .5);
}
.equipe strong { display: block; font-size: 14px; font-weight: 600; }
.equipe span { display: block; font-size: 12.5px; color: var(--gris); }

/* Indicateurs : petites tuiles de verre brillantes */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.kpi {
  background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .55));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--bordure);
  border-radius: 16px;
  padding: 14px 18px;
  display: grid;
  gap: 2px;
  box-shadow: inset 0 1px 0 #fff, 0 6px 18px rgba(12, 74, 110, .1);
}
.kpi span { font-size: 12px; color: var(--gris); }
.kpi strong {
  font-size: 26px; font-weight: 700; line-height: 1.25;
  color: #0b5c54;
}
.kpi em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--aqua-fonce); min-height: 1em; }

/* Courbe */
.graphique { position: relative; height: 320px; }
.legende { font-size: 12.5px; color: var(--gris); display: flex; align-items: center; gap: 6px; }
.legende i {
  width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(80% 60% at 30% 25%, #ccfbf1, #14b8a6);
  box-shadow: 0 1px 3px rgba(13, 148, 136, .4);
}
.legende-aide { margin-left: 8px; }
@media (max-width: 700px) { .legende-aide { display: none; } }

/* Tableaux */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 700;
  color: #0b5c54;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(13, 148, 136, .25);
  background: linear-gradient(180deg, rgba(94, 234, 212, .18), rgba(94, 234, 212, 0));
}
td { padding: 12px 10px; border-bottom: 1px solid rgba(13, 148, 136, .12); }
tr:last-child td { border-bottom: 0; }
td.vide { color: #7ba1a8; }

.barre { display: flex; align-items: center; gap: 8px; }
.barre .piste {
  width: 90px; height: 8px; border-radius: 4px;
  background: rgba(13, 148, 136, .15);
  box-shadow: inset 0 1px 2px rgba(13, 148, 136, .25);
  overflow: hidden;
}
.barre .remplissage {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(180deg, #5eead4, #14b8a6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}

/* Boutons : capsules brillantes */
.bouton {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border: 1px solid rgba(13, 148, 136, .9);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, 0) 48%),
    linear-gradient(180deg, #5eead4 0%, #14b8a6 55%, #0d9488 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(15, 118, 110, .55);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 3px 8px rgba(13, 148, 136, .35);
}
.bouton:hover:not(:disabled) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 48%),
    linear-gradient(180deg, #7ef0de 0%, #2dd4bf 55%, #14b8a6 100%);
}
.bouton:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 1px 3px rgba(13, 148, 136, .35); }
.bouton:disabled { opacity: .55; cursor: default; }
.bouton[hidden] { display: none; }
.bouton.secondaire, .bouton.contour {
  background: linear-gradient(180deg, #ffffff 0%, #eef8f6 100%);
  color: #0b5c54;
  border: 1px solid rgba(13, 148, 136, .4);
  text-shadow: none;
  box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(13, 148, 136, .15);
}
.bouton.contour { font-weight: 500; font-size: 13.5px; }
.bouton.secondaire:hover:not(:disabled), .bouton.contour:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffffff 0%, #d9f5ef 100%);
}
.bouton.petit { padding: 4px 12px; font-size: 13px; }
.bouton.icone {
  padding: 4px 8px;
  border: 1px solid transparent;
  background: none;
  color: var(--gris);
  font-size: 15px;
  font-weight: 400;
  text-shadow: none;
  box-shadow: none;
}
.bouton.icone:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffffff, #d9f5ef);
  color: var(--aqua-fonce);
}

/* Formulaires */
.grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.large { grid-column: 1 / -1; }
label { display: grid; gap: 4px; font-size: 12.5px; color: var(--gris); }
input, select {
  font: inherit;
  font-size: 14px;
  color: var(--texte);
  padding: 9px 12px;
  border: 1px solid rgba(13, 148, 136, .35);
  border-radius: 10px;
  background: linear-gradient(180deg, #fdfffe, #f2fbf9);
  box-shadow: inset 0 1px 3px rgba(13, 148, 136, .12);
  min-width: 0;
}
input::placeholder { color: #8ab4ba; }
input:focus, select:focus, .bouton:focus-visible, .onglet:focus-visible {
  outline: none;
  border-color: var(--aqua);
  box-shadow: inset 0 1px 3px rgba(13, 148, 136, .08), 0 0 0 3px rgba(20, 184, 166, .28);
}
.choix-patiente { max-width: 320px; margin-bottom: 12px; }
.choix-ligne { display: flex; flex-wrap: wrap; gap: 14px; }
.choix-ligne .choix-patiente { flex: 1 1 260px; margin-top: 0; }
.actions { display: flex; gap: 10px; margin-top: 16px; }

/* Saisie d'un examen (une ligne sous le tableau) */
.saisie { margin-top: 12px; padding-top: 16px; border-top: 1px dashed rgba(13, 148, 136, .35); }
.saisie-titre { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--aqua-fonce); }
.saisie-titre:empty { display: none; }
.saisie-ligne {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.saisie-ligne label { flex: 0 0 auto; }
.saisie-ligne input, .saisie-ligne select { height: 38px; }
.saisie-ligne input[type="datetime-local"] { width: 210px; }
.saisie-ligne input[type="number"] { width: 118px; }
.saisie-ligne select { width: 130px; }
.saisie-ligne .souple { flex: 1 1 220px; }
.saisie-boutons { display: flex; gap: 8px; }

/* Messages */
.message { margin: 8px 0 0; font-size: 13px; color: var(--gris); min-height: 1em; }
.message:empty { margin: 0; min-height: 0; }
.message.erreur { color: var(--erreur); }
.message.ok { color: var(--aqua-fonce); }
