/* =====================================================================
   MEDICAMPUS DIGITAL — charte d'interface
   Bleu institutionnel #0057B8 · Vert médical #009E60
   Sobre, lisible, rapide : le luxe, c'est la facilité d'utilisation.
   ===================================================================== */

@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --blue: #0057B8;
  --blue-700: #00438F;
  --blue-600: #004EA6;
  --blue-100: #DCE8F7;
  --blue-50: #EEF4FC;
  --green: #009E60;
  --green-700: #00784A;
  --green-50: #E7F6EF;
  --ink: #0F172A;
  --ink-2: #334155;
  --muted: #64748B;
  --faint: #94A3B8;
  --line: #E2E8F0;
  --line-2: #EDF1F6;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --amber: #A15C07;
  --amber-50: #FEF5E6;
  --amber-line: #F5D9A8;
  --red: #B42318;
  --red-50: #FEF0EE;
  --red-line: #F7C9C4;
  --violet: #6D28D9;
  --violet-50: #F3EEFF;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 12px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .14);
  --sidebar: 252px;
  --topbar: 60px;
  --focus: 0 0 0 3px rgba(0, 87, 184, .28);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 620; }
h3 { font-size: 15px; font-weight: 620; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.tabular, td.num, .num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xsmall { font-size: 12px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
[hidden] { display: none !important; }

.icon { width: 1em; height: 1em; flex: none; vertical-align: -0.125em; fill: currentColor; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

/* ---------------------------------------------------------------------
   Structure : barre latérale + contenu
   --------------------------------------------------------------------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  height: var(--topbar); padding: 0 18px; border-bottom: 1px solid var(--line-2);
  color: var(--ink); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 750; font-size: 14px; letter-spacing: .02em; color: var(--blue); }
.brand-name b { color: var(--green); font-weight: 750; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .04em; margin-top: 2px; }

.nav { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.nav-group + .nav-group { margin-top: 14px; }
.nav-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 0 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: 7px; color: var(--ink-2);
  font-weight: 500; font-size: 14px; text-decoration: none;
}
.nav a .icon { font-size: 17px; color: var(--muted); }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.active { background: var(--blue-50); color: var(--blue-700); font-weight: 600; }
.nav a.active .icon { color: var(--blue); }
.nav-count {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: var(--line-2); color: var(--ink-2); font-size: 12px; font-weight: 600; text-align: center;
}
.nav a.active .nav-count { background: var(--blue); color: #fff; }
.nav-count.warn { background: var(--red-50); color: var(--red); }

.sidebar-foot { padding: 12px 14px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); }

.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.menu-toggle { display: none; }
.search-trigger {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--muted); cursor: text; font: inherit; font-size: 14px; text-align: left;
}
.search-trigger:hover { border-color: #CBD5E1; }
.search-trigger .kbd { margin-left: auto; }
.kbd { font-size: 11px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: #fff; color: var(--muted); font-family: var(--font); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; border: 1px solid transparent; background: none; font: inherit; color: inherit; cursor: pointer; }
.user-chip:hover { background: var(--bg); }
.user-chip-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-chip-name { font-size: 13px; font-weight: 600; }
.user-chip-role { font-size: 11.5px; color: var(--muted); }

.content { flex: 1; padding: 24px; max-width: 1360px; width: 100%; }
.content.narrow { max-width: 920px; }
.footer { padding: 18px 24px; color: var(--faint); font-size: 12px; }

/* En-tête de page */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .lead { color: var(--muted); margin-top: 4px; font-size: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); }

/* ---------------------------------------------------------------------
   Boutons
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-size: 14px; font-weight: 550; line-height: 1; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn .icon { font-size: 16px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-700); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: var(--green-700); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--bg); border-color: #CBD5E1; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red-line); }
.btn-danger:hover { background: var(--red-50); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; gap: 5px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
form.inline { display: inline; }

/* ---------------------------------------------------------------------
   Cartes, grilles
   --------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-head h2 .icon { color: var(--muted); }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.card.flush .card-body { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.grid-side { grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Indicateurs */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow-sm); display: block; color: inherit; }
a.stat:hover { text-decoration: none; border-color: #CBD5E1; }
.stat-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.stat-label .icon { font-size: 15px; }
.stat-value { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-value small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.stat-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stat.tone-blue .stat-label .icon { color: var(--blue); }
.stat.tone-green .stat-label .icon { color: var(--green); }
.stat.tone-amber .stat-label .icon { color: var(--amber); }
.stat.tone-red .stat-label .icon { color: var(--red); }

/* ---------------------------------------------------------------------
   Badges, puces, avatars
   --------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--line-2); color: var(--ink-2);
}
.badge-primary { background: var(--blue-50); color: var(--blue-700); }
.badge-info { background: #EAF2FD; color: #1E5BB8; }
.badge-success { background: var(--green-50); color: var(--green-700); }
.badge-warning { background: var(--amber-50); color: var(--amber); }
.badge-danger { background: var(--red-50); color: var(--red); }
.badge-violet { background: var(--violet-50); color: var(--violet); }
.badge-neutral { background: var(--line-2); color: var(--muted); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.ticket { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 28px; padding: 0 8px; border-radius: 7px; background: var(--ink); color: #fff; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.ticket.urgent { background: var(--red); }

.avatar {
  --avatar: var(--blue);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: color-mix(in srgb, var(--avatar) 14%, white); color: var(--avatar);
  font-weight: 650; font-size: 13px; letter-spacing: .02em;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }
.avatar-photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; }

/* ---------------------------------------------------------------------
   Alertes et notifications
   --------------------------------------------------------------------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid; font-size: 14px; }
.alert .icon { font-size: 18px; margin-top: 1px; }
.alert-info { background: var(--blue-50); border-color: var(--blue-100); color: #12407F; }
.alert-success { background: var(--green-50); border-color: #BDE5D1; color: #075E3B; }
.alert-warning { background: var(--amber-50); border-color: var(--amber-line); color: #7A4505; }
.alert-danger { background: var(--red-50); border-color: var(--red-line); color: #8F1C13; }
.alert + .alert { margin-top: 8px; }

.allergy-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius); background: var(--red-50); border: 1px solid var(--red-line); color: #8F1C13; font-weight: 600; font-size: 14px; }
.allergy-banner .icon { font-size: 18px; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; animation: toast-in .2s ease-out; }
.toast .icon { font-size: 18px; margin-top: 1px; }
.toast.success .icon { color: #4ADE80; }
.toast.danger { background: var(--red); }
.toast.warning .icon { color: #FBBF24; }
.toast.info .icon { color: #93C5FD; }
.toast button { margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.7); cursor: pointer; padding: 0 0 0 8px; font-size: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------
   Tableaux
   --------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #FAFBFD; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FAFCFF; }
.table tr.is-link { cursor: pointer; }
.table .cell-person { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.table .cell-person a { color: var(--ink); font-weight: 600; }
.table .cell-sub { font-size: 12.5px; color: var(--muted); }
.table td.actions { text-align: right; white-space: nowrap; }
.table tfoot td { font-weight: 650; border-top: 1px solid var(--line); background: #FAFBFD; }

/* ---------------------------------------------------------------------
   Formulaires
   --------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.req { color: var(--red); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid #CBD5E1; border-radius: 8px;
  background: #fff; color: var(--ink); font: inherit; font-size: 14.5px; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2364748B'%3E%3Cpath d='M4.5 6l3.5 4 3.5-4z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--red); }
.field-error { color: var(--red); font-size: 12.5px; }
.input-sm { height: 34px; font-size: 13.5px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .addon { display: flex; align-items: center; padding: 0 10px; border: 1px solid #CBD5E1; border-left: 0; border-radius: 0 8px 8px 0; background: var(--bg); color: var(--muted); font-size: 13px; white-space: nowrap; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--blue); }
.segmented { display: inline-flex; border: 1px solid #CBD5E1; border-radius: 8px; overflow: hidden; background: #fff; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { padding: 0 14px; height: 38px; display: flex; align-items: center; font-size: 14px; cursor: pointer; border-right: 1px solid var(--line); color: var(--ink-2); font-weight: 500; }
.segmented label:last-child { border-right: 0; }
.segmented input:checked + label { background: var(--blue-50); color: var(--blue-700); font-weight: 600; }
.segmented input:focus-visible + label { box-shadow: inset var(--focus); }
.fieldset { border: 0; padding: 0; margin: 0; }
.fieldset-title { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 0 12px; display: flex; align-items: center; gap: 8px; }
.fieldset + .fieldset { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-2); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.sticky-actions { position: sticky; bottom: 0; z-index: 10; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-top: 1px solid var(--line); padding: 12px 18px; margin: 0 -18px -18px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Filtres */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { min-width: 160px; }
.filters .grow { flex: 1; min-width: 220px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 550; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs .active, .tabs [aria-selected="true"] { color: var(--blue-700); border-bottom-color: var(--blue); }
.tabs .count { font-size: 12px; background: var(--line-2); color: var(--ink-2); padding: 0 7px; border-radius: 999px; }

/* ---------------------------------------------------------------------
   Listes, chronologie, états vides
   --------------------------------------------------------------------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border-bottom: 0; }
a.list-item { color: inherit; }
a.list-item:hover { background: #FAFCFF; text-decoration: none; }
.list-main { flex: 1; min-width: 0; }
.list-title { font-weight: 600; font-size: 14px; }
.list-sub { font-size: 12.5px; color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.tl-item { position: relative; padding: 0 0 18px 44px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: 4px; top: 0; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.tl-item.consultation .tl-dot { border-color: var(--blue); color: var(--blue); }
.tl-item.examen .tl-dot { border-color: var(--violet); color: var(--violet); }
.tl-item.ordonnance .tl-dot { border-color: var(--green); color: var(--green); }
.tl-item.document .tl-dot { border-color: var(--amber); color: var(--amber); }
.tl-item.certificat .tl-dot { border-color: #0E7490; color: #0E7490; }
.tl-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tl-title { font-weight: 600; font-size: 14px; }
.tl-date { font-size: 12.5px; color: var(--muted); }
.tl-body { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.tl-body p + p { margin-top: 2px; }
.tl-actions { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }

.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty-icon { font-size: 30px; color: var(--faint); margin-bottom: 8px; }
.empty-title { font-weight: 600; color: var(--ink-2); }
.empty-text { font-size: 13.5px; margin-top: 4px; }
.empty .btn { margin-top: 14px; }

.kv { display: grid; grid-template-columns: 140px minmax(0,1fr); gap: 8px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }

/* ---------------------------------------------------------------------
   Tableau d'accueil (colonnes)
   --------------------------------------------------------------------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.lane { background: #EEF2F7; border-radius: var(--radius-lg); padding: 10px; min-height: 140px; }
.lane-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 650; font-size: 13.5px; }
.lane-head .count { margin-left: auto; background: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--ink-2); }
.lane-dot { width: 8px; height: 8px; border-radius: 50%; }
.lane .tile + .tile { margin-top: 8px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; box-shadow: var(--shadow-sm); }
.tile.urgent { border-color: var(--red-line); box-shadow: inset 3px 0 0 var(--red); }
.tile-top { display: flex; gap: 10px; align-items: center; }
.tile-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.tile-meta { font-size: 12.5px; color: var(--muted); }
.tile-motif { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.tile-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.lane-empty { font-size: 13px; color: var(--faint); text-align: center; padding: 18px 6px; }

/* File d'attente médecin */
.queue-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.queue-item:last-child { border-bottom: 0; }
.queue-item.urgent { background: #FFFAF9; }
.wait { font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.wait.long { color: var(--amber); font-weight: 600; }
.vitals-inline { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.vitals-inline span { white-space: nowrap; }

/* ---------------------------------------------------------------------
   Dossier patient
   --------------------------------------------------------------------- */
.patient-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.patient-id { flex: 1; min-width: 240px; }
.patient-name { font-size: 22px; font-weight: 680; letter-spacing: -0.015em; }
.patient-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.patient-facts { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.patient-facts span { display: inline-flex; align-items: center; gap: 6px; }
.patient-facts .icon { color: var(--muted); }

.vitals { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.vital { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
.vital-label { font-size: 12px; color: var(--muted); }
.vital-value { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.vital-value small { font-size: 12px; font-weight: 500; color: var(--muted); }
.vital.alert-high { border-color: var(--red-line); background: var(--red-50); }
.vital.alert-high .vital-value { color: var(--red); }

/* Écran de consultation */
.consult { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.consult-side { position: sticky; top: calc(var(--topbar) + 16px); max-height: calc(100vh - var(--topbar) - 32px); overflow-y: auto; }
.consult-side .card-body { padding: 14px 16px; }
.side-section + .side-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.side-title { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.side-list { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.side-list li + li { margin-top: 6px; }
.lines { width: 100%; border-collapse: collapse; }
.lines td { padding: 6px 4px; vertical-align: top; }
.lines td:first-child { padding-left: 0; }
.lines td:last-child { padding-right: 0; width: 36px; }
.lines .input { height: 36px; font-size: 14px; }
.line-title { font-weight: 600; font-size: 14px; padding-top: 8px; }
.total-line { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 0; font-weight: 650; border-top: 1px dashed var(--line); margin-top: 8px; }

/* Autocomplétion */
.ac { position: relative; }
.ac-list { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; padding: 4px; }
.ac-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 6px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink); }
.ac-item small { display: block; color: var(--muted); font-size: 12px; }
.ac-item:hover, .ac-item.active { background: var(--blue-50); }
.ac-empty { padding: 10px; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------------
   Fenêtres (dialog natif)
   --------------------------------------------------------------------- */
dialog { border: 0; padding: 0; border-radius: 14px; box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); color: var(--ink); }
dialog::backdrop { background: rgba(15, 23, 42, .45); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.dialog-body { padding: 18px 20px; }
.dialog-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; }
dialog.search-dialog { width: min(640px, calc(100vw - 32px)); margin-top: 10vh; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.search-box .icon { font-size: 18px; color: var(--muted); }
.search-box input { flex: 1; height: 56px; border: 0; font: inherit; font-size: 16px; outline: none; background: none; }
.search-results { max-height: 60vh; overflow-y: auto; padding: 6px; }
.search-result { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.search-result:hover, .search-result.active { background: var(--blue-50); text-decoration: none; }
.search-hint { padding: 14px 16px; font-size: 13px; color: var(--muted); }
.scan-video { width: 100%; border-radius: 10px; background: #000; aspect-ratio: 4/3; object-fit: cover; }

/* ---------------------------------------------------------------------
   Graphiques simples (SVG générés côté serveur)
   --------------------------------------------------------------------- */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0,1fr) 54px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.bar-fill.green { background: var(--green); }
.bar-fill.amber { background: #D97706; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg text { font-family: var(--font); fill: var(--muted); font-size: 11px; }

/* ---------------------------------------------------------------------
   Pages publiques et connexion
   --------------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, 520px); background: var(--surface); }
.auth-visual { position: relative; background: linear-gradient(160deg, #003C82 0%, var(--blue) 55%, #007A70 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-visual h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; max-width: 460px; line-height: 1.15; }
.auth-visual p { color: rgba(255,255,255,.82); max-width: 440px; margin-top: 14px; font-size: 16px; }
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; max-width: 440px; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; color: rgba(255,255,255,.9); font-size: 14.5px; }
.auth-points .icon { font-size: 18px; color: #7DE2B8; margin-top: 2px; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: .03em; }
.auth-brand .brand-mark { width: 40px; height: 40px; }
.auth-foot { font-size: 12.5px; color: rgba(255,255,255,.65); }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 64px); }
.auth-logo { width: 220px; margin-bottom: 28px; }
.auth-panel h2 { font-size: 22px; font-weight: 680; }
.auth-panel .lead { color: var(--muted); margin: 6px 0 24px; }
.auth-panel form .field + .field { margin-top: 14px; }
.auth-links { margin-top: 22px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; }

.public { min-height: 100vh; background: var(--bg); padding: 32px 16px; }
.public-card { max-width: 560px; margin: 0 auto; }
.public-logo { width: 190px; margin: 0 auto 20px; }
.verify-ok { text-align: center; padding: 28px 22px; }
.verify-ok .seal { width: 64px; height: 64px; border-radius: 50%; background: var(--green-50); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 32px; margin: 0 auto 12px; }
.verify-ko .seal { background: var(--red-50); color: var(--red); }

/* Écran de salle d'attente */
.tv { min-height: 100vh; background: #0B1B33; color: #fff; display: grid; grid-template-rows: auto 1fr auto; font-size: 18px; }
.tv-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 40px; border-bottom: 1px solid rgba(255,255,255,.1); }
.tv-head .brand-name { color: #fff; font-size: 20px; }
.tv-head .brand-name b { color: #4ADE80; }
.tv-clock { font-size: 34px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tv-main { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; padding: 32px 40px; }
.tv-left { display: grid; min-height: 0; }
.tv-media { border-radius: 22px; overflow: hidden; background: #000; display: flex; align-items: center; justify-content: center; }
.tv-media video { width: 100%; height: 100%; max-height: 70vh; object-fit: contain; display: block; }
.tv-media[hidden] { display: none; }
.tv-call { background: linear-gradient(160deg, var(--blue) 0%, #00407F 100%); border-radius: 22px; padding: 36px; display: flex; flex-direction: column; justify-content: center; }
.tv-call-label { font-size: 22px; opacity: .85; text-transform: uppercase; letter-spacing: .08em; }
.tv-call-ticket { font-size: clamp(90px, 14vw, 190px); font-weight: 800; line-height: 1; margin: 18px 0; font-variant-numeric: tabular-nums; }
.tv-call-room { font-size: 28px; font-weight: 600; }
.tv-call.flash { animation: tv-flash 1.2s ease-in-out 3; }
@keyframes tv-flash { 50% { box-shadow: 0 0 0 12px rgba(74, 222, 128, .45); } }
.tv-list h2 { font-size: 20px; color: rgba(255,255,255,.7); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; }
.tv-tickets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tv-ticket { background: rgba(255,255,255,.07); border-radius: 14px; padding: 18px; text-align: center; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tv-ticket.urgent { background: rgba(244, 63, 94, .25); }
.tv-foot { padding: 16px 40px; color: rgba(255,255,255,.6); font-size: 16px; border-top: 1px solid rgba(255,255,255,.1); }

/* ---------------------------------------------------------------------
   Adaptation tablette et téléphone
   --------------------------------------------------------------------- */
.backdrop { display: none; }
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .consult { grid-template-columns: minmax(0, 1fr); }
  .consult-side { position: static; max-height: none; }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: none; }
  .nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 35; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 14px; gap: 10px; }
  .content { padding: 18px 16px; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .grid-side { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-visual { display: none; }
  .tv-main { grid-template-columns: 1fr; }
  .user-chip-text { display: none; }
}
@media (max-width: 680px) {
  body { font-size: 15px; }
  h1 { font-size: 20px; }
  .grid-2, .grid-4, .form-grid, .form-grid-3, .form-grid-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2, .span-3 { grid-column: auto; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .search-trigger .kbd, .search-trigger .label-long { display: none; }
  .page-head { margin-bottom: 14px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .bar-row { grid-template-columns: minmax(0, 1fr) 48px; }
  .bar-row .bar-track { grid-column: 1 / -1; grid-row: 2; }
  /* Tableaux en cartes */
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
  .table.responsive td { border: 0; padding: 3px 0; }
  .table.responsive td:empty { display: none; }
  .table.responsive td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  .table.responsive td.actions { text-align: left; padding-top: 8px; }
  .sticky-actions .btn { flex: 1; }
  .tv-head, .tv-main, .tv-foot { padding-left: 18px; padding-right: 18px; }
}

/* ---------------------------------------------------------------------
   Impression (listes, journal de caisse)
   --------------------------------------------------------------------- */
@media print {
  .sidebar, .topbar, .page-actions, .filters, .footer, .toasts, .btn, .tabs { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #ccc; }
  body { background: #fff; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Menu utilisateur */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; }
.user-menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 7px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); text-align: left; cursor: pointer; text-decoration: none; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--bg); text-decoration: none; }
.menu-pop .icon { color: var(--muted); }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.text-warning { color: var(--amber); }
.badge:empty { display: none; }
.hint { font-size: 12.5px; color: var(--muted); }
label.check[data-exam] { align-items: flex-start; }
label.check[data-exam] input { margin-top: 2px; }
.card.flush p.card-body { padding: 14px 18px; }
.table th.right { text-align: right; }
.search-trigger > span:not(.kbd) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 680px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 22px; }
  .stat-note { display: none; }
  .queue-item { flex-wrap: wrap; }
  .queue-item .btn-group { width: 100%; justify-content: flex-end; }
}

/* Date de naissance : saisie ou sélection */
.dob .input-group .addon { order: -1; border: 1px solid #CBD5E1; border-right: 0; border-radius: 8px 0 0 8px; }
.dob .input-group .input { border-radius: 0 8px 8px 0; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.dob-selects { display: grid; grid-template-columns: auto 1fr 1.6fr 1.2fr; gap: 6px; align-items: center; margin-top: 8px; }
.dob-selects .select { min-height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
.dob-or { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
@media (max-width: 420px) { .dob-selects { grid-template-columns: 1fr 1.6fr 1.2fr; } .dob-or { grid-column: 1 / -1; } }

/* Lecteur de QR code */
.scan-dlg { width: min(460px, calc(100vw - 24px)); }
.scan-frame { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #1d2b44, #0b1424); }
.scan-frame .scan-video { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s; }
.scan-dlg.live .scan-video { opacity: 1; }
.scan-target { position: absolute; inset: 16% 22%; border-radius: 12px; pointer-events: none;
  background: linear-gradient(#20D38A, #20D38A) top left / 26px 3px no-repeat, linear-gradient(#20D38A, #20D38A) top left / 3px 26px no-repeat,
  linear-gradient(#20D38A, #20D38A) top right / 26px 3px no-repeat, linear-gradient(#20D38A, #20D38A) top right / 3px 26px no-repeat,
  linear-gradient(#20D38A, #20D38A) bottom left / 26px 3px no-repeat, linear-gradient(#20D38A, #20D38A) bottom left / 3px 26px no-repeat,
  linear-gradient(#20D38A, #20D38A) bottom right / 26px 3px no-repeat, linear-gradient(#20D38A, #20D38A) bottom right / 3px 26px no-repeat; }
.scan-dlg.live .scan-target::after { content: ""; position: absolute; left: 6%; right: 6%; height: 2px; top: 10%; background: rgba(32,211,138,.85); box-shadow: 0 0 12px rgba(32,211,138,.9); animation: scanline 2s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { top: 10%; } 50% { top: 88%; } }
.scan-status { margin: 0; min-height: 2.6em; }
.scan-photo { position: relative; cursor: pointer; }
.text-danger { color: var(--red, #C0392B); }

/* =====================================================================
   Pages d'accès illustrées (agents, espace patient, vérification)
   ===================================================================== */
.gate-body { background: #F3F6FA; }
.gate { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(420px, 600px); }
.gate-visual { position: relative; overflow: hidden; color: #fff; padding: 40px clamp(32px, 4.5vw, 64px) 0; display: flex; flex-direction: column; isolation: isolate; }
.gate-visual::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.18) 1.2px, transparent 1.3px); background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 70%); mask-image: linear-gradient(180deg, #000 0%, transparent 70%); }
.gate-blue .gate-visual { background: radial-gradient(900px 520px at 0% 0%, rgba(61,155,255,.55), transparent 60%), linear-gradient(165deg, #0A62C9 0%, #0049A3 50%, #00316F 100%); }
.gate-green .gate-visual { background: radial-gradient(900px 520px at 0% 0%, rgba(80,230,170,.45), transparent 60%), linear-gradient(165deg, #00A86B 0%, #00875A 50%, #08697D 100%); }
.gate-navy .gate-visual { background: radial-gradient(900px 520px at 0% 0%, rgba(61,155,255,.35), transparent 60%), linear-gradient(165deg, #0D3270 0%, #0A2352 50%, #051634 100%); }
.gate-brand { display: flex; align-items: center; gap: 12px; }
.gate-brand img { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.gate-brand strong { display: block; font-size: 15px; letter-spacing: .04em; }
.gate-brand span { display: block; font-size: 12px; color: rgba(255,255,255,.72); letter-spacing: .08em; }
.gate-copy { margin-top: clamp(28px, 6vh, 64px); max-width: 520px; }
.gate-kicker { display: inline-block; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); font-size: 12px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.gate-copy h1 { margin-top: 16px; font-size: clamp(28px, 2.6vw, 40px); line-height: 1.12; font-weight: 750; letter-spacing: -.025em; color: #fff; }
.gate-copy h1 .hl { color: #9CF0C9; }
.gate-green .gate-copy h1 .hl { color: #FFE08A; }
.gate-copy p { margin-top: 14px; font-size: 16px; line-height: 1.55; color: rgba(255,255,255,.84); max-width: 480px; }
.gate-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.gate-points li { display: flex; gap: 10px; align-items: center; font-size: 14.5px; color: rgba(255,255,255,.92); }
.gate-points .icon { color: #7DE2B8; font-size: 18px; flex: none; }
.gate-illus { display: block; width: auto; max-width: min(560px, 100%); height: auto; max-height: min(52vh, 520px); margin: auto auto 0; padding-top: 18px; }
.gate-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px clamp(20px, 4vw, 56px); gap: 18px; }
.gate-card { width: 100%; max-width: 440px; background: #fff; border-radius: 22px; padding: 30px 30px 26px; box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 24px 60px -12px rgba(15,23,42,.18); border: 1px solid rgba(15,23,42,.05); }
.gate-logo { display: block; height: 58px; width: auto; margin-bottom: 18px; }
.gate-card h2 { font-size: 23px; font-weight: 720; letter-spacing: -.015em; color: var(--ink); }
.gate-lead { color: var(--muted); margin: 6px 0 20px; font-size: 14.5px; line-height: 1.5; }
.gate-card .btn-lg { height: 50px; border-radius: 12px; font-size: 15.5px; font-weight: 650; gap: 10px; }
.gate-card .input { height: 46px; font-size: 15.5px; }
.gate-card .select { height: 42px; }
.gate-note { margin-top: 18px; font-size: 12.5px; line-height: 1.5; color: var(--faint, #94A3B8); }
.gate-help { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: #F1F7F4; color: #285945; font-size: 13px; line-height: 1.45; }
.gate-help .icon { flex: none; margin-top: 2px; color: var(--green); }
.gate-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.gate-links a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: #fff; border: 1px solid #E2E8F0; color: var(--ink); font-size: 13.5px; font-weight: 550; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.gate-links a:hover { border-color: #93C5FD; box-shadow: 0 4px 14px rgba(0,87,184,.12); }
.gate-links .icon { color: var(--blue); }
.gate-sep { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--muted); font-size: 12.5px; }
.gate-sep::before, .gate-sep::after { content: ""; flex: 1; height: 1px; background: #E2E8F0; }
.input-icon .addon:first-child { order: -1; border: 1px solid #CBD5E1; border-right: 0; border-radius: 10px 0 0 10px; background: #F8FAFC; color: #64748B; padding: 0 12px; }
.input-icon .input { border-radius: 0 10px 10px 0; }
.input-icon .input:not(:last-child) { border-radius: 0; }
.input-icon .addon-btn { cursor: pointer; border-radius: 0 10px 10px 0; }
.verify-form { display: flex; gap: 8px; }
.verify-form .input { flex: 1; min-width: 0; }
.verify-result { text-align: center; padding: 18px 16px; border-radius: 16px; margin: 6px 0 4px; }
.verify-result.ok { background: linear-gradient(180deg, #ECFDF3, #fff); border: 1px solid #ABEFC6; }
.verify-result.ko { background: linear-gradient(180deg, #FEF3F2, #fff); border: 1px solid #FECDCA; }
.verify-result .seal { width: 58px; height: 58px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; color: #fff; background: var(--green); box-shadow: 0 10px 24px rgba(0,158,96,.3); }
.verify-result.ko .seal { background: var(--red); box-shadow: 0 10px 24px rgba(180,35,24,.25); }
.verify-result h3 { font-size: 19px; font-weight: 720; color: var(--ink); }
.verify-result > p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.verify-result .kv { text-align: left; margin: 14px 0 10px; }
@media (max-width: 920px) {
  .gate { grid-template-columns: minmax(0, 1fr); }
  .gate-visual { padding: 18px 20px 0; }
  .gate-copy { margin-top: 18px; }
  .gate-copy h1 { font-size: 24px; margin-top: 10px; }
  .gate-copy p, .gate-points { display: none; }
  .gate-kicker { font-size: 11px; padding: 5px 10px; }
  .gate-illus { width: auto; max-width: 100%; height: 210px; padding-top: 6px; }
  .gate-main { justify-content: flex-start; margin-top: -26px; padding: 0 14px 28px; position: relative; z-index: 2; }
  .gate-card { border-radius: 24px 24px 20px 20px; padding: 24px 20px 20px; }
  .gate-logo { height: 46px; margin-bottom: 14px; }
  .gate-card h2 { font-size: 21px; }
}
@media (max-width: 380px) { .gate-illus { height: 170px; } .verify-form { flex-direction: column; } }

/* =====================================================================
   Espace patient (après connexion) — pensé d'abord pour le téléphone
   ===================================================================== */
.pt { max-width: 760px; margin: 0 auto; min-height: 100vh; overflow-x: hidden; }
.pt-body > * { min-width: 0; }
.pt-head { background: radial-gradient(600px 300px at 0% 0%, rgba(80,230,170,.4), transparent 60%), linear-gradient(160deg, #00A86B, #00875A 55%, #08697D); color: #fff; padding: 16px 16px 18px; border-radius: 0 0 28px 28px; }
.pt-top { display: flex; align-items: center; justify-content: space-between; }
.pt-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 13.5px; letter-spacing: .05em; }
.pt-brand img { border-radius: 9px; }
.pt-logout { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.pt-hello { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.pt-hello .avatar { box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.pt-hello p { margin: 0; font-size: 14px; color: rgba(255,255,255,.8); }
.pt-hello h1 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; color: #fff; line-height: 1.1; }
.pt-hello small { color: rgba(255,255,255,.75); font-size: 12.5px; }
.pt-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 20px; }
.pt-tile { background: #fff; color: var(--ink); border-radius: 18px; padding: 12px 3px 10px; text-align: center; text-decoration: none; box-shadow: 0 12px 30px -10px rgba(15,23,42,.3); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pt-tile strong { font-size: 20px; font-weight: 750; line-height: 1.1; }
.pt-tile > span:last-child { font-size: 10.5px; letter-spacing: -.01em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pt-tile-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; margin-bottom: 4px; }
.pt-tile.blue .pt-tile-ico { background: #E8F0FB; color: var(--blue); }
.pt-tile.green .pt-tile-ico { background: #E6F6EF; color: var(--green); }
.pt-tile.amber .pt-tile-ico { background: #FEF3E2; color: #C47A0A; }
.pt-tile.violet .pt-tile-ico { background: #F1EDFE; color: #6D4AD6; }
.pt-body { padding: 16px 14px 32px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.pt-card { background: #fff; border-radius: 20px; padding: 6px 0 4px; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 10px 30px -14px rgba(15,23,42,.18); border: 1px solid rgba(15,23,42,.05); scroll-margin-top: 12px; }
.pt-card-head { padding: 12px 18px 6px; }
.pt-card-head h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; }
.pt-card-head .icon { color: var(--green); }
.pt-list { list-style: none; margin: 0; padding: 0; }
.pt-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; color: var(--ink); text-decoration: none; border-top: 1px solid #F1F5F9; }
a.pt-item:hover, a.pt-item:active { background: #F8FAFC; }
.pt-ico { width: 38px; height: 38px; flex: none; border-radius: 12px; background: #F1F5F9; color: var(--blue); display: grid; place-items: center; font-size: 17px; }
.pt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pt-main strong { font-size: 14.5px; font-weight: 620; }
.pt-main small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-dl { color: var(--blue); font-size: 18px; flex: none; }
.pt-date { width: 46px; flex: none; text-align: center; border-radius: 12px; background: #E8F0FB; color: var(--blue); font-size: 11px; font-weight: 650; text-transform: uppercase; padding: 5px 0; line-height: 1.1; }
.pt-date b { display: block; font-size: 18px; }
.pt-empty { padding: 6px 18px 14px; color: var(--muted); font-size: 13.5px; margin: 0; }
.pt-more summary { list-style: none; cursor: pointer; padding: 10px 18px 12px; color: var(--blue); font-weight: 600; font-size: 13.5px; border-top: 1px solid #F1F5F9; }
.pt-more summary::-webkit-details-marker { display: none; }
.pt-more[open] summary { color: var(--muted); }
.pt-ask { padding: 10px 18px 14px; border-top: 1px solid #F1F5F9; }
.pt-ask summary { list-style: none; }
.pt-ask summary::-webkit-details-marker { display: none; }
.pt-ask[open] summary { margin-bottom: 12px; }
.pt-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.pt-notice { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 14px; background: #FFF7E6; color: #7A4B00; font-size: 13.5px; }
.pt-foot { display: flex; gap: 8px; align-items: flex-start; justify-content: center; text-align: center; font-size: 12px; color: var(--muted); margin: 8px 10px 0; }
@media (min-width: 760px) { .pt-head { border-radius: 0 0 32px 32px; padding: 22px 28px 24px; } .pt-body { padding: 20px 0 40px; } }
@media (max-width: 360px) { .pt-tile > span:last-child { font-size: 10.5px; } .pt-tile strong { font-size: 18px; } }
