/* ─────────────────────────────────────────────────────────────
   Intranet Protecsure Électronique — charte graphique
   Reprend fidèlement les styles de la maquette de référence.
───────────────────────────────────────────────────────────── */

:root {
  --bg:#0a1220; --panel:#0f1a2c; --panel2:#142338; --line:#21344f;
  --ink:#e8eef6; --muted:#8fa3bf; --dim:#5d7088;
  --navy:#15335B; --navy-lt:#1e4a82; --navy-soft:#15335b40;
  --acc:#2fb6d4; --acc-soft:#0e3340; --acc-ink:#04141a;
  --ok:#34c77b; --warn:#e8a23d; --bad:#ee5a52; --info:#3d8fd6;
  --radius:8px; --shadow:0 4px 20px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 13px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #1e3147; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

a { color: inherit; text-decoration: none; }

/* ─── Layout principal ─── */
#app { display: flex; height: 100vh; overflow: hidden; }
aside {
  width: 236px; flex: 0 0 236px;
  background: #070d18; border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.brand {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 11px;
  text-decoration: none; color: inherit;
}
.brand img { width: 54px; height: 54px; object-fit: contain; }
.brand .name { font-weight: 800; letter-spacing: 2px; font-size: 17px; line-height: 1.1; }
.brand .sub { color: var(--acc); font-size: 8.5px; letter-spacing: .6px; text-transform: uppercase; margin-top: 3px; white-space: nowrap; }
/* Tagline bicolore ATENA : « SYSTÈME & » bleu, « INCENDIE » rouge (lisible sur fond sombre) */
.brand .sub .s-sys, .auth-brand .sub .s-sys { color: #86a9e0; font-weight: 700; }
.brand .sub .s-inc, .auth-brand .sub .s-inc { color: #f2524a; font-weight: 700; }

nav { padding: 10px 8px; overflow-y: auto; flex: 1; }
nav .grp {
  color: #4f6680;
  font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase;
  padding: 14px 10px 6px;
}
.navbtn {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 6px;
  color: var(--muted); font-size: 13.5px;
  margin-bottom: 1px; transition: .12s;
  position: relative; cursor: pointer;
}
.navbtn:hover { background: var(--panel); color: var(--ink); }
.navbtn.on { background: var(--navy-soft); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--acc); }
.navbtn .ic { width: 18px; text-align: center; font-size: 15px; }

.who {
  padding: 12px 14px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.who .av {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy); display: grid; place-items: center;
  font-weight: 700; font-size: 12px; color: #fff;
}
.who .nm { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .rl { font-size: 10.5px; color: var(--dim); }
.av-sm {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy); display: grid; place-items: center;
  font-weight: 700; font-size: 11px; color: #fff;
}

main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
header.top {
  padding: 14px 26px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--panel); flex: 0 0 auto;
}
header.top h1 { margin: 0; font-size: 18px; font-weight: 700; }
header.top .crumb { color: var(--dim); font-size: 11.5px; margin-top: 2px; }
.content { flex: 1; overflow-y: auto; padding: 24px 26px; }

/* ─── Boutons ─── */
.btn {
  background: var(--navy); color: #fff; border: none;
  padding: 8px 15px; border-radius: 6px;
  font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--navy-lt); }
.btn.acc { background: var(--acc); color: var(--acc-ink); }
.btn.acc:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.ghost:hover { color: var(--ink); border-color: #2d445f; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid #4a2421; }
.btn.danger:hover { background: #2a1513; }

/* ─── Cartes & layout grids ─── */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kpi {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  position: relative; overflow: hidden;
}
.kpi .lab { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; }
.kpi .val { font-size: 27px; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; }
.kpi .foot { font-size: 11.5px; color: var(--dim); margin-top: 3px; }
.kpi .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--acc); }

/* ─── Tableaux ─── */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px;
  padding: 9px 12px; border-bottom: 1px solid var(--line); font-weight: 600;
}
td { padding: 11px 12px; border-bottom: 1px solid #172638; font-size: 13px; }
tr:hover td { background: #122036; }
td.r, th.r { text-align: right; }

/* ─── Tags ─── */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.tag.ok { background: #0f2e1f; color: var(--ok); }
.tag.warn { background: #332512; color: var(--warn); }
.tag.bad { background: #331715; color: var(--bad); }
.tag.info { background: #102a40; color: var(--acc); }
.tag.dim { background: #1a2940; color: var(--muted); }
.tag.prospect { background: #2a2412; color: var(--warn); }
.tag.client { background: #0f2e1f; color: var(--ok); }

/* ─── Utilitaires ─── */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sec-title { font-size: 15px; font-weight: 700; margin: 0 0 2px; }
.sec-sub { color: var(--dim); font-size: 12px; margin: 0 0 16px; }
.muted { color: var(--muted); }
.mini { font-size: 11.5px; }
.stk-low { color: var(--bad); font-weight: 700; }
.link { color: var(--acc); cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }
.chip { padding: 2px 8px; border-radius: 5px; background: var(--bg); border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

/* ─── Formulaires ─── */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; }
.field label {
  font-size: 11.5px; color: var(--muted);
  font-weight: 600; letter-spacing: .3px;
}
.field input, .field select, .field textarea {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  padding: 8px 11px; border-radius: 6px; outline: none; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--acc); }
.field textarea { resize: vertical; min-height: 64px; }
.field.row2 { flex-direction: row; gap: 12px; }
.field.row2 > div { flex: 1; }
.field.row3 { flex-direction: row; gap: 12px; }
.field.row3 > div { flex: 1; }

/* Barre de recherche pleine largeur (ex : liste prospects & clients) */
.search-input {
  width: 100%; background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 40px 11px 14px; font-size: 14px;
}
.search-input:focus { border-color: var(--acc); outline: none; box-shadow: 0 0 0 2px rgba(47, 182, 212, .2); }
.search-input::placeholder { color: var(--muted); }
.search-wrap { position: relative; }
.search-wrap::after {
  content: "⌕"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 18px; pointer-events: none;
}

/* Champ de recherche avec liste déroulante filtrée (ex : choix client) */
.combo { position: relative; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  max-height: 260px; overflow-y: auto; box-shadow: var(--shadow);
}
.combo-item { padding: 9px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid #172638; }
.combo-item:last-child { border-bottom: none; }
.combo-item:hover, .combo-item.active { background: var(--panel2); }
.combo-empty { padding: 12px; color: var(--muted); font-size: 13px; }

/* Liste déroulante autonome à la charte CRM (ex : filtre commercial du pipeline) */
.select-crm {
  background: var(--panel2); color: var(--ink);
  border: 1px solid var(--line); border-left: 3px solid var(--acc);
  border-radius: 7px; padding: 9px 12px; font-size: 13px; font-weight: 600;
  cursor: pointer; min-width: 190px;
}
.select-crm:hover { border-color: var(--acc); }
.select-crm:focus { border-color: var(--acc); outline: none; box-shadow: 0 0 0 2px rgba(47, 182, 212, .2); }

/* Deux vrais boutons de choix (ex : Entreprise / Particulier) */
.seg { display: flex; gap: 10px; width: 100%; }
.seg label { flex: 1; margin: 0; cursor: pointer; display: flex; }
.seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg span {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 9px;
  font-size: 14.5px; font-weight: 700; color: var(--ink); background: var(--panel2);
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.seg span .ic { font-size: 17px; line-height: 1; }
.seg label:hover span { border-color: var(--acc); }
.seg input:checked + span {
  background: var(--acc); border-color: var(--acc); color: var(--acc-ink);
  box-shadow: 0 2px 10px rgba(47, 182, 212, .25);
}
.seg input:focus-visible + span { outline: 2px solid var(--acc); outline-offset: 2px; }
.check {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink); cursor: pointer;
}
.check input[type="checkbox"] { accent-color: var(--acc); width: 16px; height: 16px; }

/* ─── Flash messages ─── */
.flash {
  padding: 10px 14px; border-radius: 7px; margin-bottom: 14px;
  font-size: 13px; font-weight: 500;
}
.flash-ok { background: #0f2e1f; color: var(--ok); border: 1px solid #1f4a2f; }
.flash-bad { background: #331715; color: var(--bad); border: 1px solid #5a2722; }
.flash-info { background: #102a40; color: var(--acc); border: 1px solid #1c4660; }

/* ─── Empty state ─── */
.empty { text-align: center; padding: 50px 20px; color: var(--dim); }
.empty .e-ic { font-size: 38px; margin-bottom: 10px; opacity: .5; }

/* ─── Tabs ─── */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px; flex-wrap: wrap;
}
.tabs button, .tabs .navbtn-tab {
  background: transparent; border: none;
  color: var(--muted); padding: 9px 14px;
  font-size: 13px; border-bottom: 2px solid transparent;
  margin-bottom: -1px; text-decoration: none;
  cursor: pointer; display: inline-flex;
}
.tabs button.on, .tabs .navbtn-tab.on {
  color: var(--acc); border-bottom-color: var(--acc); font-weight: 600;
}

/* ─── Modale (réservée pour les modules à venir) ─── */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(2, 6, 14, .74);
  display: grid; place-items: center;
  z-index: 50; padding: 20px;
}
.modal {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; width: 100%; max-width: 560px;
  max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal h3 {
  margin: 0; padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 16px; display: flex; align-items: center; gap: 10px;
}
.modal .body { padding: 20px 22px; }
.modal .foot {
  padding: 14px 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px; align-items: center;
}

/* ─── Pages d'authentification (sans sidebar) ─── */
body.auth-body {
  background: radial-gradient(circle at 30% 20%, #15335B 0%, #0a1220 60%);
  display: grid; place-items: center; min-height: 100vh;
}
.auth-shell {
  width: 100%; max-width: 420px; padding: 24px;
  display: flex; flex-direction: column; gap: 24px;
}
.auth-brand {
  display: flex; align-items: center; gap: 14px;
  justify-content: center;
}
.auth-brand img { width: 80px; height: 80px; object-fit: contain; }
/* Cartouche blanc pour le logo officiel ATENA (dessin sombre) sur la page bleu nuit */
.auth-logo-badge {
  background: #fff; border-radius: 16px; padding: 22px 34px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .38);
}
.auth-logo-badge img { width: 240px; height: auto; display: block; }
.auth-brand .name { font-weight: 800; font-size: 18px; letter-spacing: 1px; }
.auth-brand .sub { color: var(--acc); font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; }
.auth-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 26px;
  box-shadow: var(--shadow);
}
.auth-card h2 { margin: 0 0 6px; font-size: 20px; }
.auth-sub { color: var(--muted); margin: 0 0 18px; font-size: 13px; }
.auth-foot {
  text-align: center; color: var(--dim);
  font-size: 11px; letter-spacing: .3px;
}

/* ─────────────────────────────────────────────────────────────
   PIPELINE (kanban drag & drop)
───────────────────────────────────────────────────────────── */
.pipe {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  align-items: start;
}
.pcol {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}
.pcol.dragover { border-color: var(--acc); background: #0e2233; }
.pcol .ph {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.pcol .ph .t { font-size: 12px; font-weight: 700; letter-spacing: .3px; }
.pcol .ph .c {
  font-size: 11px; color: var(--dim);
  background: var(--bg); padding: 1px 8px; border-radius: 20px;
}
.pcol .pbody {
  padding: 10px;
  display: flex; flex-direction: column; gap: 9px; flex: 1;
}
.pcard {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  cursor: grab;
  transition: .12s;
  border-left: 3px solid var(--acc);
}
.pcard:hover { border-color: #2d445f; transform: translateY(-1px); }
.pcard.dragging { opacity: .4; }
.pcard .pt { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.pcard .pm {
  font-size: 11px; color: var(--muted);
  display: flex; justify-content: space-between;
}
.pcard .pv { color: var(--acc); font-weight: 700; font-size: 12px; margin-top: 6px; }
.stepbar { display: flex; gap: 3px; margin-top: 8px; }
.stepbar i { flex: 1; height: 3px; border-radius: 2px; background: #21344f; }
.stepbar i.done { background: var(--acc); }

/* Badge « Gagné » (lecture seule) sur le post-it du pipeline */
.won-badge {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 8px;
  padding: 3px 9px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  background: #0f2e1f; color: var(--ok);
  border: 1px solid rgba(52,199,123,.45);
}

/* Barre de dépôt « Gagné » type Pipedrive : cachée, révélée pendant le drag */
.won-drop {
  display: none;
  align-items: center; justify-content: center;
  margin-bottom: 14px; padding: 14px;
  border-radius: 10px;
  border: 2px dashed rgba(52,199,123,.55);
  background: rgba(52,199,123,.06);
  color: var(--ok); font-weight: 700; font-size: 13px;
  transition: all .12s;
}
body.dragging-card .won-drop { display: flex; }
.won-drop.over {
  background: rgba(52,199,123,.18);
  border-color: var(--ok);
  transform: scale(1.01);
}
.won-drop-label strong { text-decoration: underline; }

/* Bouton d'action « Gagné » (fiche affaire, marquer signé) */
.btn.ok { background: var(--ok); color: #04140b; }
.btn.ok:hover { filter: brightness(1.08); }

/* Case « Marquer fait » des activités */
.act-check {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; color: var(--muted);
  border: 1.5px solid var(--line); cursor: pointer;
  font-size: 12px; line-height: 1; margin-top: 4px;
  transition: all .12s;
}
.act-check:hover { border-color: var(--ok); color: var(--ok); background: rgba(52,199,123,.14); }

/* ─────────────────────────────────────────────────────────────
   PICKER PRODUITS (parc, items projet, devis)
───────────────────────────────────────────────────────────── */
.prodpick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.prodbtn {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  text-align: left;
  transition: .12s;
  position: relative;
  cursor: pointer;
  color: inherit;
}
.prodbtn:hover { border-color: var(--acc); }
.prodbtn .pn { font-weight: 600; font-size: 12.5px; margin-bottom: 3px; }
.prodbtn .pr { font-size: 11px; color: var(--muted); }
.prodbtn .qbadge {
  position: absolute; top: 8px; right: 8px;
  background: var(--acc); color: var(--acc-ink);
  font-weight: 800; font-size: 11px;
  border-radius: 20px; min-width: 20px; height: 20px;
  display: grid; place-items: center; padding: 0 5px;
}
.qty-ctrl {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
}
.qty-ctrl button {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--bg);
  color: var(--ink); font-size: 15px; font-weight: 700;
  display: grid; place-items: center;
}
.qty-ctrl button:hover { border-color: var(--acc); color: var(--acc); }
.qty-ctrl .n { min-width: 24px; text-align: center; font-weight: 700; }

/* ─────────────────────────────────────────────────────────────
   ACTIVITÉS (icônes type + items)
───────────────────────────────────────────────────────────── */
.acttype { display: flex; gap: 8px; }
.acttype button {
  flex: 1; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 11px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--muted); font-size: 11.5px; font-weight: 600;
}
.acttype button .ai { font-size: 19px; }
.acttype button.on { border-color: var(--acc); background: var(--acc-soft); color: var(--acc); }
.act-item {
  display: flex; gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid #172638;
}
.act-ic {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 16px; flex: 0 0 34px;
  background: var(--panel2);
}

/* ─────────────────────────────────────────────────────────────
   PLANNING TECHNICIEN
───────────────────────────────────────────────────────────── */
.tp-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.tp-tech {
  padding: 12px;
  border-bottom: 1px solid #172638;
  border-right: 1px solid var(--line);
  background: var(--panel2);
  font-weight: 600; font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.tp-lane {
  border-bottom: 1px solid #172638;
  padding: 8px;
  display: flex; flex-direction: column; gap: 7px;
  min-height: 62px;
}
.intv {
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 12px;
  border-left: 3px solid;
  cursor: pointer;
}
.intv.install { background: #102a40; border-left-color: var(--acc); }
.intv.maint { background: #2a2412; border-left-color: var(--warn); }
.intv.prov { opacity: .7; border-style: dashed; border-left-style: solid; }
/* Planning commercial — types de rendez-vous */
.intv.rdv { background: #102a40; border-left-color: var(--acc); }
.intv.appel { background: #10233a; border-left-color: #3d8fd6; }
.intv.visio { background: #1c1733; border-left-color: #a98fe0; }
.intv.autre { background: #1a2230; border-left-color: #5d7088; }
.intv .it { font-weight: 600; }
.intv .il { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ─────────── Calendrier planning commercial (FullCalendar — charte CRM) ─────────── */
.fc {
  --fc-border-color: #172638;                 /* lignes internes = comme les <td> */
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: var(--panel);         /* surface = comme les cartes */
  --fc-neutral-text-color: var(--muted);
  --fc-today-bg-color: rgba(47, 182, 212, .06);
  --fc-now-indicator-color: var(--acc);
  --fc-event-text-color: #fff;
  --fc-event-border-color: transparent;
  --fc-highlight-color: rgba(47, 182, 212, .14);
  color: var(--ink);
  font-size: 13px;
}
.fc a { color: inherit; text-decoration: none; }

/* Barre d'outils — titre + boutons façon .btn du CRM */
.fc .fc-toolbar.fc-header-toolbar { margin-bottom: 14px; gap: 10px; }
.fc .fc-toolbar-title {
  font-size: 1.15rem; font-weight: 700; text-transform: capitalize; color: var(--ink);
}
.fc .fc-button {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  text-transform: none; font-weight: 600; font-size: 12.5px;
  padding: 6px 12px; border-radius: 6px; box-shadow: none !important;
  transition: color .15s, border-color .15s, background .15s;
}
.fc .fc-button:hover { background: transparent; color: var(--ink); border-color: #2d445f; }
.fc .fc-button:focus { box-shadow: none !important; outline: none; }
.fc .fc-button .fc-icon { font-size: 1.3em; vertical-align: -2px; }
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: var(--acc); border-color: var(--acc); color: var(--acc-ink); font-weight: 700;
}
.fc .fc-button-primary:disabled { background: transparent; border-color: var(--line); color: var(--dim); opacity: 1; }
.fc .fc-button-group { gap: 0; }
.fc .fc-button-group > .fc-button { border-radius: 0; margin: 0 0 0 -1px; }
.fc .fc-button-group > .fc-button:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.fc .fc-button-group > .fc-button:last-child { border-radius: 0 6px 6px 0; }
.fc .fc-today-button { border-radius: 6px; }

/* La grille EST la carte (cadre unique --line + rayon --radius) */
.fc-theme-standard .fc-scrollgrid { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.fc-theme-standard td, .fc-theme-standard th { border-color: #172638; }

/* En-têtes de colonnes = comme un <thead> du CRM (transparent, MAJUSCULES discrètes) */
.fc .fc-col-header-cell { background: transparent; border-bottom: 1px solid var(--line) !important; }
.fc .fc-col-header-cell-cushion {
  color: var(--muted); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .6px; padding: 10px 6px; display: inline-block;
}
.fc .fc-col-header-cell.fc-day-today .fc-col-header-cell-cushion { color: var(--acc); }
.fc .fc-scrollgrid-section-header > * { border-bottom: 0; }

/* Numéros de jour (vue mois) */
.fc .fc-daygrid-day-number { color: var(--muted); font-size: 12px; font-weight: 600; padding: 6px 8px; }
.fc .fc-daygrid-day.fc-day-today { background: var(--fc-today-bg-color); }
.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  color: var(--acc-ink); background: var(--acc); font-weight: 700;
  border-radius: 999px; min-width: 22px; height: 22px; margin: 5px 6px 0 0;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.fc .fc-day-other .fc-daygrid-day-number { opacity: .35; }
.fc .fc-daygrid-day-frame { min-height: 92px; }

/* Vue horaire (semaine / jour) */
.fc .fc-timegrid-slot { height: 2.5em; }
.fc .fc-timegrid-slot-minor { border-top-style: dotted; border-top-color: rgba(255,255,255,.045); }
.fc .fc-timegrid-slot-label-cushion, .fc .fc-timegrid-axis-cushion {
  color: var(--dim); font-size: 11px; font-weight: 600;
}
.fc .fc-timegrid-col.fc-day-today { background: var(--fc-today-bg-color); }
.fc .fc-timegrid-now-indicator-line { border-color: var(--acc); }
.fc .fc-timegrid-now-indicator-arrow { border-color: var(--acc); background: var(--acc); }

/* Événements — pastilles colorées cohérentes avec les tags du CRM */
.fc-event {
  border: none !important; border-radius: 6px; padding: 2px 5px;
  font-size: 11.5px; cursor: pointer; overflow: hidden;
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, .3);
  transition: filter .1s;
}
.fc-timegrid-event { box-shadow: inset 3px 0 0 rgba(255, 255, 255, .3), 0 1px 2px rgba(0, 0, 0, .25); }
.fc-event:hover { filter: brightness(1.08); }
.fc-timegrid-event .fc-event-main { padding: 2px 5px; }
.fc-event .fc-event-time { font-weight: 700; opacity: .9; }
.fc-event .fc-event-title { font-weight: 600; }
.fc-daygrid-event { padding: 1px 6px; }
.fc-daygrid-event .fc-event-time { margin-right: 4px; }
.fc .fc-highlight { background: var(--fc-highlight-color); border-radius: 6px; }
.fc-event-mirror { box-shadow: 0 6px 16px rgba(0, 0, 0, .5) !important; opacity: .95; }
/* Interventions provisoires (à valider) — contour hachuré */
.fc-event.fc-prov { border: 1.4px dashed rgba(255, 255, 255, .55) !important; box-shadow: none; }

/* "+ N autres" et popover (vue mois) */
.fc .fc-daygrid-more-link { color: var(--acc); font-weight: 600; font-size: 11px; }
.fc .fc-popover { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.fc .fc-popover-header { background: var(--panel2); color: var(--ink); padding: 8px 10px; }
.fc .fc-popover-title { font-weight: 700; }

/* ─────────────────────────────────────────────────────────────
   PROGRESS BAR (objectifs)
───────────────────────────────────────────────────────────── */
.progress {
  height: 8px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
}
.progress i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--navy-lt), var(--acc));
  border-radius: 6px;
}

/* ─────────────────────────────────────────────────────────────
   LÉGENDE COULEURS
───────────────────────────────────────────────────────────── */
.legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--muted);
}
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i {
  width: 10px; height: 10px;
  border-radius: 3px;
  display: inline-block;
}

/* ─────────────────────────────────────────────────────────────
   GED / Documents
───────────────────────────────────────────────────────────── */
.ged-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--panel2);
}
.ged-item .fi {
  width: 36px; height: 36px;
  border-radius: 7px;
  background: var(--bg);
  display: grid; place-items: center;
  font-size: 16px;
}

/* ─────────────────────────────────────────────────────────────
   DEVIS / LIGNES FACTURE
───────────────────────────────────────────────────────────── */
.invoice-line {
  display: grid;
  grid-template-columns: 1fr 80px 110px 60px 110px 34px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.invoice-line input { padding: 7px 9px; }

/* ─────────────────────────────────────────────────────────────
   MAIL PREVIEW (journal d'alertes stock)
───────────────────────────────────────────────────────────── */
.mailbox {
  background: #0c1626;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px;
  font-size: 12.5px;
}
.mailbox .mh {
  display: flex; justify-content: space-between;
  color: var(--muted); font-size: 11px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px; margin-bottom: 8px;
}

/* ─── Responsive — kanban en colonnes scrollables sur petit écran ─── */
@media (max-width: 1200px) {
  .pipe { grid-template-columns: repeat(5, minmax(220px, 1fr)); overflow-x: auto; }
}

/* ─── Print ─── */
@media print {
  aside, header.top, .no-print { display: none !important; }
  .content { padding: 0; overflow: visible; }
  body { background: #fff; color: #000; }
}
