/* Espace admin Eden Flavors : theme clair pour la lisibilite des donnees,
   toujours dans le monde de la marque (creme, vert profond, or). */

:root {
  --paper: #f7f3e9;
  --paper-2: #fffdf6;
  --ink: #14291d;
  --ink-soft: #51665a;
  --line: #e4dcc8;
  --green: #1d4530;
  --green-soft: #e7efe6;
  --gold: #b8892f;
  --gold-soft: #f4e8cd;
  --blush: #c96f5a;
  --blush-soft: #f7e4de;
  --red: #b5432f;
  --ease: cubic-bezier(0.25, 0.7, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

h1, h2, h3 { font-family: 'Bricolage Grotesque', 'Figtree', sans-serif; }

button { font-family: inherit; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.mono { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; }

/* ------------------------------------------------ login */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(160deg, #0c2017, #14291d);
}

.login-card {
  width: min(420px, 100%);
  background: var(--paper-2);
  border-radius: 22px;
  padding: 40px 36px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.login-card .brand {
  display: flex;
  align-items: center;
  margin-bottom: 22px;
}

.login-card .brand img { height: 40px; width: auto; display: block; }

.login-card h1 { font-size: 24px; margin-bottom: 6px; }

.login-card p { color: var(--ink-soft); margin-bottom: 24px; font-size: 14px; }

.login-card label { display: block; font-weight: 600; font-size: 13.5px; margin: 14px 0 6px; }

.login-card input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

.login-card input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(184, 137, 47, 0.15); }

.login-error { color: var(--red); font-size: 13.5px; margin-top: 12px; min-height: 20px; }

/* ------------------------------------------------ boutons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  background: var(--green);
  color: #fdfaf2;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 22px;
  cursor: pointer;
  transition: filter 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn:hover { filter: brightness(1.15); transform: translateY(-1px); }

.btn.gold { background: var(--gold); color: #241a04; }

.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }

.btn.ghost:hover { border-color: var(--gold); filter: none; }

.btn.danger { background: var(--blush-soft); color: var(--red); }

.btn.small { padding: 7px 14px; font-size: 13px; }

.btn:disabled { opacity: 0.5; cursor: wait; transform: none; }

/* ------------------------------------------------ coquille de l'app */

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

.app.on { display: grid; grid-template-columns: 232px minmax(0, 1fr); }

.sidebar {
  background: var(--ink);
  color: #e9e4d4;
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  margin-bottom: 26px;
  text-decoration: none;
}

.sidebar .brand img { height: 32px; width: auto; display: block; }

.sidebar button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  color: #c5cfc3;
  font-size: 14.5px;
  font-weight: 500;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.sidebar button:hover { background: rgba(217, 169, 78, 0.12); color: #fff; }

.sidebar button.active { background: rgba(217, 169, 78, 0.2); color: #f2d491; }

.sidebar .foot { margin-top: auto; display: grid; gap: 8px; }

.sidebar .foot .who { font-size: 12.5px; color: #8fa192; padding-left: 4px; }

.content { padding: 34px clamp(20px, 3.5vw, 46px) 80px; }

.content h1 { font-size: 26px; margin-bottom: 4px; }

.content .sub { color: var(--ink-soft); margin-bottom: 28px; font-size: 14px; }

.view { display: none; }

.view.on { display: block; animation: view-in 0.4s var(--ease) both; }

@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------ cartes et stats */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
}

.card .label { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

.card .value { font-family: 'Bricolage Grotesque', sans-serif; font-size: 32px; font-weight: 700; margin-top: 6px; }

.card .value small { font-size: 14px; color: var(--ink-soft); font-weight: 500; }

.card.gold-card { background: linear-gradient(150deg, var(--gold-soft), var(--paper-2)); border-color: #e0cb9a; }

.panel {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 26px;
  margin-bottom: 22px;
}

.panel h2 { font-size: 17px; margin-bottom: 16px; }

.two-col { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; align-items: start; }

/* funnel */

.funnel { display: grid; gap: 8px; }

.funnel-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 40px; gap: 12px; align-items: center; font-size: 13px; }

.funnel-row .bar-track { height: 22px; border-radius: 6px; background: var(--green-soft); overflow: hidden; }

.funnel-row .bar { height: 100%; background: linear-gradient(90deg, var(--green), #2c6a49); border-radius: 6px; min-width: 2px; transition: width 0.8s var(--ease); }

.funnel-row.total .bar { background: linear-gradient(90deg, var(--gold), #d9a94e); }

.funnel-row b { text-align: right; }

/* ------------------------------------------------ tables */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.toolbar input[type="search"] {
  flex: 1;
  min-width: 200px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-family: inherit;
  background: var(--paper-2);
  color: var(--ink);
}

.toolbar input[type="search"]:focus { outline: none; border-color: var(--gold); }

.seg { display: flex; gap: 4px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }

.seg button {
  border: none;
  background: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.seg button.active { background: var(--green); color: #fdfaf2; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--paper-2); }

table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }

th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-soft);
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td { padding: 13px 16px; border-bottom: 1px solid #efe9d8; vertical-align: middle; }

tr:last-child td { border-bottom: none; }

tbody tr { cursor: pointer; transition: background 0.2s var(--ease); }

tbody tr:hover { background: #fbf7ec; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  white-space: nowrap;
}

.pill.fort { background: var(--gold-soft); color: #8a6312; }
.pill.moyen { background: var(--green-soft); color: var(--green); }
.pill.faible { background: #eee9df; color: var(--ink-soft); }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--gold-soft); color: #8a6312; }
.pill.bad { background: var(--blush-soft); color: var(--red); }
.pill.neutral { background: #eee9df; color: var(--ink-soft); }

.step-dots { display: inline-flex; gap: 3px; align-items: center; }

.step-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
}

.step-dots i.done { background: var(--green); }

.step-dots i.full { background: var(--gold); }

.pill.gold-pill { background: var(--gold); color: #241a04; }

/* ------------------------------------------------ lecture du dossier */

.reading { display: grid; gap: 5px; }

.reading .reading-action {
  font-size: 12.5px;
  color: var(--gold);
  font-weight: 600;
}

.ai-card {
  background: linear-gradient(150deg, var(--gold-soft), var(--paper-2));
  border: 1px solid #e0cb9a;
  border-radius: 16px;
  padding: 18px 20px;
  margin: 18px 0 4px;
}

.ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ai-resume { font-size: 15px; line-height: 1.5; margin-bottom: 8px; }

.ai-action { font-size: 13.5px; font-weight: 600; color: #8a6312; }

.gauges {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.gauge { display: grid; gap: 5px; font-size: 11.5px; color: var(--ink-soft); }

.gauge .dots { display: flex; gap: 3px; }

.gauge .dots i {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(184, 137, 47, 0.22);
}

.gauge .dots i.on { background: var(--gold); }

.score-reasons { display: grid; gap: 6px; }

.reason {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  padding: 7px 12px;
  background: var(--paper);
  border-radius: 9px;
  border-left: 3px solid var(--green);
}

.reason.neg { border-left-color: var(--blush); }

.reason b { color: var(--green); flex: none; }

.reason.neg b { color: var(--red); }

.empty-state { padding: 44px; text-align: center; color: var(--ink-soft); }

/* ------------------------------------------------ drawer detail */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 32, 23, 0.4);
  display: none;
  z-index: 80;
}

.drawer-backdrop.open { display: block; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 94vw);
  background: var(--paper-2);
  z-index: 81;
  transform: translateX(105%);
  transition: transform 0.4s var(--ease);
  overflow-y: auto;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.25);
  padding: 30px 28px 60px;
}

.drawer.open { transform: none; }

.drawer .close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: var(--ink);
}

.drawer h2 { font-size: 22px; margin-bottom: 2px; padding-right: 40px; }

.drawer .mono-line { color: var(--ink-soft); font-size: 13px; margin-bottom: 18px; }

.drawer .photo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  float: right;
  margin-left: 12px;
}

.kv { display: grid; gap: 8px; margin: 18px 0; }

.kv div { display: flex; justify-content: space-between; gap: 14px; font-size: 13.5px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }

.kv dt { color: var(--ink-soft); flex: none; }

.kv dd { text-align: right; font-weight: 600; }

.drawer h3 { font-size: 14px; margin: 22px 0 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }

.drawer .action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

.drawer select, .drawer textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
}

.timeline { display: grid; gap: 8px; }

.timeline .evt {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  font-size: 13px;
  align-items: baseline;
  padding: 8px 10px;
  background: var(--paper);
  border-radius: 10px;
}

.timeline .evt .mono { color: var(--ink-soft); }

/* ------------------------------------------------ reglages */

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 22px; align-items: start; }

.panel label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 5px; }

.panel input[type="text"], .panel input[type="password"], .panel input[type="url"],
.panel input[type="number"], .panel input[type="email"], .panel select, .panel textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

.panel input:focus, .panel textarea:focus, .panel select:focus { outline: none; border-color: var(--gold); }

.panel textarea { line-height: 1.55; resize: vertical; }

.panel h3.sous-titre {
  font-size: 13px;
  margin: 22px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.panel .row { display: flex; gap: 10px; align-items: center; }

.panel .note { font-size: 12.5px; color: var(--ink-soft); margin-top: 8px; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }

.switch input { position: absolute; opacity: 0; }

.switch .knob {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  transition: background 0.3s var(--ease);
  flex: none;
}

.switch .knob::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.3s var(--ease);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.switch input:checked + .knob { background: var(--green); }

.switch input:checked + .knob::after { transform: translateX(20px); }

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: #f2edda;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  pointer-events: none;
  z-index: 100;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .app.on { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar .brand { margin-bottom: 0; margin-right: auto; }
  .sidebar button { width: auto; }
  .sidebar .foot { margin-top: 0; }
  .two-col { grid-template-columns: 1fr; }
}

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

/* un modele WhatsApp : son nom Meta et son illustration */
.tpl-row {
  padding: 12px 0 4px;
  border-top: 1px dashed var(--line);
}

.tpl-row:first-child { border-top: none; }

.tpl-row input + input { margin-top: 6px; }

.tpl-row input[type="url"] { font-size: 13px; color: var(--ink-soft); }

/* ------------------------------------------------ discussion dans la fiche */

.chat-admin {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
  padding: 12px;
  background: var(--paper);
  border-radius: 12px;
}

.chat-admin .ligne { display: grid; gap: 2px; font-size: 13.5px; }

.chat-admin .qui {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-soft);
}

.chat-admin .ligne.ketsia .qui { color: var(--gold); }

.chat-admin .dit {
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.chat-admin .ligne.ketsia .dit { background: var(--gold-soft); }

/* ------------------------------------------------ filtres croises */

.filtres {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 18px;
}

.filtres label {
  display: grid;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.filtres label.actif { color: var(--gold); }

.filtres select {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13.5px;
  background: #fff;
  color: var(--ink);
  min-width: 128px;
  cursor: pointer;
}

.filtres label.actif select { border-color: var(--gold); background: var(--gold-soft); }

.filtres select:focus { outline: none; border-color: var(--gold); }

.filtres .compte {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-left: auto;
}

/* ------------------------------------------------ sous-navigation des reglages */

.seg-reglages {
  flex-wrap: wrap;
  width: max-content;
  max-width: 100%;
  margin-bottom: 24px;
}

.subview { display: none; }

.subview.on { display: block; animation: view-in 0.35s var(--ease) both; }

.note-haut {
  font-size: 13.5px;
  color: var(--ink-soft);
  max-width: 74ch;
  margin-bottom: 18px;
}

/* ------------------------------------------------ boutons icone (crayon, poubelle) */

.ico {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  flex: none;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.ico:hover { background: #fff; color: var(--green); border-color: var(--gold); }

.ico.danger:hover { color: var(--red); border-color: var(--blush); background: var(--blush-soft); }

.ico svg { display: block; pointer-events: none; }

/* ------------------------------------------------ integrations */

.int-cat {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 26px 0 12px;
}

.int-groupe:first-child .int-cat { margin-top: 0; }

.int-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.int-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.int-card:hover { border-color: #d8ceb4; box-shadow: 0 10px 26px rgba(20, 41, 29, 0.07); }

.int-head { display: flex; align-items: flex-start; gap: 12px; }

.int-titre { min-width: 0; flex: 1; }

.int-titre h3 { font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }

.int-titre .int-cat-tag { font-size: 11.5px; color: var(--ink-soft); }

.int-actions { display: flex; gap: 6px; align-items: center; flex: none; }

.int-resume { font-size: 13px; color: var(--ink-soft); line-height: 1.5; flex: 1; }

.int-pieds { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.int-pieds .pill { max-width: 100%; white-space: normal; }

/* la pastille de logo : glyphe blanc sur la couleur de marque, repli en monogramme */

.int-logo {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--marque, var(--green));
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
}

.int-logo .ini {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1;
}

.int-logo .glyphe {
  display: none;
  width: 60%;
  height: 60%;
  background-color: #fff;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.int-logo.avec-logo .ini { display: none; }

.int-logo.avec-logo .glyphe { display: block; }

.int-logo.mini { width: 34px; height: 34px; border-radius: 10px; }

.int-logo.mini .ini { font-size: 12px; }

.int-logo.grand { width: 54px; height: 54px; border-radius: 16px; }

.int-logo.grand .ini { font-size: 19px; }

/* le gros bouton + */

.int-grid-ajout { margin-top: 26px; }

.int-add {
  min-height: 172px;
  width: 100%;
  border: 2px dashed var(--line);
  border-radius: 18px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  padding: 22px;
  font-family: inherit;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
}

.int-add:hover { border-color: var(--gold); background: var(--gold-soft); color: var(--ink); }

.int-add-plus {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--green);
  color: #fdfaf2;
}

.int-add:hover .int-add-plus { background: var(--gold); color: #241a04; }

.int-add-titre { font-family: 'Bricolage Grotesque', sans-serif; font-size: 15px; font-weight: 700; color: var(--ink); }

.int-add-note { font-size: 12.5px; }

/* le catalogue et la fiche dans le tiroir */

.drawer .int-entete { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; padding-right: 44px; }

.drawer .int-entete h2 { margin: 0; padding: 0; }

.drawer .drawer-recherche {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  margin: 16px 0 8px;
}

.drawer .drawer-recherche:focus { outline: none; border-color: var(--gold); }

.cat-liste { display: grid; gap: 10px; }

.cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.cat-item:hover { border-color: var(--gold); background: #fff; }

.cat-item .cat-nom { font-weight: 700; font-size: 14.5px; display: block; }

.cat-item .cat-resume { font-size: 12.5px; color: var(--ink-soft); display: block; line-height: 1.45; }

.cat-item .cat-plus { margin-left: auto; font-size: 20px; color: var(--ink-soft); flex: none; }

.champ-groupe { margin-top: 4px; }

.champ-groupe .aide { font-size: 12.5px; color: var(--ink-soft); margin-top: 5px; }

.drawer .champ-groupe label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 5px; }

.drawer .champ-groupe input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

.drawer .champ-groupe input:focus { outline: none; border-color: var(--gold); }

.drawer .champ-groupe .switch { margin: 14px 0 4px; }

.drawer .champ-groupe .switch input { width: auto; }

.avance {
  margin: 20px 0 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  padding: 0 14px;
}

.avance > summary {
  cursor: pointer;
  padding: 13px 0;
  font-weight: 600;
  font-size: 13.5px;
  list-style: none;
}

.avance > summary::-webkit-details-marker { display: none; }

.avance > summary::before { content: "▸ "; color: var(--ink-soft); }

.avance[open] > summary::before { content: "▾ "; }

.avance > div { padding-bottom: 14px; }

.bandeau-branchement {
  display: block;
  background: var(--gold-soft);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13px;
  color: #8a6312;
  margin: 14px 0;
  line-height: 1.5;
}

/* ------------------------------------------------ base de connaissance */

.kb-add {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 2px dashed var(--line);
  border-radius: 18px;
  background: transparent;
  padding: 18px 20px;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink-soft);
  margin-bottom: 18px;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.kb-add:hover { border-color: var(--gold); background: var(--gold-soft); }

.kb-add .int-add-plus { width: 44px; height: 44px; }

.kb-composer { animation: view-in 0.3s var(--ease) both; }

.kb-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 14px;
}

.kb-card.off { background: var(--paper); opacity: 0.72; }

.kb-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }

.kb-head h3 { font-size: 16px; flex: 1; min-width: 0; overflow-wrap: anywhere; }

.kb-contenu {
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.kb-contenu.replie {
  max-height: 7.2em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 60%, transparent);
  mask-image: linear-gradient(#000 60%, transparent);
}

.kb-plus {
  background: none;
  border: none;
  padding: 6px 0 0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold);
  cursor: pointer;
}

.kb-meta { font-size: 11.5px; color: var(--ink-soft); margin-top: 10px; }

.kb-card label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 5px; }

.kb-card.neuf { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(184, 137, 47, 0.16); }

.kb-card textarea, .kb-card input[type="text"] {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.55;
  background: #fff;
  color: var(--ink);
  resize: vertical;
}

.kb-card textarea:focus, .kb-card input:focus { outline: none; border-color: var(--gold); }

.kb-card .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }

.switch.mini .knob { width: 38px; height: 22px; }

.switch.mini .knob::after { width: 16px; height: 16px; }

.switch.mini input:checked + .knob::after { transform: translateX(16px); }

/* ------------------------------------------------ profil, comptes, securite */

.alerte-rouge {
  display: grid;
  gap: 4px;
  background: var(--blush-soft);
  border: 1px solid #e8c4b9;
  border-left: 5px solid var(--red);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 22px;
  color: var(--red);
  font-size: 13.5px;
  line-height: 1.55;
}

.alerte-rouge strong { font-size: 15px; }

.alerte-rouge span { color: #8d4032; }

.compte-ligne {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  background: var(--paper);
  border-radius: 12px;
  margin-bottom: 8px;
}

.compte-ligne .qui { flex: 1; min-width: 0; }

.compte-ligne .qui b { display: block; font-size: 14px; overflow-wrap: anywhere; }

.compte-ligne .qui span { font-size: 12px; color: var(--ink-soft); overflow-wrap: anywhere; }

.force { display: grid; gap: 6px; margin-top: 12px; }

.force-barres { display: flex; gap: 4px; }

.force-barres i {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  transition: background 0.3s var(--ease);
}

.force-mot { font-size: 12px; font-weight: 600; color: var(--ink-soft); }

.force.n1 .force-barres i:nth-child(-n+1) { background: var(--red); }
.force.n2 .force-barres i:nth-child(-n+2) { background: var(--blush); }
.force.n3 .force-barres i:nth-child(-n+3) { background: var(--gold); }
.force.n4 .force-barres i { background: var(--green); }

.force.n1 .force-mot { color: var(--red); }
.force.n3 .force-mot { color: #8a6312; }
.force.n4 .force-mot { color: var(--green); }

/* .panel label, .kb-card label et .drawer .champ-groupe label sont plus specifiques
   que .switch : sans ce rappel, l'interrupteur retombe en display:block et son bouton
   se pose sur le texte. */
.panel label.switch,
.kb-card label.switch,
.drawer .champ-groupe label.switch {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel label.switch { margin: 12px 0 6px; }

.kb-card label.switch { margin: 0; }

@media (max-width: 640px) {
  .seg-reglages { border-radius: 16px; width: 100%; }
  .int-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

/* Mention discrete a cote d'un libelle : « facultatif ». */
.facultatif {
  font-weight: 500;
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-left: 6px;
}

/* Etat des places, dans les reglages generaux. */
.places-etat { margin-top: 14px; }
.places-etat .evt b { font-weight: 700; }
