/* ==========================================================================
   CUNY EXPERTISES — back-office
   Palette de la charte : vert #1B6B42 dominant, bleu foncé #303870 pour
   structurer, bleu #0060A8, rouge #E02028 et jaune #F5CE02 en ponctuation.
   Georgia en titres, Calibri (Carlito) en texte.
   ========================================================================== */
:root {
  --vert: #1B6B42;
  --vert-fonce: #14512f;
  --vert-clair: #E8F2EC;
  --bleu-fonce: #303870;
  --bleu: #0060A8;
  --rouge: #E02028;
  --jaune: #F5CE02;
  --gris-clair: #F4F7F5;
  --gris-texte: #5A6B62;
  --ligne: #d8e2db;
  --blanc: #fff;
  --radius: 10px;
  --ombre: 0 2px 10px rgba(27, 107, 66, 0.08);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #22312a;
  background: var(--gris-clair);
}

h1, h2, h3 { font-family: Georgia, "DejaVu Serif", serif; color: var(--vert); margin: 0 0 .4em; }
h1 { font-size: 1.65rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
a { color: var(--bleu); }

/* ---------- structure ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.side {
  background: var(--vert);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 18px;
}
.marque { display: flex; align-items: center; gap: 10px; padding: 0 6px 12px; border-bottom: 1px solid rgba(255,255,255,.22); }
.marque img { height: 34px; width: auto; background: #fff; border-radius: 6px; padding: 3px 6px; }
.marque span { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; opacity: .9; }

.moi { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.moi strong { display: block; font-size: .92rem; }
.moi small { color: rgba(255,255,255,.75); font-size: .78rem; }
.pastille { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: .85rem; color: #10231a; background: var(--vert-clair); }

.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  color: #eaf5ee; text-decoration: none; padding: 11px 12px; border-radius: 8px;
  font-size: .95rem; min-height: 44px; display: flex; align-items: center;
}
.side nav a:hover { background: rgba(255,255,255,.14); }
.side nav a.actif { background: #fff; color: var(--vert); font-weight: 700; }
.side nav a:focus-visible { outline: 2px solid var(--jaune); outline-offset: 2px; }
.side .bas { margin-top: auto; padding: 8px 6px 0; border-top: 1px solid rgba(255,255,255,.22); }
.side .bas a { color: rgba(255,255,255,.85); text-decoration: none; font-size: .9rem; }

.main { padding: 26px clamp(16px, 3vw, 40px) 60px; max-width: 1400px; }

/* ---------- entêtes ---------- */
.entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.entete p { margin: 0; color: var(--gris-texte); font-size: .92rem; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 8px; font: inherit;
  font-weight: 700; cursor: pointer; text-decoration: none; }
.btn-primaire { background: var(--vert); color: #fff; }
.btn-primaire:hover { background: var(--vert-fonce); }
.btn-secondaire { background: #fff; color: var(--vert); border: 1px solid var(--vert); }
.btn-secondaire:hover { background: var(--vert-clair); }
.btn-danger { background: var(--rouge); color: #fff; }
.btn:focus-visible { outline: 3px solid rgba(48,56,112,.45); outline-offset: 2px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- cartes ---------- */
.cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }
.carte { background: #fff; border: 1px solid var(--ligne); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--ombre); }
.carte .libelle { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gris-texte); }
.carte .valeur { font-family: Georgia, serif; font-size: 1.9rem; color: var(--bleu-fonce); line-height: 1.1; margin: 6px 0 2px; }
.carte .note { font-size: .82rem; color: var(--gris-texte); }
.carte.alerte { border-left: 4px solid var(--rouge); }
.carte.positif { border-left: 4px solid var(--vert); }

.bloc { background: #fff; border: 1px solid var(--ligne); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; }
.bloc > h2 { margin-top: 0; }

/* ---------- actions à mener ---------- */
.actions-mener { display: grid; gap: 10px; }
.actions-mener a { display: flex; align-items: center; gap: 12px; padding: 13px 14px; min-height: 44px;
  border: 1px solid var(--ligne); border-radius: 8px; text-decoration: none; color: #22312a; background: var(--gris-clair); }
.actions-mener a:hover { border-color: var(--vert); background: var(--vert-clair); }
.actions-mener .compteur { margin-left: auto; background: var(--jaune); color: #3a2f00;
  font-weight: 700; border-radius: 999px; padding: 2px 11px; font-size: .85rem; }
.actions-mener .compteur.zero { background: #e6ebe8; color: var(--gris-texte); font-weight: 600; }
.nowrap { white-space: nowrap; }

/* ---------- tableaux ---------- */
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--ligne); font-size: .93rem; vertical-align: top; }
th { background: var(--vert-clair); color: var(--vert-fonce); font-weight: 700; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
tbody tr:hover { background: #fafcfb; }
td .num { font-weight: 700; color: var(--bleu-fonce); }

/* ---------- étiquettes de statut ---------- */
.etq { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.etq-brouillon, .etq-creee { background: #eceff1; color: #37474f; }
.etq-en_attente, .etq-a_accepter { background: #fff6d6; color: #6b5200; }
.etq-acceptee, .etq-devis_a_faire { background: #e3eafc; color: #23306b; }
.etq-planifiee, .etq-en_cours { background: var(--vert-clair); color: var(--vert-fonce); }
.etq-a_livrer, .etq-a_facturer { background: #ffe9d6; color: #7a3a00; }
.etq-terminee { background: #dff3e4; color: #14512f; }
.etq-annulee { background: #fde3e4; color: #8c1116; }
.urgent { color: var(--rouge); font-weight: 700; }

/* ---------- filtres ---------- */
.filtres { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.filtres label { display: block; font-size: .8rem; font-weight: 700; color: var(--gris-texte); margin-bottom: 4px; }
input, select, textarea {
  font: inherit; color: inherit; background: #fff; border: 1px solid #c9d6ce;
  border-radius: 8px; padding: 0 12px; min-height: 44px; width: 100%;
}
textarea { padding: 10px 12px; min-height: 90px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--vert); box-shadow: 0 0 0 3px rgba(27,107,66,.18);
}
.filtres select, .filtres input { min-width: 200px; }

/* ---------- formulaires ---------- */
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.champ { margin-bottom: 14px; }
.champ label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 5px; }
.champ .req { color: var(--rouge); }
.aide { font-size: .82rem; color: var(--gris-texte); margin: 4px 0 0; }

/* ---------- assistant en 4 étapes ---------- */
.etapes { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 20px; padding: 0; list-style: none; }
.etapes li { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--gris-texte);
  border: 1px solid var(--ligne); border-radius: 999px; padding: 7px 14px; background: #fff; cursor: pointer; }
.etapes li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: #e6ebe8; font-weight: 700; font-size: .78rem; }
.etapes li.courant { border-color: var(--vert); color: var(--vert-fonce); font-weight: 700; }
.etapes li.courant span { background: var(--vert); color: #fff; }
.etapes li.fait span { background: var(--vert-clair); color: var(--vert-fonce); }
.panneau[hidden] { display: none; }

/* ---------- frise de progression ---------- */
.frise { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.frise li { font-size: .72rem; padding: 4px 9px; border-radius: 999px; background: #eef1ef; color: #77837c; }
.frise li.fait { background: var(--vert-clair); color: var(--vert-fonce); font-weight: 700; }
.frise li.ici { background: var(--vert); color: #fff; font-weight: 700; }

/* ---------- planning ---------- */
.planning { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; }
.planning th, .planning td { border: 1px solid var(--ligne); vertical-align: top; }
.planning th { background: var(--vert-clair); text-align: center; }
.planning td { height: 110px; width: 19%; padding: 8px; }
.rdv { display: block; background: var(--vert-clair); border-left: 4px solid var(--vert);
  border-radius: 6px; padding: 6px 8px; font-size: .82rem; margin-bottom: 6px; text-decoration: none; color: #17301f; }
.rdv.urgent { border-left-color: var(--rouge); }

/* ---------- divers ---------- */
.flash .msg { padding: 11px 14px; border-radius: 8px; margin: 0 0 10px; font-weight: 600; }
.flash .succes { background: var(--vert-clair); color: var(--vert-fonce); border: 1px solid #bcdcc6; }
.flash .erreur { background: #fde3e4; color: #8c1116; border: 1px solid #f3c2c4; }
.total { margin: 12px 0 0; font-size: 1rem; color: var(--bleu-fonce); }
.total strong { font-family: Georgia, serif; font-size: 1.25rem; color: var(--vert-fonce); }
.vide { text-align: center; color: var(--gris-texte); padding: 28px 10px; }
.deux { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
.journal { list-style: none; margin: 0; padding: 0; }
.journal li { border-left: 3px solid var(--vert-clair); padding: 0 0 12px 12px; margin-left: 4px; font-size: .88rem; }
.journal time { color: var(--gris-texte); font-size: .78rem; display: block; }

/* ---------- connexion ---------- */
.page-login { display: grid; place-items: center; min-height: 100vh; background: var(--vert); }
.login-carte { width: min(420px, calc(100% - 32px)); background: #fff; border-radius: 14px; padding: 28px;
  box-shadow: 0 18px 40px rgba(0,0,0,.22); }
.login-carte img { height: 42px; margin-bottom: 14px; }
.login-carte h1 { font-size: 1.35rem; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .side .bas { margin: 0; border: 0; padding: 0; }
  .deux { grid-template-columns: 1fr; }
  .main { padding: 18px 14px 48px; }
}
