/* ------------------------------------------------------------------
   Charte visuelle reprise du tableau de bord statique (dashboard-jdp.html)
   Variables, theme clair/sombre, couleurs par categorie, cartes arrondies,
   badges de statut, typographie systeme.
   ------------------------------------------------------------------ */
:root {
  color-scheme: light;
  --surface-1:      #fcfcfb;
  --page:           #f9f9f7;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --gridline:       #e1e0d9;
  --border:         rgba(11,11,11,0.10);
  --good:           #0ca30c;
  --warning:        #fab219;
  --bad:            #d33b2f;
  --info:           #2a78d6;
  --cat-rh:         #2a78d6;
  --cat-comm:       #eb6834;
  --cat-membres:    #1baf7a;
  --cat-compta:     #eda100;
  --cat-autre:      #e87ba4;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1:      #1a1a19;
    --page:           #0d0d0d;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --gridline:       #2c2c2a;
    --border:         rgba(255,255,255,0.10);
    --good:           #0ca30c;
    --warning:        #fab219;
    --bad:            #e2564a;
    --info:           #3987e5;
    --cat-rh:         #3987e5;
    --cat-comm:       #d95926;
    --cat-membres:    #199e70;
    --cat-compta:     #c98500;
    --cat-autre:      #d55181;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1:      #1a1a19;
  --page:           #0d0d0d;
  --text-primary:   #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted:     #898781;
  --gridline:       #2c2c2a;
  --border:         rgba(255,255,255,0.10);
  --good:           #0ca30c;
  --warning:        #fab219;
  --bad:            #e2564a;
  --info:           #3987e5;
  --cat-rh:         #3987e5;
  --cat-comm:       #d95926;
  --cat-membres:    #199e70;
  --cat-compta:     #c98500;
  --cat-autre:      #d55181;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--text-primary);
}
.hidden { display: none !important; }
a { color: var(--info); }

.wrap { max-width: 980px; margin: 0 auto; padding: 24px 20px 80px; }

/* ---------------------------------------------------------- topbar --- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--gridline); background: var(--surface-1);
  padding: 12px 20px; position: sticky; top: 0; z-index: 20; flex-wrap: wrap;
}
.topbar .marque { display: flex; flex-direction: column; gap: 2px; }
.topbar .eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
}
.topbar .titre { font-size: 15px; font-weight: 600; }
.topbar nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.navlink {
  border: 1px solid transparent; background: none; color: var(--text-secondary);
  font-size: 13px; font-weight: 600; padding: 6px 11px; border-radius: 8px; cursor: pointer;
  font-family: inherit;
}
.navlink:hover { background: var(--page); }
.navlink.actif { color: var(--text-primary); border-color: var(--border); background: var(--page); }
.qui { font-size: 12px; color: var(--text-muted); }

/* ---------------------------------------------------------- bandeau -- */
.bandeau-demo {
  background: color-mix(in srgb, var(--warning) 16%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--warning) 40%, transparent);
  color: var(--text-primary); font-size: 13px; padding: 9px 20px; line-height: 1.45;
}

header.page-head { margin-bottom: 18px; }
header.page-head .eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
}
h1 { font-size: 26px; margin: 4px 0 6px; }
header.page-head p { color: var(--text-secondary); margin: 0; max-width: 660px; line-height: 1.5; font-size: 14px; }

.how-it-works {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; font-size: 13px; color: var(--text-secondary);
  margin: 18px 0 30px; line-height: 1.55;
}
.how-it-works strong { color: var(--text-primary); }

/* -------------------------------------------------------- categories - */
section.category { margin-bottom: 34px; }
.category-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.category-head h2 {
  font-size: 15px; margin: 0; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

.card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; cursor: pointer; text-align: left; padding: 0; font-family: inherit;
  color: inherit; display: block; width: 100%;
}
.card:hover { border-color: var(--text-muted); }
.card-top { padding: 14px 16px 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.summary-main { display: flex; flex-direction: column; gap: 4px; }
.card-title { font-size: 14.5px; font-weight: 600; }
.card-tagline { font-size: 12.5px; color: var(--text-secondary); line-height: 1.4; }
.chevron { color: var(--text-muted); font-size: 13px; flex: none; margin-top: 2px; }
.card-foot {
  border-top: 1px solid var(--gridline); padding: 9px 16px 12px;
  font-size: 12px; color: var(--text-secondary); line-height: 1.5;
}
.card-foot .ligne { display: flex; gap: 6px; align-items: baseline; }
.card-foot .etiquette { color: var(--text-muted); min-width: 100px; flex: none; }

/* ------------------------------------------------------------ badges - */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  white-space: nowrap; flex: none;
}
.badge .dot2 { width: 6px; height: 6px; border-radius: 50%; }
.badge.ready    { color: var(--good);    background: color-mix(in srgb, var(--good) 14%, transparent); }
.badge.pending  { color: var(--warning); background: color-mix(in srgb, var(--warning) 18%, transparent); }
.badge.ref      { color: var(--info);    background: color-mix(in srgb, var(--info) 14%, transparent); }
.badge.propose  { color: var(--text-muted); background: color-mix(in srgb, var(--text-muted) 16%, transparent); }
.badge.echec    { color: var(--bad);     background: color-mix(in srgb, var(--bad) 15%, transparent); }
.badge.ready .dot2   { background: var(--good); }
.badge.pending .dot2 { background: var(--warning); }
.badge.ref .dot2     { background: var(--info); }
.badge.propose .dot2 { background: var(--text-muted); }
.badge.echec .dot2   { background: var(--bad); }

/* ------------------------------------------------------------- blocs - */
.bloc {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; margin-bottom: 16px;
}
.bloc h3 { margin: 0 0 8px; font-size: 15px; }
.bloc h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); margin: 14px 0 5px;
}
.bloc h4:first-child { margin-top: 0; }
.bloc p { margin: 0 0 8px; font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.encart {
  background: var(--page); border: 1px solid var(--gridline); border-radius: 8px;
  padding: 10px 12px; font-size: 13px; color: var(--text-secondary); line-height: 1.55;
}

/* ----------------------------------------------------------- boutons - */
.btn {
  border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary);
  font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 8px; cursor: pointer;
  font-family: inherit;
}
.btn:hover:not(:disabled) { background: var(--gridline); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primaire { background: var(--info); border-color: var(--info); color: #fff; }
.btn-primaire:hover:not(:disabled) { filter: brightness(1.08); background: var(--info); }
.btn-petit { padding: 5px 10px; font-size: 12px; font-weight: 500; }
.ligne-boutons { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.aide { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }

/* ---------------------------------------------------------- formulaire */
label { font-size: 12px; color: var(--text-secondary); display: block; margin-bottom: 4px; }
input[type=text], input[type=number], input[type=password], input[type=time],
input[type=date], select, textarea {
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
  width: 100%; background: var(--surface-1); color: var(--text-primary); font-family: inherit;
}
.grille-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }

/* -------------------------------------------------------------- table */
table { width: 100%; border-collapse: collapse; background: var(--surface-1); font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--gridline); text-align: left; vertical-align: top; }
th { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.tableau-enveloppe { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }

/* ------------------------------------------------------------- login - */
#ecran-connexion { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.boite-connexion {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px;
  padding: 28px; width: 340px;
}
.boite-connexion h2 { margin: 4px 0 4px; font-size: 20px; }
.boite-connexion .eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
}
.boite-connexion input { margin: 4px 0 12px; }
.erreur { color: var(--bad); font-size: 13px; margin-top: 6px; }

/* ------------------------------------------------------- matchmaking - */
.sous-nav { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.day-block { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; overflow: hidden; }
.day-header { padding: 10px 16px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--gridline); }
.slot-header {
  padding: 7px 16px; font-size: 12px; font-weight: 600; color: var(--text-secondary);
  background: var(--page); border-bottom: 1px solid var(--gridline);
}
.prop-card { padding: 13px 16px; border-bottom: 1px solid var(--gridline); display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.prop-card.fait { background: color-mix(in srgb, var(--good) 8%, transparent); }
.prop-main { flex: 1; min-width: 260px; }
.prop-j1 { font-weight: 600; font-size: 14px; }
.prop-why { font-size: 12px; color: var(--text-muted); margin: 4px 0; line-height: 1.45; }
.prop-j2-list { font-size: 12.5px; margin: 6px 0; line-height: 1.5; color: var(--text-secondary); }
.prop-actions { display: flex; flex-direction: column; gap: 6px; min-width: 170px; }
.msg-preview {
  white-space: pre-wrap; background: var(--page); border: 1px solid var(--gridline);
  padding: 9px 11px; border-radius: 8px; font-size: 12px; margin-top: 6px; color: var(--text-secondary);
}
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stat-card .value { font-size: 24px; font-weight: 700; }
.stat-card .label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.toast {
  position: fixed; bottom: 20px; right: 20px; background: var(--text-primary); color: var(--page);
  padding: 10px 16px; border-radius: 8px; font-size: 13px; z-index: 100; max-width: 420px;
}
details.trace summary { cursor: pointer; font-size: 12px; color: var(--text-muted); }
details.trace pre {
  white-space: pre-wrap; word-break: break-word; background: var(--page);
  border: 1px solid var(--gridline); border-radius: 8px; padding: 10px;
  font-size: 11.5px; color: var(--text-secondary); margin: 6px 0 0;
}
footer { margin-top: 40px; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--gridline); padding-top: 16px; }
