/* ============================================================
   style.css — devischirurgie.clinilac.com
   Version 2.0 — Thème SOMBRE, charte HF Graphisme recolorée
   Largeur max 1800px (Starting Kit)
   ============================================================ */

:root {
  /* Palette de marque */
  --vert-doux:     #B2EBC9;
  --vert-primaire: #4C9A84;
  --neutre:        #A7A194;
  --fond-clair:    #F6F3E7;
  --accent:        #DAC78F;

  /* Déclinaison sombre */
  --bg:            #12181f;   /* fond général sombre */
  --bg-2:          #1a222c;   /* cartes */
  --bg-3:          #212c38;   /* éléments surélevés */
  --ligne:         #2c3a48;   /* bordures */
  --texte:         #e8ecef;   /* texte principal clair */
  --texte-2:       #9fb0bd;   /* texte secondaire */
  --danger:        #ff6b6b;
  --danger-bg:     #3a2020;
  --ok:            #7fe0b0;
  --ok-bg:         #1c3529;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Afacad', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--texte);
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: 'Champagne', 'Afacad', Georgia, serif;
  color: var(--vert-doux);
  font-weight: 600;
  margin-top: 0;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; margin-top: 1.4rem; }
h3 { font-size: 1.05rem; }

a { color: var(--vert-doux); }

/* ---------- Barre de navigation ---------- */
.topbar {
  background: var(--bg-2);
  border-bottom: 3px solid var(--vert-primaire);
  padding: 0.7rem 1.6rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  flex-wrap: wrap;
}
.topbar .brand {
  font-family: 'Champagne', Georgia, serif;
  font-size: 1.25rem;
  color: var(--vert-doux);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: .5px;
}
.topbar nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.topbar nav a {
  text-decoration: none;
  color: var(--texte);
  padding: 0.3rem 0.2rem;
  border-bottom: 2px solid transparent;
}
.topbar nav a:hover { border-bottom-color: var(--accent); color: var(--vert-doux); }
.topbar .spacer { flex: 1; }
.topbar .user { font-size: 0.85rem; color: var(--texte-2); }

/* ---------- Conteneur (largeur max 1800px) ---------- */
.container { max-width: 1800px; margin: 1.8rem auto; padding: 0 1.6rem; }
.container-narrow { max-width: 1100px; }

/* ---------- Cartes ---------- */
.card {
  background: var(--bg-2);
  border: 1px solid var(--ligne);
  border-radius: 14px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.4rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}

/* ---------- Formulaires ---------- */
label { display: block; font-weight: 600; margin: 0.6rem 0 0.25rem; font-size: 0.88rem; color: var(--texte-2); }
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=email], select, textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--ligne);
  border-radius: 9px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg-3);
  color: var(--texte);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--vert-primaire);
  box-shadow: 0 0 0 2px rgba(76,154,132,.3);
}
textarea { min-height: 120px; resize: vertical; }
select option { background: var(--bg-3); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.2rem; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1.2rem; }
.grid4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 0 1rem; }
@media (max-width: 760px) { .grid2,.grid3,.grid4 { grid-template-columns: 1fr; } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  background: var(--vert-primaire);
  color: #06120d;
  border: none;
  border-radius: 9px;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--vert-doux); }
.btn:active { transform: translateY(1px); }
.btn-sec {
  background: transparent;
  color: var(--vert-doux);
  border: 1px solid var(--vert-primaire);
}
.btn-sec:hover { background: rgba(76,154,132,.15); }
.btn-danger { background: var(--danger); color: #2a0e0e; }
.btn-danger:hover { background: #ff8a8a; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.82rem; }

/* ---------- Tableaux ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.tbl th {
  background: var(--bg-3);
  color: var(--vert-doux);
  text-align: left;
  padding: 0.55rem 0.7rem;
  font-weight: 600;
  border-bottom: 2px solid var(--vert-primaire);
}
table.tbl td { padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--ligne); }
table.tbl tr:hover td { background: var(--bg-3); }

/* ---------- Badges ---------- */
.badge { padding: 0.15rem 0.6rem; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.badge-valide { background: var(--ok-bg); color: var(--ok); }
.badge-brouillon { background: #2f2a1a; color: var(--accent); }
.badge-bloque { background: var(--danger-bg); color: var(--danger); }

/* ---------- Flash ---------- */
.flash { padding: 0.8rem 1.1rem; border-radius: 10px; margin-bottom: 1rem; font-size: 0.92rem; }
.flash-success { background: var(--ok-bg); color: var(--ok); border: 1px solid #2c5a44; }
.flash-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #5a2c2c; }

/* ---------- Aperçu de calcul ---------- */
.apercu {
  background: var(--bg-3);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
}
.apercu .ligne {
  display: flex; justify-content: space-between;
  padding: 0.35rem 0; border-bottom: 1px dashed var(--ligne);
}
.apercu .ligne.total {
  border-bottom: none; border-top: 2px solid var(--vert-primaire);
  margin-top: 0.4rem; padding-top: 0.6rem;
  font-weight: 700; font-size: 1.15rem; color: var(--vert-doux);
}
.apercu .montant { font-variant-numeric: tabular-nums; }
.apercu-bloque {
  background: var(--danger-bg); border: 1px solid var(--danger);
  color: var(--danger); padding: 0.9rem 1.1rem; border-radius: 10px;
  margin-top: 0.8rem; font-weight: 600;
}
.apercu-info {
  background: var(--ok-bg); border: 1px solid #2c5a44;
  color: var(--ok); padding: 0.6rem 0.9rem; border-radius: 8px;
  margin-top: 0.6rem; font-size: 0.85rem;
}

/* ---------- Sélecteur d'actes ---------- */
.actes-box {
  max-height: 280px; overflow-y: auto;
  border: 1px solid var(--ligne); border-radius: 10px; padding: 0.5rem;
  background: var(--bg-3);
}
.acte-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.28rem 0.3rem; }
.acte-item:hover { background: var(--bg-2); border-radius: 6px; }
.acte-item label { margin: 0; font-weight: 400; font-size: 0.88rem; cursor: pointer; color: var(--texte); }
.acte-item .prix { margin-left: auto; color: var(--texte-2); font-size: 0.8rem; }

.mode-choix { display: flex; gap: 1rem; margin: 0.5rem 0; }
.mode-choix label {
  flex: 1; border: 2px solid var(--ligne); border-radius: 10px;
  padding: 0.7rem; cursor: pointer; font-weight: 500; text-align: center;
  color: var(--texte); margin: 0;
}
.mode-choix input { display: none; }
.mode-choix label:has(input:checked) {
  border-color: var(--vert-primaire); background: rgba(76,154,132,.15); color: var(--vert-doux);
}

.muted { color: var(--texte-2); font-size: 0.85rem; }
.right { text-align: right; }
hr.sep { border: none; border-top: 1px solid var(--ligne); margin: 1.4rem 0; }
