/* ==========================================================================
   M11 : FICHE PATIENT
   Préfixe : patient-
   ========================================================================== */

/* ---------- ÉCRAN GLOBAL ---------- */

.patient-screen {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ---------- EN-TÊTE PATIENT ---------- */

.patient-header {
  background: #FFFFFF;
  border: 1px solid #E4E6E2;
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  opacity: 0;
  animation: patient-fade-in 380ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.patient-header__info {
  flex: 1;
  min-width: 0;
}

.patient-header__name {
  font-family: 'Prompt', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #3A3E38;
  margin: 0 0 4px;
}

.patient-header__meta {
  font-size: 13px;
  color: #64695F;
  margin-bottom: 10px;
}

.patient-header__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.patient-header__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- ONGLETS ---------- */

.patient-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid #E4E6E2;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.patient-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #64695F;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 150ms ease;
  font-family: inherit;
  white-space: nowrap;
}

.patient-tab:hover {
  color: #4A90E2;
  background: #F8F9FA;
  border-radius: 6px 6px 0 0;
}

.patient-tab.is-active {
  color: #4A90E2;
  font-weight: 600;
  border-bottom-color: #4A90E2;
}

/* ---------- CONSTANTES (vitals) ---------- */

.patient-vitals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.patient-vital {
  background: #FFFFFF;
  border: 1px solid #E4E6E2;
  border-radius: 10px;
  padding: 14px 16px;
  opacity: 0;
  animation: patient-fade-in 380ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: box-shadow 200ms ease;
}

.patient-vital:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07);
}

.patient-vital__label {
  font-size: 10px;
  color: #9CA09A;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-bottom: 6px;
}

.patient-vital__value {
  font-family: 'Prompt', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #3A3E38;
  line-height: 1.1;
}

.patient-vital__unit {
  font-size: 11px;
  color: #9CA09A;
  font-weight: 400;
  margin-top: 2px;
}

.patient-vital__trend {
  font-size: 11px;
  margin-top: 6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.patient-vital__trend.is-ok {
  color: #2D8A4E;
}

.patient-vital__trend.is-ok::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #2D8A4E;
  border-radius: 50%;
  display: block;
}

.patient-vital__trend.is-warning {
  color: #8B6914;
}

.patient-vital__trend.is-warning::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #8B6914;
  border-radius: 50%;
  display: block;
}

/* ---------- GRILLE VUE D'ENSEMBLE ---------- */

.patient-overview-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: start;
}

/* ---------- TIMELINE ---------- */

.patient-timeline {
  display: flex;
  flex-direction: column;
}

.patient-timeline-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  opacity: 0;
  animation: patient-fade-in 380ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.patient-timeline-item__left {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.patient-timeline-item__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4A90E2;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 2px #4A90E2;
  flex-shrink: 0;
  margin-top: 3px;
  z-index: 1;
}

.patient-timeline-item__dot.is-current {
  background: #2D8A4E;
  box-shadow: 0 0 0 2px #2D8A4E;
}

.patient-timeline-item__line {
  width: 2px;
  flex: 1;
  background: #E4E6E2;
  margin-top: 6px;
  min-height: 20px;
}

.patient-timeline-item:last-child .patient-timeline-item__line {
  display: none;
}

.patient-timeline-item__body {
  padding: 0 0 20px 12px;
}

.patient-timeline-item__date {
  font-size: 11px;
  color: #9CA09A;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  margin-bottom: 3px;
}

.patient-timeline-item__title {
  font-size: 13px;
  font-weight: 600;
  color: #3A3E38;
  margin-bottom: 3px;
  line-height: 1.3;
}

.patient-timeline-item__desc {
  font-size: 12px;
  color: #64695F;
  line-height: 1.45;
}

/* ---------- CARTES LATÉRALES (allergies, traitements, antécédents) ---------- */

.patient-side-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.patient-side-card {
  background: #FFFFFF;
  border: 1px solid #E4E6E2;
  border-radius: 10px;
  padding: 14px 16px;
  opacity: 0;
  animation: patient-fade-in 380ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.patient-side-card__title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #9CA09A;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.patient-allergie-item {
  font-size: 12px;
  color: #BB3A0A;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

.patient-allergie-item::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #BB3A0A;
  border-radius: 50%;
  flex-shrink: 0;
}

.patient-traitement-item,
.patient-antecedent-item {
  font-size: 12px;
  color: #3A3E38;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.45;
  padding: 2px 0;
}

.patient-traitement-item::before,
.patient-antecedent-item::before {
  content: '';
  width: 4px;
  height: 4px;
  background: #9CA09A;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.patient-empty-note {
  font-size: 12px;
  color: #9CA09A;
  font-style: italic;
}

/* ---------- LISTES (onglets secondaires) ---------- */

.patient-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.patient-list-item {
  background: #FFFFFF;
  border: 1px solid #E4E6E2;
  border-radius: 10px;
  padding: 14px 20px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 150ms ease;
  opacity: 0;
  animation: patient-fade-in 380ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.patient-list-item:hover {
  border-color: #4A90E2;
  box-shadow: 0 4px 14px rgba(74, 144, 226, 0.1);
  transform: translateY(-1px);
}

.patient-list-item__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #E8F1FB;
  color: #4A90E2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.patient-list-item__title {
  font-size: 13px;
  font-weight: 600;
  color: #3A3E38;
  margin-bottom: 3px;
  line-height: 1.3;
}

.patient-list-item__meta {
  font-size: 12px;
  color: #64695F;
  line-height: 1.3;
}

.patient-list-item__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

/* ---------- ANIMATIONS ---------- */

@keyframes patient-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- TABLETTE ---------- */

.frame--tablet .patient-header {
  padding: 16px 18px;
  gap: 14px;
  flex-wrap: wrap;
}

.frame--tablet .patient-header__name {
  font-size: 17px;
}

.frame--tablet .patient-header__actions {
  width: 100%;
  justify-content: flex-end;
}

.frame--tablet .patient-vitals {
  grid-template-columns: repeat(2, 1fr);
}

.frame--tablet .patient-overview-grid {
  grid-template-columns: 1fr;
}

.frame--tablet .patient-tabs {
  overflow-x: auto;
  scrollbar-width: none;
}

.frame--tablet .patient-tabs::-webkit-scrollbar {
  display: none;
}

.frame--tablet .patient-tab {
  padding: 10px 12px;
  font-size: 12px;
}
