@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
  --bg:            #f7f6f3;
  --surface:       #ffffff;
  --surface-2:     #faf9f7;
  --surface-3:     #f0eeea;
  --border:        rgba(0,0,0,0.08);
  --border-md:     rgba(0,0,0,0.14);
  --ink:           #0d0d0b;
  --ink-2:         #2a2926;
  --ink-3:         #5c5954;
  --ink-4:         #9c9890;
  --teal:          #1d1548;
  --teal-dark:     #141039;
  --teal-mid:      #3d3288;
  --teal-soft:     #ebe9f6;
  --teal-glow:     rgba(29,21,72,0.12);
  --green:         #1d1548;
  --green-soft:    #ebe9f6;
  --amber:         #c2590a;
  --amber-soft:    #fff3e0;
  --red:           #c0392b;
  --red-soft:      #fdecea;
  --blue:          #1d55c9;
  --blue-soft:     #e8effc;
  --sidebar-w:     252px;
  --topbar-h:      64px;
  --r:             12px;
  --r-sm:          8px;
  --r-xs:          5px;
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:   cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.09), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 20px 48px rgba(0,0,0,0.13), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-teal: 0 4px 20px rgba(29,21,72,0.25);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

.app-wrapper { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  overflow: hidden;
}
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--teal-mid) 0%, transparent 100%);
  opacity: 0.35;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 36px; height: 36px;
  background: var(--teal);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06) inset;
  transition: transform 0.3s var(--ease-out);
}
.brand-mark:hover { transform: scale(1.05); }
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
}
.brand-mark svg { color: #fff; position: relative; z-index: 1; }
.brand-text-primary {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.brand-text-secondary {
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.03em;
  margin-top: 1px;
}

.nav-section-label {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 20px 20px 8px;
}

.nav-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 1px 8px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  border-radius: 9px;
  transition: background 0.2s var(--ease-out), color 0.2s, transform 0.15s;
  position: relative;
  cursor: pointer;
}
.nav-link-item:hover {
  background: var(--surface-3);
  color: var(--ink);
  transform: translateX(2px);
}
.nav-link-item.active {
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 500;
}
.nav-link-item.active .nav-icon { color: var(--teal) !important; }
.nav-icon {
  width: 15px; height: 15px;
  flex-shrink: 0;
  color: var(--ink);
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s, color 0.2s;
}
.nav-link-item:hover .nav-icon { opacity: 1; transform: scale(1.08); }
.nav-link-item.active .nav-icon { opacity: 1; }
.nav-link-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--teal-mid);
  border-radius: 0 3px 3px 0;
  margin-left: -8px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-footer > div:last-child {
  min-width: 0;
}
.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, #5c4fc9 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.06);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.sidebar-avatar:hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 3px rgba(92,79,201,0.25);
}
.sidebar-user-name { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.sidebar-user-role {
  font-size: 10.5px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
  line-height: 1.35;
}
#sidebar-clock {
  font-size: 10.5px;
  color: var(--ink-4);
  margin-top: 1px;
}

/* ── MAIN ── */
.main-area { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow 0.3s;
}
.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.topbar-sub {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 1px;
}
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.page-content {
  padding: 28px 32px;
  animation: pageFadeIn 0.35s var(--ease-out);
}
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── STAT CARDS ── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 24px;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s var(--ease-out), transform 0.3s var(--ease-out), border-color 0.3s;
  cursor: default;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--border-md);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--teal) 0%, var(--teal-mid) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}
.stat-card:hover::before { transform: scaleX(1); }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--teal-soft);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  transition: transform 0.35s var(--ease-out), background 0.3s;
}
.stat-card:hover .stat-icon {
  background: rgba(29,21,72,0.15);
  transform: scale(1.1) rotate(-4deg);
}
.stat-icon svg { color: var(--teal); }
.stat-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: black;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat-meta { font-size: 11.5px; color: var(--ink-4); margin-top: 6px; }
.stat-progress {
  height: 3px;
  background: var(--surface-3);
  border-radius: 99px;
  margin-top: 14px;
  overflow: hidden;
}
.stat-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-mid));
  border-radius: 99px;
  transition: width 1s var(--ease-out);
}

/* ── CARDS ── */
.lims-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 26px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.3s var(--ease-out), border-color 0.3s;
}
.lims-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-md); }

/* ── MENU RAPIDE (module launcher) ── */
.module-launcher-intro { margin-bottom: 16px; }
.module-launcher-intro-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.module-launcher-lead {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 0;
  max-width: 640px;
  line-height: 1.55;
}
.module-launcher-grid { align-items: stretch; }
.module-launcher-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 18px;
  height: 100%;
  min-height: 132px;
  padding: 22px 22px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s var(--ease-out), transform 0.3s var(--ease-out), border-color 0.3s;
}
.module-launcher-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--teal) 0%, var(--teal-mid) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out);
}
.module-launcher-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
  border-color: var(--border-md);
}
.module-launcher-card:hover::before { transform: scaleX(1); }
.module-launcher-card:focus-visible {
  outline: 2px solid var(--teal-mid);
  outline-offset: 2px;
}
.module-launcher-card-active {
  border-color: rgba(29, 21, 72, 0.22);
  background: linear-gradient(135deg, var(--surface) 0%, var(--teal-soft) 100%);
}
.module-launcher-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--teal-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.35s var(--ease-out), background 0.3s;
}
.module-launcher-card:hover .module-launcher-card-icon {
  background: rgba(29, 21, 72, 0.15);
  transform: scale(1.06) rotate(-3deg);
}
.module-launcher-card-icon svg { color: var(--teal); }
.module-launcher-card-body { flex: 1; min-width: 0; padding-top: 2px; }
.module-launcher-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.25;
}
.module-launcher-card-desc {
  font-size: 12px;
  color: var(--ink-3);
  margin: 0 0 14px;
  line-height: 1.5;
}
.module-launcher-card-cta {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.02em;
}
.module-launcher-card:hover .module-launcher-card-cta { color: var(--teal-dark); }

.card-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.card-heading-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--teal-mid);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--teal-soft);
}

/* ── TABLE ── */
.lims-table { width: 100%; border-collapse: collapse; font-size: 13px; font-weight: 600; color: var(--ink); }
.lims-table thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
.lims-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-weight: 600;
  vertical-align: middle;
}
.lims-table tbody tr:last-child td { border-bottom: none; }
.lims-table tbody tr { transition: background 0.15s; }
.lims-table tbody tr:hover td { background: var(--teal-soft); }
.lims-table .td-muted { color: var(--ink) !important; font-weight: 600; }
.lims-table .td-sm { font-weight: 600; }
.lims-table .badge-order { color: #ffffff; font-weight: 600; }
.lims-table .btn-inline { color: var(--ink); font-weight: 600; }
.td-muted { color: var(--ink-3) !important; }
.td-sm { font-size: 12px; }

/* ── BADGES ── */
.badge-order {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--r-xs);
  background: #10b981;
  border: 1px solid #10b981;
  color: #ffffff;
  letter-spacing: 0.04em;
}
.badge-age {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--r-xs);
  background: #6366f1;
  border: 1px solid #6366f1;
  color: #ffffff;
  letter-spacing: 0.04em;
}
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 3px 10px 3px 8px;
  border-radius: 99px;
}
.badge-status::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-done {
  background: #16a34a;
  color: #fff;
}
.badge-done::before {
  background: rgba(255, 255, 255, 0.95);
}
.badge-pending {
  background: #ea580c;
  color: #fff;
}
.badge-pending::before {
  background: rgba(255, 255, 255, 0.95);
  animation: pulseDot 2s ease infinite;
}
.badge-new     { background: var(--blue-soft);  color: var(--blue); }
.badge-new::before     { background: var(--blue); }

@keyframes pulseDot {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.5; transform:scale(1.5); }
}

.badge-abbrev {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  background: var(--teal-soft);
  border: 1px solid rgba(29,21,72,0.18);
  color: var(--teal-dark);
  letter-spacing: 0.04em;
  transition: background 0.2s, transform 0.2s;
}
.badge-abbrev:hover { background: rgba(29,21,72,0.15); transform: translateY(-1px); }

/* ── FORMS ── */
.form-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    /* text-transform: uppercase; */
    color: #000000;
    margin-bottom: 6px;
    display: block;
    font-family: 'Poppins';
}
.form-control, .form-select {
  font-size: 13.5px;
  border: 1.5px solid var(--border-md);
  border-radius: var(--r-sm);
  padding: 9px 13px;
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  outline: none;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
  appearance: auto;
}
.form-control:hover, .form-select:hover { border-color: var(--ink-4); }
.form-control:focus, .form-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-glow);
}
.form-control::placeholder { color: var(--ink-4); }
.form-control[readonly] { background: var(--surface-2); color: var(--ink-3); cursor: default; border-color: var(--border); }
.required-star { color: var(--red); margin-left: 2px; }
.field-hint { font-size: 10.5px; color: black; font-weight:500; margin-top: 5px; }

.form-section-sep {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 24px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-sep::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--teal-mid); flex-shrink: 0; }

/* ── BUTTONS ── */
.btn-primary-lims {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--r-sm);
  border: none;
  background: var(--teal);
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
  transition: background 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), transform 0.15s;
  box-shadow: 0 1px 3px rgba(29,21,72,0.3);
}
.btn-primary-lims:hover {
  background: var(--teal-dark);
  box-shadow: var(--shadow-teal);
  transform: translateY(-2px);
  color: #fff;
}
.btn-primary-lims:active { transform: translateY(0); }

.btn-ghost-lims {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border-md);
  background: var(--surface);
  color: var(--ink-3);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s var(--ease-out);
}
.btn-ghost-lims:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.btn-inline {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--r-xs);
  border: 1.5px solid var(--border-md);
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
.btn-inline:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }

.btn-danger-lims {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--r-xs);
  border: 1.5px solid rgba(192,57,43,0.25);
  background: var(--red-soft);
  color: var(--red);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}
.btn-danger-lims:hover { background: #fbd5d1; border-color: var(--red); transform: translateY(-1px); }

/* ── SEARCH ── */
.search-wrap { position: relative; flex: 1; max-width: 320px; }
.search-wrap svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--ink-4); pointer-events: none; transition: color 0.2s;
}
.search-wrap:focus-within svg { color: var(--teal); }
.search-input {
  font-size: 13px;
  padding: 9px 13px 9px 36px;
  border: 1.5px solid var(--border-md);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  outline: none;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.search-input:focus { border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-glow); }
.search-input::placeholder { color: var(--ink-4); }

/* ── SERVICE BARS ── */
.service-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; }
.service-bar-label { width: 68px; font-size: 11px; color: var(--ink-3); text-align: right; flex-shrink: 0; }
.service-bar-track { flex: 1; height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.service-bar-fill { height: 100%; background: linear-gradient(90deg, var(--teal) 0%, var(--teal-mid) 100%); border-radius: 99px; transition: width 0.8s var(--ease-out); }
.service-bar-count { width: 20px; font-size: 11.5px; font-weight: 500; color: var(--ink-2); text-align: right; flex-shrink: 0; }

/* ── VAR BLOCK ── */
.var-block {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  background: var(--surface-2);
  margin-bottom: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.var-block:hover { border-color: var(--border-md); box-shadow: var(--shadow-xs); }
.var-block-title { font-size: 10px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 12px; }

/* ── RESULT ROW ── */
.result-row {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 22px 24px;
  background: var(--surface);
  margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.25s, border-color 0.25s;
}
.result-row:hover { box-shadow: var(--shadow-sm); border-color: var(--border-md); }
.result-row-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.result-patient-id { font-size: 14px; font-weight: 500; color: var(--ink); }
.result-patient-name { font-size: 12px; color: var(--ink-3); margin-left: 10px; }

/* ── MATRIX ── */
.matrix-wrap { overflow-x: auto; }
.matrix-table { width: 100%; border-collapse: collapse; font-size: 12px; font-weight: 600; color: var(--ink); }
.matrix-table th, .matrix-table td { padding: 9px 14px; text-align: center; border: 1px solid var(--border); color: var(--ink); font-weight: 600; }
.matrix-table th { background: var(--surface-2); font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.matrix-table td:first-child { text-align: left; }
.matrix-check { color: var(--ink); font-weight: 600; font-size: 16px; }

/* ── FICHE RÉSULTAT ── */
.fiche-result {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 30px 34px;
  background: var(--surface);
  margin-bottom: 16px;
  max-width: 700px;
  box-shadow: var(--shadow-xs);
}
.fiche-header { border-bottom: 2px solid var(--teal); padding-bottom: 16px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: flex-end; }
.fiche-hospital { font-size: 11px; color: var(--ink-3); }
.fiche-title { font-size: 15px; font-weight: 700; margin-top: 6px; color: var(--ink); letter-spacing: -0.02em; }
.fiche-badge { background: var(--teal-soft); color: var(--teal-dark); font-size: 10px; font-weight: 500; padding: 5px 12px; border-radius: 99px; letter-spacing: 0.06em; text-transform: uppercase; }
.fiche-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; font-size: 12px; margin-bottom: 18px; }
.fiche-info-label { color: var(--ink-4); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.fiche-result-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 16px 0; font-weight: 600; color: var(--ink); }
.fiche-result-table th { background: var(--surface-2); padding: 8px 12px; text-align: left; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); border-bottom: 1px solid var(--border); font-weight: 600; }
.fiche-result-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--ink); font-weight: 600; }
.fiche-result-table .technique { font-style: italic; font-size: 11px; color: var(--ink); font-weight: 600; }
.fiche-conclusion { border-left: 3px solid var(--teal); padding: 12px 16px; background: var(--teal-soft); font-size: 12.5px; margin-top: 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--teal-dark); font-style: italic; }
.fiche-signature { display: flex; justify-content: space-between; margin-top: 24px; font-size: 11px; color: var(--ink-3); padding-top: 14px; border-top: 1px solid var(--border); }

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,13,11,0.55);
  z-index: 500;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-overlay.open { display: flex; animation: modalBgIn 0.25s var(--ease-out); }
@keyframes modalBgIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 34px;
  width: 540px;
  max-width: 96vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s var(--ease-out);
}
@keyframes modalSlideIn { from { opacity: 0; transform: scale(0.96) translateY(12px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-title { font-size: 20px; font-weight: 700; color: var(--ink); margin-bottom: 4px; letter-spacing: -0.03em; }
.modal-sub { font-size: 11.5px; color: var(--ink-4); margin-bottom: 24px; }
.modal-close {
  background: var(--surface-3);
  border: none;
  font-size: 16px;
  color: var(--ink-3);
  cursor: pointer;
  position: absolute;
  top: 22px; right: 22px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.modal-close:hover { background: var(--surface-3); color: var(--ink); transform: rotate(90deg); }

/* Print fiche — choix des paramètres / répartitions */
.fiche-print-rep-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  max-height: min(360px, 52vh);
  overflow-y: auto;
}
.fiche-print-rep-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.fiche-print-rep-row.is-disabled {
  opacity: 0.48;
  pointer-events: none;
}
.fiche-print-rep-meta {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 2px;
}
.fiche-print-rep-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.fiche-print-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.fiche-print-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* ── TOAST (top-right stack) ── */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  bottom: auto;
  left: auto;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.toast-msg {
  pointer-events: auto;
  background: green;
  color: rgba(255,255,255,0.9);
  font-size: 13px;
  font-weight: 400;
  padding: 12px 18px 12px 14px;
  border-radius: var(--r-sm);
  animation: toastIn 0.3s var(--ease-out);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md);
  max-width: min(360px, calc(100vw - 48px));
}
/* White checkmark in circle (success) */
.toast-msg::before {
  content: '';
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background-color: rgba(255, 255, 255, 0.12);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.2 6.4 11l6.1-6.1' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 50% 52%;
  background-size: 12px 12px;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.toast-error { background: #c0392b; }
.toast-error::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 4l8 8M12 4l-8 8' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 56px 0; color: var(--ink-4); }
.empty-state p { font-size: 13.5px; margin-top: 10px; color: var(--ink-3); }

/* ── UTILITY ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.text-muted { color: var(--ink-3); }
.text-faint { color: var(--ink-4); }
.text-primary { color: var(--teal); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* ── LOGIN ── */
body.login-body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(29, 21, 72, 0.08) 0%, transparent 55%),
    var(--bg);
}
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: clamp(28px, 4vw, 40px);
  box-shadow: var(--shadow-md);
}
.login-card::before {
  content: '';
  display: block;
  height: 3px;
  margin: calc(-1 * clamp(28px, 4vw, 40px)) calc(-1 * clamp(28px, 4vw, 40px)) clamp(20px, 3vw, 26px);
  border-radius: var(--r) var(--r) 0 0;
  background: linear-gradient(90deg, var(--teal) 0%, var(--teal-mid) 100%);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.login-card-header { margin-bottom: 22px; }
.login-card-title { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.03em; }
.login-card-desc { font-size: 13px; color: var(--ink-3); margin-top: 6px; line-height: 1.45; }

.login-field { margin-bottom: 18px; }
.login-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 13px;
  color: var(--ink-2);
  user-select: none;
}
.login-checkbox-row input { width: 17px; height: 17px; accent-color: var(--teal); cursor: pointer; }

.login-footer-note { text-align: center; margin-top: 22px; font-size: 12px; color: var(--ink-4); line-height: 1.5; }

.btn-primary-lims.login-submit {
  width: 100%;
  justify-content: center;
  padding: 12px 20px;
  font-size: 14px;
}

/* ── PRINT ── */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-area { margin-left: 0 !important; }
  .fiche-result { page-break-after: always; border: none !important; box-shadow: none; }
}
