
/* =========
   Thème clair moderne — "medical soft"
   Palette : Bleu #2563eb / Sarcelle #0ea5a5 / Gris neutres
   ========= */
:root{
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-alt: #f9fafb;
  --text: #0f172a;
  --muted: #6b7280;
  --border: #dfe3ea;
  --primary: #2563eb;      /* bleu */
  --primary-600: #1e50c5;
  --accent: #0ea5a5;       /* sarcelle */
  --accent-600: #0b8585;
  --danger: #dc2626;
  --warn: #f59e0b;
  --ring: rgba(37, 99, 235, .35);
  --shadow: 0 6px 18px rgba(15, 23, 42, .06);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at -10% -10%, rgba(14,165,165,.10), transparent 60%),
    radial-gradient(900px 500px at 110% -20%, rgba(37,99,235,.08), transparent 60%),
    var(--bg);
}

/* ===== Layout ===== */
.container{ max-width: 1180px; margin: 0 auto; padding: 18px; }

/* ===== Topbar ===== */
.topbar{
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto auto; gap: 16px;
  align-items: center;
  padding: 10px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.90), rgba(255,255,255,.80));
  backdrop-filter: blur(8px) saturate(1.1);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(37,99,235,.05);
}
.brand{
  display: flex; align-items:center; gap: 10px;
  font-weight: 800; letter-spacing: .2px;
}
.brand::before{ content: "🩺"; font-size: 20px; }
.nav{ display:flex; gap: 6px; flex-wrap: wrap; }
.nav a{
  text-decoration: none;
  color: var(--text);
  background: var(--panel-alt);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 999px;
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
}
.nav a:hover{ background:#eef2ff; border-color:#cad4f3; transform: translateY(-1px); }
.nav a:active{ transform: translateY(0); }

.actions{ display:flex; gap: 8px; }

/* ===== Cards & sections ===== */
.grid{ display:grid; gap: 14px; }
.grid2{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px){ .grid2{ grid-template-columns: 1fr; } }

.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card .h{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 16px 0 16px;
}
.card .h h3, .card .h h4{ margin:0; }
.card .b{ padding: 12px 16px 16px 16px; }

/* ===== Typography ===== */
h1{ font-size: 28px; margin: 0 0 10px; }
h2{ font-size: 22px; margin: 0 0 10px; }
h3{ font-size: 18px; margin: 0; font-weight: 700; }
h4{ font-size: 16px; margin: 0; font-weight: 700; }
ul{ margin: 10px 0 0 18px; }
li{ margin: 6px 0; }

/* ===== Inputs ===== */
label.block{ display:block; }
.lab{
  display:flex; align-items:center; gap:6px;
  margin: 6px 0 6px; font-weight: 600; font-size: 13px; color: #0b1220;
}
.input, select, textarea{
  width:100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  outline: 0;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.input:focus, select:focus, textarea:focus{
  border-color: #b8c8ff;
  box-shadow: 0 0 0 4px var(--ring);
}
textarea{ min-height: 100px; resize: vertical; }
.row{ display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }

/* remove ugly number arrows (Chrome/Firefox) */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
input[type=number]{ -moz-appearance:textfield; }

/* ===== Buttons ===== */
.btn{
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 2px 0 rgba(15,23,42,.08);
  transition: filter .15s ease, transform .05s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover{ filter: saturate(1.05) brightness(1.02); }
.btn:active{ transform: translateY(1px); box-shadow: 0 1px 0 rgba(15,23,42,.08); }
.btn.ghost{ background: linear-gradient(#fff,#fff); color: var(--text); }
.btn.outline{ background:#fff; color: var(--text); }
.btn.danger{ background: var(--danger); color:#fff; }
.btn.success{ background: var(--accent); }
.btn.warn{ background: var(--warn); color:#111; }

/* ===== Badges / Tags ===== */
.tag{
  display:inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef2ff;
  color: #1e3a8a;
  border: 1px solid #cad4f3;
}

/* ===== Tables ===== */
table{ width:100%; border-collapse: collapse; overflow:hidden; border-radius: 12px; }
thead th{
  background: #f3f6ff;
  color: #1e3a8a;
  border-bottom: 1px solid #cad4f3;
  padding: 10px 12px; text-align:left; font-weight:700; font-size: 13px;
}
td{ padding: 10px 12px; border-top: 1px solid var(--border); }
tbody tr:hover{ background: #fafcff; }

/* ===== Footer ===== */
.footer{
  color: var(--muted);
  font-size: 13px;
  padding: 22px 18px;
  text-align: center;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(255,255,255,.85));
}

/* ===== Modal ===== */
.modal{ position: fixed; inset:0; background: rgba(2,6,23,.45); display:grid; place-items:center; z-index:50; }
.modal-box{
  width: min(560px, 96vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 18px 50px rgba(2,6,23,.15);
}
.modal-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom: 8px; }

/* ===== SVG (courbes) ===== */
svg{ max-width:100%; height:auto; display:block; }

/* ===== Impression : fiche uniquement ===== */
@media print{
  header, footer, [data-hide-print], main>*:not(.obs-root){
    display:none !important;
  }
  .obs-root{ display:block !important; box-shadow:none; border:1px solid #aaa; }
}
