/* =====================================================================
   Espace Qualité — Pharmacie Bourdariat
   Feuille de styles de l'application interne.
   ===================================================================== */
:root {
  --green: #1f9d72;
  --green-dark: #167a58;
  --green-light: #e7f6ef;
  --ink: #16241f;
  --muted: #64746e;
  --bg: #f4f7f6;
  --panel: #ffffff;
  --border: #e3ece8;
  --shadow: 0 10px 30px rgba(20, 60, 45, 0.07);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: "Poppins", sans-serif; line-height: 1.25; }
a { color: var(--green-dark); }
.brand__logo { display: inline-grid; place-items: center; }
.muted { color: var(--muted); }
.prewrap { white-space: pre-wrap; }

/* ===== Boutons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: "Poppins", sans-serif; font-weight: 600; font-size: .92rem;
  padding: 11px 20px; border-radius: 10px; border: 1.5px solid transparent;
  cursor: pointer; transition: background .15s, box-shadow .15s, transform .1s; background: none;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-dark); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--border); }
.btn--ghost:hover { background: var(--green-light); border-color: var(--green-light); }
.btn--danger { color: #c0392b; }
.btn--danger:hover { background: #fdecea; border-color: #f6d4cf; }
.btn--block { width: 100%; }
.btn--sm { padding: 7px 14px; font-size: .85rem; }

/* ===== Champs ===== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; flex: 1; }
.field label { font-size: .82rem; font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: .94rem; background: #fff; color: var(--ink);
  transition: border .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light);
}
.field textarea { resize: vertical; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row .field { min-width: 180px; }
.row[hidden] { display: none; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 4px 0; }
.check { display: flex; align-items: center; gap: 7px; font-size: .9rem; font-weight: 500; cursor: pointer; }
.check input { width: auto; }
.member-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.member-row { display: flex; gap: 10px; align-items: center; }
.member-row input { flex: 1; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 10px; font-family: inherit; font-size: .95rem; }
.member-row input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.form__err { color: #c0392b; font-size: .86rem; min-height: 1.1em; margin-bottom: 6px; }
.form__row-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }

/* ===================================================================
   AUTHENTIFICATION
   =================================================================== */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(160deg, var(--green-light), var(--bg) 60%); }
.auth__card { width: 100%; max-width: 410px; background: #fff; border: 1px solid var(--border);
  border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.auth__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth__brand strong { display: block; font-family: "Poppins", sans-serif; font-size: 1.1rem; }
.auth__brand small { color: var(--muted); font-size: .82rem; }
.auth__card h1 { font-size: 1.4rem; margin-bottom: 6px; }
.auth__intro, .auth__note { color: var(--muted); font-size: .88rem; }
.auth__intro { margin-bottom: 18px; }
.auth__card form { margin-top: 16px; }
.auth__note { margin-top: 16px; text-align: center; }
.auth__disclaimer { color: var(--muted); font-size: .76rem; max-width: 410px; text-align: center; margin-top: 18px; }

/* ===================================================================
   MISE EN PAGE APPLICATIVE
   =================================================================== */
.layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; }
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar__brand strong { display: block; font-family: "Poppins", sans-serif; font-size: .98rem; }
.sidebar__brand small { color: var(--muted); font-size: .76rem; }
.sidebar__nav { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; flex: 1; overflow-y: auto; min-height: 0; }
.navbtn { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border: none; background: none;
  border-radius: 10px; font-family: "Inter", sans-serif; font-size: .94rem; font-weight: 500; color: var(--ink);
  cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.navbtn span { font-size: 1.05rem; }
.navbtn:hover { background: var(--green-light); }
.navbtn.is-active { background: var(--green); color: #fff; }
.sidebar__foot { padding: 14px; border-top: 1px solid var(--border); flex-shrink: 0; }
.who { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.who__avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-family: "Poppins"; }
.who strong { display: block; font-size: .88rem; }
.who small { color: var(--muted); font-size: .76rem; }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar2 { display: flex; align-items: center; gap: 14px; padding: 16px 26px; background: #fff;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar2__title { font-family: "Poppins", sans-serif; font-weight: 600; font-size: 1.15rem; }
.burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.burger span { width: 22px; height: 2.4px; background: var(--ink); border-radius: 2px; }
.content { padding: 26px; }
.scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }

.view { max-width: 1080px; margin: 0 auto; }
.view--narrow { max-width: 760px; }
.loading { max-width: 1080px; margin: 40px auto; text-align: center; color: var(--muted); font-size: .95rem; }
.steps { margin: 8px 0 0; padding-left: 20px; color: var(--ink); font-size: .92rem; line-height: 1.7; }
.steps li { margin-bottom: 6px; }

/* ===== Cahier de liaison (notes) ===== */
.note-author { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.note-author label { font-size: .85rem; font-weight: 600; }
.note-author select { padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 9px; font-family: inherit; font-size: .9rem; background: #fff; min-width: 220px; }
.note-author select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.note-title-input { width: 100%; padding: 10px 13px; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: .95rem; font-weight: 600; margin-bottom: 8px; }
.note-title-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.note-card__title { font-size: 1rem; margin-bottom: 4px; }
.note-card__body { cursor: pointer; }
.note-card__body:hover .note-card__title, .note-card__body:hover .note-card__text { color: var(--green-dark); }
.note-compose { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 18px; }
.note-compose textarea { flex: 1; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: .95rem; resize: vertical; min-height: 46px; }
.note-compose textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.note-compose .btn { white-space: nowrap; }
.note-feed { display: flex; flex-direction: column; gap: 12px; }
.note-empty { text-align: center; padding: 10px 0; }
.note-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: #fbfdfc; }
.note-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.who__avatar--sm { width: 30px; height: 30px; font-size: .82rem; }
.note-card__meta { display: flex; flex-direction: column; line-height: 1.2; flex: 1; }
.note-card__meta strong { font-size: .9rem; }
.note-card__meta span { color: var(--muted); font-size: .76rem; }
.note-card__del { border: none; background: none; cursor: pointer; font-size: .95rem; opacity: .55; padding: 4px; border-radius: 6px; }
.note-card__del:hover { opacity: 1; background: #fdecea; }
.note-card__text { font-size: .94rem; cursor: pointer; }
.note-card__text:hover { color: var(--green-dark); }

@media (max-width: 480px) {
  .note-compose { flex-direction: column; }
  .note-compose .btn { width: 100%; }
}

/* ===== Panneaux ===== */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin-bottom: 22px; }
.panel h3 { font-size: 1.05rem; margin-bottom: 16px; }
.panel h3 small { color: var(--muted); font-weight: 500; font-size: .8rem; }
.panel--soft { background: #fffdf5; border-color: #f0e6c8; }

/* ===== Raccourci en haut du tableau de bord ===== */
.quickbar { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(120deg, var(--green-light), #fff 70%); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 22px; margin-bottom: 22px; }
.quickbar__text { display: flex; flex-direction: column; line-height: 1.3; }
.quickbar__text strong { font-family: "Poppins", sans-serif; font-size: 1.05rem; }
.quickbar__text span { color: var(--muted); font-size: .88rem; }
.quickbar .btn { white-space: nowrap; }
@media (max-width: 480px) { .quickbar { flex-direction: column; align-items: stretch; text-align: center; } .quickbar .btn { width: 100%; } }

/* ===== KPI ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.kpi__icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.2rem; margin-bottom: 12px; }
.kpi__val { display: block; font-family: "Poppins", sans-serif; font-weight: 700; font-size: 1.7rem; line-height: 1.1; }
.kpi__lbl { color: var(--muted); font-size: .82rem; }
.kpi--clickable { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.kpi--clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--green); }
.kpi--clickable::after { content: "Voir ›"; display: block; margin-top: 6px; font-size: .74rem; font-weight: 600; color: var(--muted); }
.kpi--clickable:hover::after { color: var(--green-dark); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

/* ===== Graphiques (barres horizontales) ===== */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar { display: grid; grid-template-columns: 140px 1fr 34px; align-items: center; gap: 12px; font-size: .86rem; }
.bar__track { background: var(--bg); border-radius: 99px; height: 12px; overflow: hidden; }
.bar__fill { display: block; height: 100%; border-radius: 99px; transition: width .4s ease; min-width: 2px; }
.bar__val { text-align: right; font-weight: 700; font-family: "Poppins"; }

/* ===== Graphique colonnes (empilées par type) ===== */
.cols { display: flex; align-items: flex-end; justify-content: space-around; gap: 8px; height: 180px; padding-top: 10px; }
.col { display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; flex: 1; }
.col__val { font-weight: 700; font-family: "Poppins"; font-size: .9rem; }
.col__bar { width: 70%; max-width: 38px; background: linear-gradient(180deg, var(--green), var(--green-dark)); border-radius: 8px 8px 0 0; transition: height .4s ease; }
.col__stack { display: flex; flex-direction: column-reverse; width: 70%; max-width: 38px; border-radius: 8px 8px 0 0; overflow: hidden; transition: height .4s ease; }
.col__stack .seg:first-child { border-radius: 8px 8px 0 0; }
.seg { width: 100%; transition: height .4s ease; }
.col__label { color: var(--muted); font-size: .76rem; text-transform: capitalize; }
/* Histogramme groupé (barres fines côte à côte), défilable horizontalement */
.cols-scroll { overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
/* 6 mois visibles par défaut ; les mois plus anciens se voient en défilant */
.cols--grouped { align-items: flex-end; gap: 6px; }
.mgroup { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 0 0 calc((100% - 30px) / 6); min-width: 44px; }
.mgroup__bars { display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.gbar { position: relative; width: 8px; border-radius: 3px 3px 0 0; transition: height .4s ease; }
.gbar__val { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); font-size: .68rem; font-weight: 700; font-family: "Poppins", sans-serif; color: var(--ink); }
.mgroup__label { color: var(--muted); font-size: .76rem; text-transform: capitalize; }
.mgroup__year { color: var(--green-dark); font-size: .68rem; font-weight: 700; min-height: 14px; margin-top: -4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.legend__item { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); }
.legend__dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }

/* ===== Stat ===== */
.stat-big { display: flex; flex-direction: column; gap: 8px; }
.stat-big__num { font-family: "Poppins"; font-weight: 700; font-size: 2.4rem; color: var(--green-dark); }
.stat-big__lbl { color: var(--muted); font-size: .9rem; }
.stat-mini { color: var(--muted); font-size: .82rem; margin-top: 6px; }

/* ===== Mini-liste ===== */
.mini-list { list-style: none; display: flex; flex-direction: column; }
.mini-list li { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: .88rem; }
.mini-list li:last-child { border-bottom: none; }
.mini-list li:hover { background: var(--green-light); border-radius: 8px; }
.mini-list__main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list__date { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ===== Choix de type ===== */
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.type-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px;
  border: 1.5px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer;
  font-family: "Inter"; font-size: .86rem; font-weight: 600; color: var(--ink); text-align: center; transition: .15s; }
.type-pick:hover { border-color: var(--c); background: #fafdfc; }
.type-pick.is-active { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.type-pick__icon { font-size: 1.7rem; }

/* ===== Tableau ===== */
.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filters select, .filters input[type="search"] { padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 9px; font-family: inherit; font-size: .86rem; background: #fff; }
.filters input[type="search"] { min-width: 260px; flex: 1; max-width: 360px; }
.filters input[type="search"]:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.filters__spacer { flex: 1; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; padding: 10px 12px; color: var(--muted); font-weight: 600; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--border); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr:hover { background: var(--green-light); }
.td-desc { color: var(--muted); }
.td-actions { text-align: right; }

/* ===== Badges & tags ===== */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px;
  font-size: .78rem; font-weight: 600; background: color-mix(in srgb, var(--c) 12%, white); color: var(--c); white-space: nowrap; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.badge--low { background: #e8f5ee; color: #1f9d72; }
.badge--mid { background: #fff3df; color: #c77700; }
.badge--high { background: #fde7e2; color: #d9531e; }
.badge--crit { background: #fde7e7; color: #c0392b; }
.badge--open { background: #fff3df; color: #c77700; }
.badge--progress { background: #e6f0fd; color: #2563eb; }
.badge--done { background: #e8f5ee; color: #1f9d72; }
.badge--admin { background: var(--green-light); color: var(--green-dark); }

/* ===== Outils ISO ===== */
.iso-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.iso-tab { padding: 10px 18px; border: 1.5px solid var(--border); background: #fff; border-radius: 999px;
  font-family: "Poppins", sans-serif; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--ink); }
.iso-tab:hover { background: var(--green-light); }
.iso-tab.is-active { background: var(--green); color: #fff; border-color: var(--green); }

.swot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.swot-cell { display: flex; flex-direction: column; gap: 6px; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px; }
.swot-cell label { font-family: "Poppins", sans-serif; font-weight: 600; font-size: .92rem; }
.swot-cell label small { display: block; color: var(--muted); font-weight: 400; font-size: .74rem; }
.swot-cell textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-family: inherit; font-size: .9rem; resize: vertical; }
.swot-cell textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.swot--forces { border-top: 4px solid #1f9d72; } .swot--faiblesses { border-top: 4px solid #f59e0b; }
.swot--opportunites { border-top: 4px solid #3b82f6; } .swot--menaces { border-top: 4px solid #ef4444; }

.risk-table input, .risk-table select { width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; font-family: inherit; font-size: .86rem; }
.risk-table td { vertical-align: middle; }
.rk-crit { text-align: center; font-weight: 700; font-family: "Poppins"; }
.crit-low { color: #1f9d72; } .crit-mid { color: #c77700; } .crit-high { color: #c0392b; }

.iso-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }

/* Grille des risques officine */
.risk-cat { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.risk-cat > summary { padding: 12px 16px; cursor: pointer; font-family: "Poppins", sans-serif; font-weight: 600; background: var(--bg-alt); list-style: none; }
.risk-cat > summary::-webkit-details-marker { display: none; }
.risk-cat__body { padding: 4px 16px 12px; }
.risk-item { border-top: 1px solid var(--border); padding: 12px 0; }
.risk-item:first-child { border-top: none; }
.risk-item__head { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.risk-item__head input[type="checkbox"] { width: auto; flex-shrink: 0; }
.risk-item__name { font-weight: 600; font-size: .94rem; }
.risk-customname { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-weight: 600; font-size: .92rem; }
.risk-item__body { margin: 10px 0 0 28px; display: flex; flex-direction: column; gap: 8px; }
.risk-item__body[hidden] { display: none; }
.risk-ex strong { font-size: .8rem; }
.risk-ex p { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.risk-saisie-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.risk-saisie { flex: 1; min-width: 200px; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 8px; font-family: inherit; font-size: .9rem; }
.risk-saisie:focus, .risk-customname:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.risk-plan { white-space: nowrap; }
.risk-actions[hidden] { display: none; }
.risk-actions input, .risk-actions select { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; font-family: inherit; font-size: .84rem; }

.rdd-banner { background: var(--green-light); color: var(--green-dark); border-radius: 10px; padding: 10px 14px; font-weight: 600; font-size: .9rem; margin-bottom: 16px; }
.rdd-entete { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; background: var(--bg-alt); }
.rdd-entete h4 { font-size: .95rem; margin-bottom: 10px; }
.rdd-entete .field input, .rdd-entete .field textarea { width: 100%; padding: 8px 11px; border: 1.5px solid var(--border); border-radius: 8px; font-family: inherit; font-size: .9rem; }
.rdd-entete .field input:focus, .rdd-entete .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.rdd-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.rdd-progress__bar { flex: 1; height: 12px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.rdd-progress__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--green-dark)); width: 0; transition: width .3s ease; }
.rdd-progress__pct { font-weight: 700; font-family: "Poppins"; font-size: .86rem; color: var(--green-dark); white-space: nowrap; }
.rdd-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.rdd-item { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.rdd-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; }
.rdd-item summary::-webkit-details-marker { display: none; }
.rdd-item__title { font-weight: 500; font-size: .92rem; }
.rdd-status { font-size: .76rem; font-weight: 700; color: #c77700; background: #fff3df; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.rdd-status.is-filled { color: var(--green-dark); background: var(--green-light); }
.rdd-text { width: calc(100% - 28px); margin: 0 14px 14px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: inherit; font-size: .9rem; resize: vertical; }
.rdd-text:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }

/* Sous-formulaire structuré « Contexte et plan stratégique » */
.rdd-struct { padding: 0 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.rdd-struct__ref { background: var(--green-light); color: var(--green-dark); border-radius: 8px; padding: 8px 12px; font-size: .85rem; margin-bottom: 6px; }
.rdd-struct__ref span { color: var(--muted); }
.rdd-sf-label { font-weight: 600; font-size: .88rem; margin-top: 8px; }
.rdd-sf-label small { font-weight: 400; color: var(--muted); }
.rdd-sf-h { font-family: "Poppins", sans-serif; font-size: .95rem; margin: 14px 0 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.rdd-struct textarea { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-family: inherit; font-size: .9rem; resize: vertical; }
.rdd-struct textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.rdd-radio { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 6px 0; font-size: .88rem; }
.rdd-opts { display: inline-flex; gap: 16px; }
.rdd-opt { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.rdd-opt input { width: auto; }
.rdd-fiches-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 6px; }
.rdd-fiche-link { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: .88rem; cursor: pointer; }
.rdd-fiche-link:hover { background: var(--green-light); border-color: var(--green-light); }
.rdd-check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; cursor: pointer; margin-top: 4px; }
.rdd-check input { width: auto; }

@media (max-width: 760px) { .swot-grid { grid-template-columns: 1fr; } }

/* ===== Modale ===== */
.modal { position: fixed; inset: 0; background: rgba(15, 35, 28, .5); display: grid; place-items: center;
  padding: 18px; z-index: 60; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal__card { background: #fff; border-radius: 18px; width: 100%; max-width: 600px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal__close { border: none; background: var(--bg); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 1rem; }
.modal__close:hover { background: var(--border); }
.modal__body { padding: 22px; overflow-y: auto; }
.modal__body h4 { margin: 18px 0 6px; font-size: .92rem; }
.modal__foot { display: flex; justify-content: space-between; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--border); }
.modal__body textarea { width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 10px; font-family: inherit; font-size: .92rem; resize: vertical; }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: .84rem; color: var(--muted); margin-bottom: 14px; }
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; background: var(--bg); border-radius: 12px; padding: 14px 16px; margin-bottom: 6px; }
.dl dt { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.dl dd { font-weight: 600; font-size: .9rem; }
.history { list-style: none; font-size: .82rem; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.history li span { font-weight: 600; color: var(--ink); }

/* ===== Fiche de progrès (dans la fiche détaillée) ===== */
.fiche { margin-top: 18px; border-top: 2px solid var(--border); padding-top: 14px; }
.fiche-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.fiche-form[hidden] { display: none; }
.fiche-form textarea { width: 100%; border: 1.5px solid var(--border); border-radius: 8px; padding: 9px 11px; font-family: inherit; font-size: .9rem; resize: vertical; }
.fiche-form textarea:focus, .fiche-form input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
.fiche-actions th, .fiche-actions td { padding: 6px 8px; }
.fiche-actions input, .fiche-actions select { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; font-family: inherit; font-size: .84rem; }
.fiche-actions .fa-libelle { min-width: 140px; }
.fiche-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 80px);
  background: var(--ink); color: #fff; padding: 13px 22px; border-radius: 12px; font-weight: 600; font-size: .9rem;
  box-shadow: var(--shadow); z-index: 90; opacity: 0; transition: transform .3s, opacity .3s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.warn { background: #c77700; }
.toast.err { background: #c0392b; }

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 900px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: 1fr 1fr; }
  .dl-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow); }
  .sidebar.is-open ~ .scrim { display: block; }
  .burger { display: flex; }
  .content { padding: 18px; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: 1fr; }
  .form__row-actions { flex-direction: column-reverse; }
  .form__row-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto; } }
