#appShell [hidden] { display: none !important; }

:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-strong: #eef4f2;
  --ink: #17201d;
  --muted: #66736f;
  --line: #d9e2df;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --primary-soft: #d9f2ee;
  --warning: #b45309;
  --danger: #b42318;
  --blue: #2563eb;
  --violet: #7c3aed;
  --radius: 8px;
  --shadow: 0 16px 42px rgba(28, 44, 39, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.06), transparent 280px),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 24px;
  background: #10231f;
  color: #ecf8f5;
  box-shadow: 0 10px 28px rgba(16, 35, 31, 0.16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: #16342f;
}

.brand-mark svg {
  width: 28px;
  fill: #72e4d3;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #a8c5be;
  font-size: 13px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 0;
}

.nav-item {
  width: auto;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius);
  color: #cde0db;
  background: transparent;
  text-align: left;
  white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-icon,
.reset-icon,
.plus-icon,
.download-icon,
.upload-icon,
.logout-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  background: currentColor;
  flex: 0 0 auto;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

.calendar-icon { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 2h2v3h6V2h2v3h3v17H4V5h3V2Zm13 8H6v10h14V10Z'/%3E%3C/svg%3E"); }
.home-icon { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 3 9 8h-3v10h-5v-6h-2v6H6V11H3l9-8Z'/%3E%3C/svg%3E"); }
.users-icon { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 11a4 4 0 1 1 0-8 4 4 0 0 1 0 8Zm8.5 1a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7ZM2 21a6 6 0 0 1 12 0H2Zm11.2 0a7.9 7.9 0 0 0-1.4-4.5A5.5 5.5 0 0 1 22 19.3V21h-8.8Z'/%3E%3C/svg%3E"); }
.clock-icon { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm1 5h-2v6l5 3 1-1.7-4-2.3V7Z'/%3E%3C/svg%3E"); }
.repeat-icon { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 7h11l-3-3 1.4-1.4L22 8l-5.6 5.4L15 12l3-3H7a3 3 0 0 0-3 3H2a5 5 0 0 1 5-5Zm10 10H6l3 3-1.4 1.4L2 16l5.6-5.4L9 12l-3 3h11a3 3 0 0 0 3-3h2a5 5 0 0 1-5 5Z'/%3E%3C/svg%3E"); }
.chart-icon { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 19h16v2H2V3h2v16Zm3-8h3v6H7v-6Zm5-6h3v12h-3V5Zm5 3h3v9h-3V8Z'/%3E%3C/svg%3E"); }
.chat-icon { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 4h16v12H7l-5 5V4h2Zm2 2v10h.2l2-2H18V6H6Z'/%3E%3C/svg%3E"); }
.reset-icon { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 5a7 7 0 1 1-6.3 10H3.6A9 9 0 1 0 6 5.7V3H4v7h7V8H7.5A7 7 0 0 1 12 5Z'/%3E%3C/svg%3E"); }
.plus-icon { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6V5Z'/%3E%3C/svg%3E"); }
.download-icon { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 3h2v10l3.5-3.5 1.4 1.4L12 16.8l-5.9-5.9 1.4-1.4L11 13V3ZM5 19h14v2H5v-2Z'/%3E%3C/svg%3E"); }
.upload-icon { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 21V11l-3.5 3.5-1.4-1.4L12 7.2l5.9 5.9-1.4 1.4L13 11v10h-2ZM5 3h14v2H5V3Z'/%3E%3C/svg%3E"); }
.logout-icon { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 3h8v2H7v14h6v2H5V3Zm11.6 5.4L20.2 12l-3.6 3.6-1.4-1.4 1.2-1.2H10v-2h6.4l-1.2-1.2 1.4-1.4Z'/%3E%3C/svg%3E"); }

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 32px 16px;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 320px),
    var(--bg);
}

.auth-screen[hidden],
.app-shell[hidden] {
  display: none !important;
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.auth-card.signup-open {
  width: min(520px, 100%);
}

.auth-brand {
  grid-column: 1 / -1;
  color: var(--ink);
  padding: 0;
}

.auth-brand .brand-mark {
  background: #16342f;
}

.auth-form {
  display: grid;
  gap: 13px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(28, 44, 39, 0.06);
}

.auth-form h1,
.auth-form h2 {
  margin-bottom: 4px;
}

.signup-form {
  align-self: start;
}

.signup-help {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.profile-completion-notice {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 118, 110, 0.3);
  border-radius: var(--radius);
  background: rgba(15, 118, 110, 0.08);
  color: var(--ink);
}

.profile-completion-notice strong {
  display: block;
  margin-bottom: 4px;
  color: var(--primary);
}

.auth-message {
  min-height: 18px;
  margin-bottom: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.header-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 8px;
  color: #b8d2cc;
  font-size: 13px;
  white-space: nowrap;
}

.active-profile {
  display: flex;
  align-items: center;
  grid-template-columns: none;
  gap: 8px;
  color: #b8d2cc;
  font-size: 13px;
}

.active-profile select {
  width: 170px;
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.18);
  background: #16342f;
  color: #ecf8f5;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #37d399;
  box-shadow: 0 0 0 5px rgba(55, 211, 153, 0.12);
}

.main {
  min-width: 0;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.pilot-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #a6dfd7;
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  background: #f0fbf8;
}

.pilot-banner strong,
.pilot-banner span {
  display: block;
}

.pilot-banner span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 16px;
  font-size: 18px;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.topbar-actions,
.form-actions,
.toolbar,
.legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  min-height: 40px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 700;
}

.primary-button:hover {
  background: var(--primary-strong);
}

.secondary-button,
.icon-button {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

.secondary-button {
  padding: 0 14px;
}

.icon-button {
  width: 42px;
  display: grid;
  place-items: center;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.home-side {
  display: grid;
  gap: 18px;
}

.home-planning {
  min-width: 0;
}

.home-schedule {
  grid-template-columns: repeat(5, minmax(118px, 1fr));
  gap: 8px;
  overflow-x: auto;
}

.home-day {
  min-width: 118px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.home-day-header {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
  font-weight: 900;
}

.home-halfday {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.home-halfday:last-child {
  border-bottom: 0;
}

.home-halfday > strong {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.home-room-list {
  display: grid;
  gap: 5px;
}

.home-room-row {
  min-height: 30px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 6px;
  background: #fbfdfc;
}

.home-room-row span,
.home-room-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.home-room-row span {
  color: var(--muted);
  font-weight: 800;
}

.home-room-row em {
  color: var(--ink);
  font-style: normal;
  font-weight: 800;
}

.quick-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.home-planning-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.exchange-alert-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.exchange-alert-list {
  display: grid;
  gap: 8px;
}

.exchange-alert-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: var(--radius);
  background: #ffffff;
}

.exchange-alert-card strong,
.exchange-alert-card span {
  display: block;
}

.exchange-alert-card > div:first-child span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.exchange-alert-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.exchange-alert-card.normal-alert {
  border-left-color: #94a3b8;
}

.exchange-alert-card.month-alert {
  border-left-color: var(--warning);
}

.exchange-alert-card.urgent-alert,
.exchange-alert-card.late {
  border-left-color: var(--danger);
}

.alert-mail {
  display: inline-flex;
  align-items: center;
  color: var(--primary-strong);
  text-decoration: none;
}

.compact-empty {
  min-height: 92px;
}

.quick-link {
  min-height: 76px;
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
  color: var(--ink);
  text-align: left;
}

.quick-link:hover {
  border-color: #99d9d0;
  background: #f0fbf8;
}

.quick-link strong,
.quick-link span {
  display: block;
}

.quick-link span {
  color: var(--muted);
  font-size: 13px;
}

.exchange-link {
  border-left: 5px solid var(--primary);
}

.absence-link {
  border-left: 5px solid var(--warning);
}

.compact-form {
  gap: 11px;
}

.two-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-chat-panel {
  min-height: 360px;
}

.compact-chat {
  max-height: 230px;
  min-height: 190px;
}

.home-chat-composer {
  grid-template-columns: 120px minmax(0, 1fr);
}

.home-chat-composer button {
  grid-column: 1 / -1;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 16px;
}

.planning-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.week-picker {
  display: flex;
  align-items: center;
  grid-template-columns: none;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.week-picker input {
  width: 154px;
}

.week-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.full-week {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.holiday-week {
  background: #fef3c7;
  color: var(--warning);
}

.vacation-config {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, auto);
  gap: 12px;
  align-items: start;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.vacation-config strong,
.vacation-config span {
  display: block;
}

#vacationPeriodList {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.vacation-chip {
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid #f1d39a;
  border-radius: 999px;
  background: #fff7ed;
  color: var(--warning);
  font-size: 12px;
  font-weight: 800;
}

.vacation-period-form {
  display: grid;
  grid-template-columns: 110px 140px 140px auto;
  gap: 8px;
}

.vacation-period-form input {
  min-height: 34px;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.segmented button {
  border: 0;
  border-radius: 6px;
  min-height: 34px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segmented button.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.legend {
  color: var(--muted);
  font-size: 13px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 11px;
  height: 11px;
  border-radius: 3px;
}

.diag { background: #dbeafe; }
.inter { background: #ede9fe; }
.urgent { background: #fee2e2; }
.broncho { background: #dcfce7; }

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.day-column {
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(28, 44, 39, 0.06);
}

.day-header {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.day-date {
  display: block;
  margin-top: 4px;
  font-size: 0.875em;
  font-weight: 600;
  color: var(--muted);
}

.room-card {
  margin: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.schedule-halfday {
  margin: 10px;
  padding: 9px 0 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfa;
}

.schedule-halfday + .schedule-halfday {
  margin-top: 14px;
}

.schedule-halfday-title {
  display: flex;
  align-items: center;
  min-height: 28px;
  margin: 0 10px 8px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.schedule-halfday .room-card {
  margin: 8px;
  background: #ffffff;
}

.room-card strong,
.room-card span {
  display: block;
}

@keyframes uncovered-absence-pulse {
  0%, 100% { background-color: #fee2e2; border-color: #dc2626; }
  50% { background-color: #fca5a5; border-color: #991b1b; }
}

.room-card.uncovered-absence,
.home-room-row.uncovered-absence {
  border: 2px solid #dc2626;
  color: #7f1d1d;
  animation: uncovered-absence-pulse 1.8s ease-in-out infinite;
}

.uncovered-absence .pill,
.uncovered-absence em {
  color: #7f1d1d;
  font-weight: 800;
}

@media (prefers-reduced-motion: reduce) {
  .room-card.uncovered-absence,
  .home-room-row.uncovered-absence {
    animation: none;
    background-color: #fee2e2;
  }
}

.room-card span {
  color: var(--muted);
  font-size: 12px;
}

.room-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-weight: 700;
}

.type-diagnostic { border-left: 5px solid #60a5fa; }
.type-interventionnel { border-left: 5px solid #8b5cf6; }
.type-urgence { border-left: 5px solid #ef4444; }
.type-bronchique { border-left: 5px solid #22c55e; }
.type-autre { border-left: 5px solid #94a3b8; }

.split-layout {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.split-layout.wide-left {
  grid-template-columns: minmax(320px, 480px) minmax(0, 1fr);
}

.profile-editor-layout {
  display: block;
}

.profile-editor {
  width: min(100%, 1100px);
  margin: 0 auto;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(28, 44, 39, 0.06);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-header h2,
.panel-header h3 {
  margin-bottom: 0;
}

.panel-header span {
  color: var(--muted);
  font-size: 13px;
}

.compact {
  margin-bottom: 8px;
}

.form-panel {
  display: grid;
  gap: 13px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--ink);
  background: #ffffff;
}

select[multiple] {
  min-height: 118px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 0;
  padding: 12px;
}

legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.check-grid,
.availability-grid,
.weekly-template-grid,
.recipient-grid,
.endoscopy-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.weekly-template-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.weekly-slot {
  align-content: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.weekly-slot > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.weekly-activity-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.recipient-grid {
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.endoscopy-template-grid {
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  max-height: 620px;
  overflow: auto;
  padding: 0 0 8px;
}

.endoscopy-day {
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(28, 44, 39, 0.06);
}

.endoscopy-slot {
  display: grid;
  gap: 8px;
  margin: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  background: #ffffff;
}

.endoscopy-slot:hover,
.endoscopy-slot:focus {
  border-color: #99d9d0;
  outline: none;
}

.endoscopy-slot strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.week-parity-options {
  display: grid;
  gap: 6px;
}

.week-parity-options .check-option {
  min-height: 28px;
  font-size: 12px;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.check-option input {
  width: 16px;
  min-height: 16px;
}

.doctor-list,
.absence-list,
.request-list,
#candidateList {
  display: grid;
  gap: 10px;
}

.profile-summary-panel {
  margin-bottom: 18px;
}

.profile-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

.doctor-card,
.absence-card,
.request-card,
.candidate-card,
.kpi-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.doctor-card,
.absence-card,
.request-card,
.candidate-card {
  padding: 12px;
}

.doctor-card {
  display: grid;
  gap: 10px;
}

.doctor-main,
.request-top,
.chat-bubble-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 900;
}

.doctor-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.doctor-name strong,
.doctor-name span {
  display: block;
}

.doctor-name span,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-tag {
  background: #fef3c7;
  color: var(--warning);
}

.candidate-box {
  padding: 12px;
  border: 1px dashed #b7c9c4;
  border-radius: var(--radius);
  background: #f8fbfa;
}

.candidate-select-all { margin-bottom: 10px; }
.candidate-select-all[hidden] { display: none; }
.candidate-choice { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; cursor: pointer; }
.candidate-choice input { flex: 0 0 18px; width: 18px; min-height: 18px; margin-top: 2px; }
.candidate-choice > span { min-width: 0; }
.candidate-choice .muted { display: block; margin-top: 4px; }

.request-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.mini-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

.mini-button.accept {
  color: var(--primary-strong);
  border-color: #99d9d0;
}

.mini-button.close {
  color: var(--danger);
  border-color: #fecaca;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-card {
  padding: 16px;
}

.kpi-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.kpi-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.activity-table-wrap {
  overflow-x: auto;
}

.dashboard-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.dashboard-wide-panel {
  grid-column: 1 / -1;
}

.detail-table td {
  vertical-align: top;
  line-height: 1.5;
}

@media (max-width: 860px) {
  .dashboard-detail-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-wide-panel {
    grid-column: auto;
  }
}

.activity-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

.activity-table th,
.activity-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.activity-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
}

.chat-panel {
  min-height: 620px;
  display: grid;
  grid-template-rows: 1fr auto;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.chat-bubble {
  max-width: 780px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.chat-bubble p {
  margin-bottom: 0;
}

.chat-message-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chat-delete-button {
  width: 24px;
  height: 24px;
  border: 0;
  padding: 0;
  border-radius: 4px;
  background: transparent;
  color: #9f1239;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.chat-delete-button:hover,
.chat-delete-button:focus-visible {
  background: #ffe4e6;
}

.telegram-link-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f0fdfa;
}

.telegram-signup-note {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-left: 3px solid #0f766e;
  background: #f0fdfa;
  font-size: 14px;
}

.telegram-signup-note a {
  width: fit-content;
  font-weight: 700;
}

.telegram-link-panel h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.telegram-qr-link {
  display: block;
  flex: 0 0 148px;
  line-height: 0;
}

.telegram-qr-link img {
  display: block;
  width: 148px;
  height: 148px;
  background: #fff;
}

@media (max-width: 500px) {
  .telegram-link-panel {
    align-items: flex-start;
  }

  .telegram-qr-link {
    flex-basis: 96px;
  }

  .telegram-qr-link img {
    width: 96px;
    height: 96px;
  }
}

.chat-composer {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.channel-list {
  display: grid;
  gap: 8px;
}

.channel {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  text-align: left;
  padding: 0 12px;
  font-weight: 700;
}

.channel.active {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-color: #a6dfd7;
}

.empty-state {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 150px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.empty-state strong {
  color: var(--ink);
}

.oncall-calendar {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 14px;
}

.oncall-month {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(28, 44, 39, 0.06);
}

.oncall-month h2 {
  margin-bottom: 12px;
  text-transform: capitalize;
}

.oncall-days {
  display: grid;
  gap: 8px;
}

.oncall-day {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdfc;
}

.oncall-day.weekend-call {
  border-left: 5px solid var(--primary);
}

.oncall-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: capitalize;
}

.oncall-fields {
  display: grid;
  gap: 6px;
}

.oncall-fields label {
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.oncall-fields input {
  min-height: 32px;
  padding: 5px 8px;
}

@media (max-width: 1350px) {
  .app-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .nav-list {
    order: 3;
    width: 100%;
  }
}

@media (max-width: 1100px) {
  .auth-card {
    grid-template-columns: 1fr;
  }

  .signup-form {
    max-height: none;
  }

  .schedule-grid,
  .kpi-grid,
  .oncall-calendar {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .home-layout,
  .split-layout,
  .split-layout.wide-left,
  .chat-layout,
  .vacation-config {
    grid-template-columns: 1fr;
  }

  .home-schedule {
    grid-template-columns: repeat(5, minmax(118px, 1fr));
  }

  .home-planning-actions {
    grid-template-columns: 1fr;
  }

  .exchange-alert-card {
    grid-template-columns: 1fr;
  }

  .exchange-alert-actions {
    justify-content: flex-start;
  }

  .pilot-banner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .app-header {
    padding: 10px;
    gap: 10px;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .nav-item {
    justify-content: center;
    min-height: 42px;
    padding: 8px;
  }

  .nav-item span:last-child,
  #storageStatus {
    display: none;
  }

  .header-status {
    margin-left: 0;
  }

  .active-profile select {
    width: 138px;
  }

  .main {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .schedule-grid,
  .kpi-grid,
  .oncall-calendar {
    grid-template-columns: 1fr;
  }

  .home-schedule {
    grid-template-columns: repeat(5, minmax(118px, 1fr));
  }

  .home-room-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .two-fields,
  .chat-composer,
  .home-chat-composer,
  .vacation-period-form,
  .weekly-template-grid,
  .endoscopy-template-grid,
  .recipient-grid {
    grid-template-columns: 1fr;
  }

  .week-picker,
  .week-picker input,
  .planning-controls .mini-button {
    width: 100%;
  }
}

/* Bourse : décisions, lectures et notifications. */
.request-top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.request-remove { flex: 0 0 40px; width: 40px; color: #b42318; font-size: 26px; line-height: 1; }
.request-remove:hover { background: #fef3f2; border-color: #b42318; }
.request-remove:focus-visible { outline: 2px solid #b42318; outline-offset: 2px; }
.request-remove:disabled { opacity: .5; cursor: not-allowed; }
.exchange-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.exchange-tabs button { border: 1px solid #c9d8db; border-radius: 10px; background: #f4f8f8; padding: 10px 14px; color: #31535a; cursor: pointer; font: inherit; }
.exchange-tabs button[aria-selected="true"] { background: #125f69; color: white; border-color: #125f69; }
.request-card details { margin-top: 14px; }
.request-card summary { cursor: pointer; color: #125f69; font-weight: 600; padding: 8px 0; }
.request-card details label { display: grid; gap: 6px; margin: 12px 0; }
.request-card .request-actions { flex-wrap: wrap; }
.request-card p, .request-card .muted { overflow-wrap: anywhere; }
#exchangeFeedback:not(:empty) { border-left: 3px solid #125f69; padding: 10px; background: #eff8f7; }
.exchange-notification { display: grid; gap: 5px; width: 100%; text-align: left; border: 1px solid #dce7e9; border-radius: 10px; padding: 12px; margin: 8px 0; background: #fff; color: #24464d; cursor: pointer; font: inherit; }
.exchange-notification.unread { border-left: 4px solid #127983; background: #edf8f7; }
.exchange-notification small { color: #61767b; }
.exchange-planning-note { color: #125f69; font-size: 11px; }
#exchangeHistoryFilterLabel[hidden] { display: none; }
.request-reply { margin-top: 14px; padding: 14px; background: #edf8f7; border-radius: 10px; }
.request-reply label { display: grid; gap: 6px; margin-top: 12px; }
.admin-exchange-table { overflow-x: auto; }
.admin-exchange-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-exchange-table th, .admin-exchange-table td { text-align: left; padding: 12px; border-bottom: 1px solid #dce7e9; min-width: 120px; }
.admin-exchange-table th { background: #edf8f7; color: #125f69; }
.nav-item[hidden], #exportExchangeHistory[hidden] { display: none; }
.request-card .request-actions .mini-button.accept,
.request-card .request-actions .mini-button.close {
  min-height: 48px; min-width: 140px; padding: 12px 22px;
  font-size: 18px; font-weight: 700; border: 2px solid transparent;
}
.request-card .request-actions .mini-button.accept { background: #087443; color: #fff; }
.request-card .request-actions .mini-button.close { background: #b42318; color: #fff; }
.request-card .request-actions .mini-button:disabled { opacity: .5; cursor: not-allowed; }
.decision-actions { margin-top: 16px; display: flex; gap: 12px; }
.oncall-intro, .oncall-import-panel, .oncall-history-panel { margin-bottom: 20px; }
#onCallImportPanel[hidden], #onCallMailPanel[hidden] { display: none; }
#onCallCalendar { grid-template-columns: 1fr; margin-bottom: 20px; }
.oncall-day { grid-template-columns: 115px minmax(0, 1fr) 100px; align-items: center; padding: 10px; }
.oncall-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.oncall-values span { display: block; font-size: 11px; color: #61767b; }
.oncall-values strong { display: block; overflow-wrap: anywhere; }
.oncall-event { border-bottom: 1px solid #dce7e9; padding: 12px 0; }
.oncall-event summary { cursor: pointer; font-weight: 600; }
#onCallEditDialog { width: min(560px, 92vw); border: 0; border-radius: 14px; padding: 24px; color: var(--ink); }
#onCallEditDialog::backdrop { background: #10231f99; }
#onCallEditForm { display: grid; gap: 14px; }
#onCallEditForm label { display: grid; gap: 6px; }
#onCallImportPreview { max-height: 360px; overflow: auto; margin: 16px 0; }
#onCallMailPanel { margin-top: 20px; }
#onCallMailForm { display: grid; gap: 12px; }
#onCallFeedback:not(:empty) { background: #edf8f7; padding: 12px; border-left: 3px solid #125f69; }
@media(max-width:600px) { .oncall-day { grid-template-columns: 75px minmax(0,1fr); } .oncall-day button { grid-column: 2; justify-self: start; } .oncall-values { gap: 6px; } }
@media (min-width: 721px) {
  .app-header { flex-wrap: wrap; }
  .nav-list { order: 3; flex-basis: 100%; flex-wrap: wrap; }
}

.absence-layout { display: grid; gap: 22px; min-width: 0; }
.absence-layout > .panel { min-width: 0; }
.absence-toolbar, .absence-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.absence-toolbar label { display: flex; align-items: center; gap: 10px; }
.absence-legend span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; font-size: 12px; }
.absence-legend i { width: 10px; height: 10px; border-radius: 50%; }
.absence-calendar-scroll { overflow: auto; max-height: 65vh; border: 1px solid #dbe2e8; border-radius: 12px; }
.absence-calendar { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.absence-calendar caption { text-align: left; padding: 12px; font-weight: 700; }
.absence-calendar th, .absence-calendar td { min-width: 100px; width: 100px; max-width: 100px; padding: 6px; border-right: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
.absence-calendar thead th { position: sticky; top: 0; z-index: 2; background: #f1f5f9; text-align: center; }
.absence-calendar .absence-doctor { position: sticky; left: 0; z-index: 3; min-width: 210px; max-width: 210px; background: #fff; border-left: 5px solid var(--unit-color, #64748b); box-shadow: 3px 0 5px #0000000a; white-space: normal; }
.absence-calendar thead .absence-doctor { z-index: 4; background: #f1f5f9; }
.absence-doctor strong { color: var(--unit-color); }
.absence-doctor small { display: block; font-size: 11px; font-weight: 400; margin-top: 5px; }
.absence-calendar .absence-weekend { background: #f1f5f9; }
.absence-day { display: block; width: 100%; padding: 8px 4px; margin: 3px 0; border: 0; border-radius: 5px; font-size: 11px; line-height: 1.35; text-align: center; white-space: normal; overflow-wrap: anywhere; }
button.absence-day { cursor: pointer; }
button.absence-day:hover { outline: 2px solid currentColor; }
.absence-professional { background: #dcfce7; color: #166534; }
.absence-leave { background: #fee2e2; color: #991b1b; }
.absence-sick { background: #ffedd5; color: #9a3412; }
.absence-accessory { background: #ede9fe; color: #5b21b6; }
.absence-other { background: #e2e8f0; color: #334155; }
@media (max-width: 600px) { .absence-calendar .absence-doctor { min-width: 145px; max-width: 145px; } }

.absence-mail-options { min-width: 0; border: 1px solid #dbe2e8; border-radius: 10px; padding: 12px; }
.absence-mail-options legend { font-weight: 700; }
.absence-mail-recipients { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 265px), 1fr)); gap: 8px; margin-bottom: 12px; }
.absence-mail-recipients .check-option { align-items: start; }
.absence-mail-recipients small { display: block; font-weight: 400; overflow-wrap: anywhere; }
.absence-mail-preview { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.5; }
#absenceManageList .absence-card { display: grid; gap: 8px; }

.chat-absence-alert { border-left: 4px solid #d97706; background: #fffbeb; }
.chat-absence-alert p { white-space: pre-line; }

.al-poll { margin-top: 24px; }
#alPollFields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
#alPollFields label { display: grid; gap: 8px; }
.al-poll-summary { overflow-x: auto; }
.al-poll-summary table { border-collapse: collapse; width: 100%; }
.al-poll-summary th, .al-poll-summary td { padding: 12px; border-bottom: 1px solid #dfe5ed; text-align: left; min-width: 115px; }
.al-poll-summary caption { text-align: left; padding: 10px 0; }
/* Préparation collective des astreintes. */
.oncall-poll-legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.oncall-poll-legend span { padding: 8px 12px; border-radius: 8px; }
.oncall-agenda-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 16px; }
.oncall-choice.unavailable { background: #fee2e2; color: #991b1b; }
.oncall-choice.preferred { background: #dcfce7; color: #166534; }
.oncall-choice.unset { background: #f3f4f6; color: #4b5563; }
.oncall-poll-calendar { max-width: 100%; overflow-x: auto; margin: 20px 0; }
.oncall-poll-days { display: grid; grid-template-columns: repeat(7, minmax(145px, 1fr)); gap: 10px; min-width: 1075px; }
.oncall-poll-weekday-heading { padding: 10px; font-weight: 700; text-align: center; background: var(--surface-strong); border-radius: 8px; }
.oncall-poll-day.adjacent-month { border-style: dashed; }
.oncall-poll-day.outside-period { color: var(--muted); border-color: var(--line); background: var(--surface-strong); }
.oncall-poll-day { padding: 12px; border: 1px solid currentColor; border-radius: 10px; display: grid; gap: 8px; }
.oncall-poll-day span { font-weight: 600; }
.oncall-poll-day select { width: 100%; color: inherit; }
.oncall-poll-recurrence { margin: 20px 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.oncall-poll-recurrence legend { padding: 0 6px; font-weight: 600; }
.oncall-poll-weekdays { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 12px 0; }
.oncall-poll-summary { max-height: 650px; overflow: auto; margin-top: 16px; }
.oncall-poll-summary table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.oncall-poll-summary th, .oncall-poll-summary td { min-width: 150px; padding: 10px 14px; white-space: nowrap; border-bottom: 1px solid #e5e7eb; }
.oncall-poll-summary thead th { position: sticky; top: 0; z-index: 2; background: #f0fdfa; }
.oncall-poll-summary tr > th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; }
.oncall-poll-summary thead tr > th:first-child { z-index: 3; background: #f0fdfa; }

.oncall-test-settings { margin: 20px 0; padding: 16px; border: 1px solid #c9d8db; border-radius: 10px; }
.oncall-test-settings summary, #onCallTestDiagnostics summary { cursor: pointer; font-weight: 600; color: #125f69; }
.oncall-test-settings > label { display: grid; gap: 8px; margin: 16px 0; }
.oncall-test-settings > .check-option { display: flex; }
.oncall-test-coefficients, .oncall-test-mappings { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 16px 0; }
.oncall-test-coefficients label, .oncall-test-mappings label { display: grid; gap: 6px; }
.oncall-test-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 24px 0; }
.oncall-test-metrics > div { background: #edf8f7; padding: 16px; border-radius: 10px; display: grid; gap: 8px; }
.oncall-test-metrics strong { font-size: 26px; color: #125f69; }
.oncall-test-month { margin: 24px 0; }
.oncall-test-month table { table-layout: fixed; min-width: 820px; }
.oncall-test-month th:first-child { width: 20%; }
.oncall-test-month small { display: block; margin-top: 5px; font-size: 12px; font-weight: 400; }
.oncall-test-weekend { background: #f2f8f8; }
.oncall-test-warning { color: #805000; }
.oncall-test-missing { background: #fff1ef; }
#onCallTestStatus:not(:empty) { padding: 12px; border-left: 3px solid #125f69; background: #eff8f7; }
.oncall-test-panel [hidden] { display: none; }

.oncall-test-edit { display: grid; gap: .3rem; margin-top: .7rem; font-size: .8rem; }
.oncall-test-edit select { max-width: 15rem; width: 100%; min-width: 0; }
#onCallTestPanel button:disabled { opacity: .5; cursor: not-allowed; }
#onCallTestSummary td { vertical-align: top; }
#onCallTestSummary td:nth-last-child(2), #onCallTestSummary td:nth-last-child(5) { min-width: 12rem; }

#agAssignmentDialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}
#agAssignmentDialog::backdrop { background: rgb(15 23 42 / 45%); }
#agAssignmentDialog label { display: grid; gap: 8px; }
#agAssignmentDialog .form-actions { flex-wrap: wrap; margin-top: 16px; }

/* Onglets compacts propres à la bourse d’échange. */
#exchangeView .exchange-tabs { gap: 5px; }
#exchangeView .exchange-tabs button { padding: 6px 9px; font-size: 0.82rem; line-height: 1.25; }


/* ===== Accueil simplifié (test 2026-11-07) ===== */
.home-dashboard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.home-card .panel-header { align-items: flex-start; }
.home-card .panel-header > div { display: grid; gap: 2px; }
.home-list { display: grid; gap: 8px; }
.home-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 12px; border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: var(--radius); background: var(--surface); text-align: left; width: 100%; font: inherit; color: inherit; }
.home-item > div:first-child { display: grid; gap: 2px; min-width: 0; }
.home-item span { color: var(--muted); font-size: 13px; }
.home-item-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.home-item-tags .tag { color: var(--ink); }
.home-item.type-interventionnel { border-left-color: var(--violet); }
.home-item.type-urgence { border-left-color: var(--danger); }
.home-item.type-diagnostic { border-left-color: var(--blue); }
.home-item-button { cursor: pointer; }
.home-item-button:hover { background: var(--surface-strong); }
.home-item.exchange-reply { border-left-color: var(--warning); }
.home-item.exchange-admin { border-left-color: var(--muted); }
.warning-tag { background: #fef3c7; }
.oncall-tag { background: var(--primary-soft); }
.primary-mini { background: var(--primary); border-color: var(--primary); color: #fff; }
.notification-menu { position: relative; }
.bell-button { position: relative; }
.bell-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.notification-popover { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); white-space: normal; }
.notification-popover[hidden] { display: none; }
.profile-button { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 2px 10px 2px 2px; border: 1px solid rgba(255,255,255,0.18); border-radius: var(--radius); background: #16342f; color: #ecf8f5; font-weight: 700; cursor: pointer; }
.profile-button[hidden] { display: none; }
.profile-button .avatar { width: 30px; height: 30px; font-size: 12px; }
.profile-habits { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.profile-habits > summary { cursor: pointer; font-weight: 800; }
.profile-habits > summary small { color: var(--muted); font-weight: 600; margin-left: 6px; }
.profile-habits[open] > summary { margin-bottom: 10px; }
@media (max-width: 1100px) { .home-dashboard { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .header-status { flex-wrap: wrap; white-space: normal; row-gap: 8px; } .notification-menu { position: static; } .notification-popover { position: fixed; left: 16px; right: 16px; top: 76px; width: auto; } .profile-button span:last-child { display: none; } .home-item { flex-direction: column; align-items: flex-start; } .home-item-tags { justify-content: flex-start; } }

.home-welcome { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.home-welcome-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.home-welcome-text strong { font-size: 18px; }
.home-welcome-text span { color: var(--muted); font-size: 13px; }
#myProfileButton[hidden] { display: none; }
@media (max-width: 720px) { .home-welcome { flex-wrap: wrap; } .home-welcome #myProfileButton { width: 100%; } }
.planning-tabs { margin: 0 0 16px; }
