/* ==========================================================================
   SHELL MÉDECIN — Layout interne au cadre desktop/tablette pour le profil Médecin
   Sidebar + header + zone de contenu, partagé entre tous les écrans M02-M12
   ========================================================================== */

.med-shell {
  width: 100%;
  height: 100%;
  display: flex;
  background: #F8F9FA;
  overflow: hidden;
}

/* ---------- SIDEBAR INTERNE ---------- */

.med-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #FFFFFF;
  border-right: 1px solid #E4E6E2;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  transition: width 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.med-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 20px;
  margin-bottom: 12px;
}

.med-sidebar__brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
}

.med-sidebar__brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.med-sidebar__brand-name {
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #4A90E2;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
}

.med-sidebar__brand-tag {
  font-size: 9px;
  color: #9CA09A;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 1px;
  font-weight: 500;
}

.med-sidebar__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
  overflow-y: auto;
}

.med-sidebar__section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #9CA09A;
  font-weight: 600;
  padding: 14px 8px 6px;
}

.med-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #64695F;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
}

.med-nav-item__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: currentColor;
}

.med-nav-item__label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.med-nav-item__badge {
  background: #BB3A0A;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 9999px;
  min-width: 18px;
  text-align: center;
}

.med-nav-item:hover {
  background: #F2F2F2;
  color: #3A3E38;
}

.med-nav-item.is-active {
  background: #E8F1FB;
  color: #1A5DA0;
  font-weight: 600;
}

.med-nav-item.is-active .med-nav-item__icon {
  color: #4A90E2;
}

.med-sidebar__divider {
  height: 1px;
  background: #F2F2F2;
  margin: 12px 16px;
}

/* Profil médecin en bas de sidebar */
.med-sidebar__profile {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #F2F2F2;
  margin-top: auto;
  cursor: pointer;
  transition: background 150ms ease;
}

.med-sidebar__profile:hover {
  background: #F8F9FA;
}

.med-sidebar__profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px #E4E6E2;
}

.med-sidebar__profile-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.med-sidebar__profile-name {
  font-size: 12px;
  font-weight: 600;
  color: #3A3E38;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.med-sidebar__profile-status {
  font-size: 10px;
  color: #2D8A4E;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-weight: 500;
}

.med-sidebar__profile-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #2D8A4E;
  border-radius: 50%;
  display: block;
}

/* ---------- HEADER ---------- */

.med-header {
  height: 64px;
  background: #FFFFFF;
  border-bottom: 1px solid #E4E6E2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}

.med-header__title {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.med-header__breadcrumb {
  font-size: 11px;
  color: #9CA09A;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 4px;
}

.med-header__heading {
  font-family: 'Prompt', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #3A3E38;
  line-height: 1.2;
}

.med-header__search {
  flex: 1;
  max-width: 400px;
  margin: 0 auto;
  position: relative;
}

.med-header__search-input {
  width: 100%;
  height: 36px;
  padding: 0 14px 0 38px;
  background: #F8F9FA;
  border: 1px solid #E4E6E2;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: #3A3E38;
  transition: all 150ms ease;
}

.med-header__search-input::placeholder {
  color: #9CA09A;
}

.med-header__search-input:focus {
  background: #FFFFFF;
  border-color: #4A90E2;
  outline: none;
  box-shadow: 0 0 0 3px #E8F1FB;
}

.med-header__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9CA09A;
  pointer-events: none;
}

.med-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.med-header__action-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #64695F;
  cursor: pointer;
  transition: all 150ms ease;
  position: relative;
}

.med-header__action-btn:hover {
  background: #F2F2F2;
  color: #3A3E38;
}

.med-header__action-btn-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  background: #BB3A0A;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
}

.med-header__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 150ms ease;
}

.med-header__user:hover {
  background: #F2F2F2;
}

.med-header__user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.med-header__user-name {
  font-size: 13px;
  font-weight: 500;
  color: #3A3E38;
}

/* ---------- ZONE DE CONTENU ---------- */

.med-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.med-content__inner {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
}

/* ==========================================================================
   ADAPTATION TABLETTE — sidebar en mode rail (icônes seules)
   ========================================================================== */

.frame--tablet .med-sidebar {
  width: 64px;
}

.frame--tablet .med-sidebar__brand-name,
.frame--tablet .med-sidebar__brand-tag,
.frame--tablet .med-nav-item__label,
.frame--tablet .med-nav-item__badge,
.frame--tablet .med-sidebar__profile-info,
.frame--tablet .med-sidebar__section-label {
  display: none;
}

.frame--tablet .med-sidebar__brand {
  justify-content: center;
  padding: 0 0 16px 0;
}

.frame--tablet .med-nav-item {
  justify-content: center;
  padding: 10px 8px;
}

.frame--tablet .med-sidebar__profile {
  justify-content: center;
  padding: 12px 8px;
}

.frame--tablet .med-content__inner {
  padding: 20px 24px;
}

.frame--tablet .med-header {
  padding: 0 16px;
}

.frame--tablet .med-header__search {
  display: none;
}

.frame--tablet .med-header__user-name {
  display: none;
}

/* ==========================================================================
   COMPOSANTS MÉDECIN PARTAGÉS
   ========================================================================== */

/* Card générique */
.med-card {
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid #E4E6E2;
  padding: 20px;
}

.med-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.med-card__title {
  font-family: 'Prompt', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #3A3E38;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.med-card__title-icon {
  color: #4A90E2;
}

.med-card__action {
  font-size: 12px;
  color: #4A90E2;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 150ms ease;
}

.med-card__action:hover {
  background: #E8F1FB;
}

/* Boutons partagés */
.med-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  height: 40px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.med-btn--primary {
  background: #4A90E2;
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(74, 144, 226, 0.2);
}

.med-btn--primary:hover {
  background: #3A7BC8;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
  transform: translateY(-1px);
}

.med-btn--secondary {
  background: #FFFFFF;
  color: #3A3E38;
  border-color: #E4E6E2;
}

.med-btn--secondary:hover {
  border-color: #4A90E2;
  color: #4A90E2;
  background: #E8F1FB;
}

.med-btn--ghost {
  background: transparent;
  color: #64695F;
}

.med-btn--ghost:hover {
  background: #F2F2F2;
  color: #3A3E38;
}

.med-btn--danger {
  background: #BB3A0A;
  color: #FFFFFF;
}

.med-btn--danger:hover {
  background: #8F2C08;
}

.med-btn--lg {
  height: 48px;
  font-size: 14px;
  padding: 0 24px;
}

.med-btn--sm {
  height: 32px;
  font-size: 12px;
  padding: 0 12px;
}

/* Status badges */
.med-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  letter-spacing: 0.2px;
}

.med-badge--success {
  background: #E3F4E8;
  color: #2D8A4E;
}

.med-badge--info {
  background: #E8F1FB;
  color: #1A5DA0;
}

.med-badge--warning {
  background: #FBF1DD;
  color: #8B6914;
}

.med-badge--danger {
  background: #FBE9E1;
  color: #BB3A0A;
}

.med-badge--neutral {
  background: #F2F2F2;
  color: #64695F;
}

.med-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Avatar patient partagé entre tous les écrans Médecin */
.patient-avatar-img {
  flex-shrink: 0;
  display: block;
  object-position: top center;
  border: 2px solid rgba(0, 0, 0, 0.06);
}
