/* Bravoyo — styles maison, aucune dépendance */
:root {
  --bg: #0f1420;
  --bg2: #161d2e;
  --card: #1b2338;
  --line: #2a3550;
  --text: #e8ecf5;
  --muted: #9aa5c0;
  --accent: #7c5cff;
  --accent2: #00d4a4;
  --danger: #ff5d6c;
  --warn: #ffb020;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
}
a { color: #9d8cff; }
.topbar {
  display: flex; align-items: center; gap: 1.5rem; padding: 0.7rem 1.2rem;
  background: var(--bg2); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 1.15rem; text-decoration: none; color: var(--text); }
.topbar nav { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover { color: var(--text); }
.userbox { margin-left: auto; color: var(--muted); font-size: 0.9rem; display: flex; gap: 0.8rem; align-items: center; }
.userbox em { font-style: normal; opacity: 0.7; }
.linklike { background: none; border: none; color: #9d8cff; cursor: pointer; font-size: 0.9rem; padding: 0; }
.linklike:hover { text-decoration: underline; }
.danger-text { color: var(--danger); }
.container { max-width: 1080px; margin: 0 auto; padding: 1.5rem 1.2rem 3rem; }
.footer { text-align: center; color: var(--muted); padding: 2rem; font-size: 0.85rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.2rem; margin-bottom: 1.2rem;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.count { background: var(--accent); border-radius: 999px; padding: 0.05rem 0.55rem; font-size: 0.8rem; }
.badge { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 0.45rem; font-size: 0.75rem; }
.alert { border-radius: 8px; padding: 0.8rem 1rem; margin-bottom: 1rem; }
.alert.error { background: #3a1d24; border: 1px solid var(--danger); }
.alert.ok { background: #123527; border: 1px solid var(--accent2); }
.btn {
  display: inline-block; background: var(--line); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 1rem;
  cursor: pointer; text-decoration: none; font-size: 0.95rem;
}
.btn:hover { filter: brightness(1.2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.small { padding: 0.25rem 0.6rem; font-size: 0.85rem; }
.impersonate-banner {
  background: #3a2f14; border: 1px solid var(--warn); color: var(--warn);
  padding: 0.4rem 0.8rem; border-radius: 8px; font-size: 0.9rem;
  display: flex; align-items: center; gap: 0.6rem;
}

/* ---- Organigramme visuel interactif ---- */
.org-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.org-tabs .btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.org-visuel { position: relative; }
.org-toolbar { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.8rem; flex-wrap: wrap; }
.org-search { position: relative; flex: 1; min-width: 220px; max-width: 340px; }
.org-search input { width: 100%; }
.org-search-results {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px;
  margin-top: 4px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.org-search-item, .org-search-empty {
  display: block; width: 100%; text-align: left; padding: 0.5rem 0.8rem;
  background: none; border: none; color: var(--text); cursor: pointer; font-size: 0.9rem;
}
.org-search-item:hover { background: var(--card); }
.org-breadcrumb { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 1rem; font-size: 0.9rem; }
.org-crumb { background: none; border: none; color: var(--muted); cursor: pointer; padding: 0.2rem 0.5rem; border-radius: 6px; }
.org-crumb:hover { background: var(--card); color: var(--text); }
.org-crumb-active { color: var(--accent); font-weight: 600; padding: 0.2rem 0.5rem; }
.org-sep { color: var(--muted); }
.org-canvas { position: relative; min-height: 420px; padding: 1.5rem 0; }
.org-lines { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.org-line { stroke-dasharray: 7; animation: org-dash 24s linear infinite; }
@keyframes org-dash { to { stroke-dashoffset: -800; } }
.org-focus { display: flex; justify-content: center; margin-bottom: 3.5rem; position: relative; z-index: 1; }
.org-children { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.6rem; position: relative; z-index: 1; }
.org-card {
  width: 240px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); padding: 1rem; cursor: pointer; position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.org-card:hover { transform: translateY(-4px); border-color: var(--role-color); box-shadow: 0 8px 24px -8px var(--role-color); }
.org-focus-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 0.15rem 0.7rem; border-radius: 999px; white-space: nowrap;
}
.org-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.7rem; }
.org-avatar {
  width: 46px; height: 46px; border-radius: 12px; border: 2px solid;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; color: var(--text);
}
.org-avatar.big { width: 72px; height: 72px; font-size: 1.5rem; border-radius: 18px; }
.org-role-badge { font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.org-card-name { font-weight: 700; font-size: 1rem; }
.org-card-titre { font-size: 0.82rem; color: var(--accent); font-weight: 600; margin-top: 0.1rem; }
.org-card-unit { margin-top: 0.15rem; }
.org-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 0.8rem; padding-top: 0.7rem; border-top: 1px solid var(--line); }
.org-count { font-size: 0.8rem; color: var(--text); background: var(--bg2); padding: 0.15rem 0.55rem; border-radius: 999px; }
.org-info { cursor: pointer; }
.org-fin { text-align: center; padding: 1.5rem 2rem; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); }
.org-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); z-index: 100;
  background: var(--bg2); border-left: 1px solid var(--line);
  box-shadow: -12px 0 32px rgba(0,0,0,0.5); display: flex; flex-direction: column;
  animation: org-slide-in 0.25s ease-out;
}
@keyframes org-slide-in { from { transform: translateX(40px); opacity: 0; } }
.org-drawer.hidden { display: none; }
.org-drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.org-drawer-head h3 { margin: 0; font-size: 1rem; }
.org-drawer-body { padding: 1.2rem; overflow-y: auto; }
.org-fiche-top { text-align: center; margin-bottom: 1.2rem; }
.org-fiche-top h2 { margin: 0.6rem 0 0.3rem; }
.org-fiche-liste dt { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.8rem; }
.org-fiche-liste dd { margin: 0.15rem 0 0; }
.org-fiche-equipe { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.org-fiche-equipe li { padding: 0.3rem 0; border-bottom: 1px solid var(--line); }
label { display: block; margin: 0.7rem 0; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; max-width: 420px; padding: 0.55rem 0.7rem; margin-top: 0.25rem;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; color: var(--text);
}
select[multiple] { min-height: 110px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.pill {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.8rem;
  background: var(--line); text-transform: capitalize;
}
.pill.en_cours { background: #2b3a67; }
.pill.termine { background: #123527; color: var(--accent2); }
.pill.annule { background: #3a1d24; color: var(--danger); }
.pill.a_faire { background: #3a2f14; color: var(--warn); }
.progress { background: var(--bg2); border-radius: 999px; height: 10px; overflow: hidden; margin: 0.4rem 0; min-width: 120px; }
.progress.big { height: 16px; }
.progress > div { background: linear-gradient(90deg, var(--accent), var(--accent2)); height: 100%; }
.tasklist { list-style: none; padding: 0; }
.tasklist li { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.tasklist li.late strong { color: var(--danger); }
.init-row { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; }
.tpl { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.tpl-icon { font-size: 2rem; }
.timeline { list-style: none; padding: 0; }
.step {
  background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--warn);
  border-radius: 10px; padding: 1rem; margin-bottom: 0.9rem;
}
.step.termine { border-left-color: var(--accent2); opacity: 0.85; }
.step-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.notes { background: var(--bg2); border-radius: 8px; padding: 0.6rem; }
.action-form { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px dashed var(--line); }
.reco { border-bottom: 1px solid var(--line); padding: 0.7rem 0; }
.reco-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin-bottom: 0.9rem; }
.reco-msg { font-size: 1.05rem; }
.likebtn { background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.8rem; cursor: pointer; color: var(--text); }
.likebtn.liked { border-color: var(--danger); }
.notif { display: flex; justify-content: space-between; gap: 1rem; background: var(--card); border: 1px solid var(--accent); border-radius: 10px; padding: 1rem; margin-bottom: 0.8rem; }
.notif.read { border-color: var(--line); opacity: 0.65; }
.notif-actions { display: flex; gap: 0.5rem; align-items: flex-start; }
.unit { margin-bottom: 0.4rem; }
.unit-head { font-size: 1.05rem; }
.member { padding: 0.25rem 0 0.25rem 1rem; color: var(--text); }
.tpl-row { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.login-card { max-width: 460px; margin: 4rem auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 2rem; }
.login-card h1 { margin-top: 0; }
.demo { margin-top: 1.2rem; font-size: 0.9rem; color: var(--muted); }
.demo code { background: var(--bg2); padding: 0.1rem 0.35rem; border-radius: 4px; }
.wall { margin-top: 1rem; }

/* Phase 2 — catalogue, cascade, candidatures */
.chip {
  display: inline-block; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 20px; padding: 0.2rem 0.7rem; margin-right: 0.4rem; font-size: 0.9rem;
}
.pill.cadence { background: #2b2440; color: #c9b8ff; }
.pill.propose { background: #3a2f14; color: var(--warn); }
.pill.retenu { background: #123527; color: var(--accent2); }
.pill.rejete { background: #3a1d24; color: var(--danger); }
.nomination {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.7rem 1rem; margin: 0.6rem 0;
}
.nomination-pick {
  display: block; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 8px; padding: 0.5rem 0.8rem; margin: 0.4rem 0;
}
label.check { cursor: pointer; }
.action-form { margin-top: 0.8rem; }
details summary { cursor: pointer; }

/* Onboarding */
.license-big { font-size: 1.3rem; }
.alert.ok { background: #123527; border: 1px solid #1e5c40; border-radius: 8px; padding: 0.8rem 1rem; margin: 1rem 0; }
.alert.error { background: #3a1d24; border: 1px solid #6e2b36; border-radius: 8px; padding: 0.8rem 1rem; margin: 1rem 0; }

/* Constructeur visuel */
.builder-row {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.8rem; margin: 0.6rem 0;
}
.builder-row input, .builder-row select, .builder-row textarea { margin: 0.2rem 0.3rem 0.2rem 0; }
.step-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.sticky { position: sticky; top: 1rem; }
.emoji { background: none; border: 1px solid var(--line); border-radius: 6px; font-size: 1.2rem; cursor: pointer; padding: 0.1rem 0.4rem; }
.emoji:hover { background: var(--bg2); }
.check.small { font-size: 0.9rem; }
