/* ============================================================
   redac.css — redaction.theatre-et-moi.fr
   Mêmes jetons que le site public (style.css), pour que l'éditeur
   maison et les couleurs de marque soient identiques.
   ============================================================ */
:root {
  --wine: #960018; --wine-dark: #6b0011; --wine-deep: #3d000a; --wine-light: #b8253b; --wine-wash: #fbf4f2;
  --paper: #f4eee0; --paper-card: #fffdf8; --paper-deep: #e9e0c9;
  --ink: #191512; --ink-soft: #4a423a; --ink-mute: #857c6e;
  --rule: #ddd3bc; --rule-soft: #ebe3d2; --cream: #f0e3c1; --gold: #c8962a;
  --ok: #1f6b32; --ok-wash: #eaf4ec;
  --f-display: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --f-read: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --f-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --t-3xs: 11px; --t-2xs: 12px; --t-xs: 13px; --t-s: 15px; --t-m: 17px; --t-l: 21px; --t-xl: 27px; --t-2xl: 35px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r: 3px; --r-lg: 6px;
  --sh: 0 1px 2px rgba(25,21,18,.04), 0 10px 30px rgba(25,21,18,.07);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--f-ui); font-size: var(--t-s); line-height: 1.55; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--wine); }
:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--f-display); color: var(--ink); margin: 0; letter-spacing: -.015em; }
h1 { font-size: var(--t-2xl); font-weight: 800; line-height: 1.1; }
h2 { font-size: var(--t-l); font-weight: 700; margin-bottom: var(--s4); }
p { margin: 0 0 var(--s3); }
::selection { background: var(--cream); }

/* ── Coquille ─────────────────────────────────────────────── */
.rd-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.rd-side { background: var(--wine-deep); color: #f3e6e0; display: flex; flex-direction: column; padding: var(--s5) var(--s4); position: sticky; top: 0; height: 100vh; }
.rd-brand { font-family: var(--f-display); font-size: var(--t-l); font-weight: 800; color: #fff; text-decoration: none; letter-spacing: -.02em; padding: 0 var(--s2) var(--s5); display: block; }
.rd-brand em { font-style: normal; color: var(--gold); }
.rd-brand span { display: block; font-family: var(--f-ui); font-size: var(--t-xs); font-weight: 500; color: rgba(243,230,224,.6); letter-spacing: 0; margin-top: 2px; }
.rd-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.rd-nav a { display: flex; align-items: center; justify-content: space-between; padding: 9px var(--s3); border-radius: var(--r); color: rgba(243,230,224,.78); text-decoration: none; font-weight: 500; }
.rd-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.rd-nav a.is-on { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.rd-count { background: var(--gold); color: var(--wine-deep); font-size: var(--t-3xs); font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.rd-me { border-top: 1px solid rgba(255,255,255,.1); padding-top: var(--s4); }
.rd-me-id { display: flex; align-items: center; gap: var(--s3); color: #fff; text-decoration: none; padding: var(--s2); border-radius: var(--r); }
.rd-me-id:hover, .rd-me-id.is-on { background: rgba(255,255,255,.06); }
.rd-me-id strong { display: block; font-size: var(--t-xs); }
.rd-me-id small { display: block; font-size: var(--t-3xs); color: rgba(243,230,224,.6); }
.rd-out { display: block; font-size: var(--t-2xs); color: rgba(243,230,224,.6); padding: var(--s2); text-decoration: none; }
.rd-out:hover { color: #fff; }
.rd-main { padding: var(--s6) var(--s6) var(--s7); max-width: 1180px; width: 100%; }

@media (max-width: 900px) {
  .rd-shell { grid-template-columns: 1fr; }
  .rd-side { position: static; height: auto; padding: var(--s3) var(--s4); }
  .rd-brand { padding-bottom: var(--s3); }
  .rd-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .rd-nav a { padding: 6px 10px; }
  .rd-nav a.is-on { box-shadow: inset 0 -2px 0 var(--gold); }
  .rd-me { display: flex; align-items: center; justify-content: space-between; margin-top: var(--s3); padding-top: var(--s2); }
  .rd-main { padding: var(--s5) var(--s4) var(--s6); }
}

/* ── En-tête de page ──────────────────────────────────────── */
.rd-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.rd-head p { color: var(--ink-mute); margin: 6px 0 0; max-width: 62ch; }
.rd-retour { display: inline-block; font-size: var(--t-xs); text-decoration: none; margin-bottom: var(--s3); }

/* ── Cartes et formulaires ────────────────────────────────── */
.rd-card { background: var(--paper-card); border: 1px solid var(--rule-soft); border-radius: var(--r-lg); box-shadow: var(--sh); padding: var(--s5); margin-bottom: var(--s4); }
.rd-card--admin { border-color: var(--gold); }
.rd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s4); }
.rd-edit { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s5); align-items: start; }
.rd-edit-side { position: sticky; top: var(--s4); }
@media (max-width: 1100px) { .rd-edit { grid-template-columns: 1fr; } .rd-edit-side { position: static; } }

.rd-form label, .rd-label { display: block; font-size: var(--t-xs); font-weight: 600; color: var(--ink-soft); margin: 0 0 6px; }
.rd-form .rd-champ { margin-bottom: var(--s4); }
.rd-form input[type=text], .rd-form input[type=email], .rd-form input[type=password], .rd-form input[type=number],
.rd-form input[type=url], .rd-form input[type=date], .rd-form input[type=datetime-local], .rd-form select, .rd-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r); background: #fff;
  font: inherit; font-size: var(--t-s); color: var(--ink);
}
.rd-form textarea { resize: vertical; line-height: 1.6; font-family: var(--f-read); }
.rd-form input:focus, .rd-form select:focus, .rd-form textarea:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px var(--wine-wash); }
.rd-aide { display: block; font-size: var(--t-2xs); color: var(--ink-mute); margin-top: 5px; }
.rd-aide.is-ko { color: var(--wine); font-weight: 600; }
.rd-aide.is-ok { color: var(--ok); font-weight: 600; }
.rd-check { display: flex; align-items: center; gap: 8px; font-weight: 400 !important; }
.rd-details { border: 1px dashed var(--rule); border-radius: var(--r); padding: var(--s3) var(--s4); margin-bottom: var(--s4); }
.rd-details summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.rd-details[open] summary { margin-bottom: var(--s4); }
.rd-apercu-img { display: block; max-width: 100%; max-height: 220px; border-radius: var(--r); border: 1px solid var(--rule-soft); margin-bottom: var(--s2); }

/* ── Boutons ─────────────────────────────────────────────── */
.rd-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--rule-soft); }
.rd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: var(--r); padding: 10px 16px; font: 600 var(--t-xs)/1.2 var(--f-ui); cursor: pointer; text-decoration: none; }
.rd-btn:disabled { opacity: .6; cursor: progress; }
.rd-btn--wine { background: var(--wine); color: #fff; }
.rd-btn--wine:hover { background: var(--wine-dark); }
.rd-btn--gold { background: var(--gold); color: var(--wine-deep); }
.rd-btn--gold:hover { background: #b5861f; }
.rd-btn--ok { background: var(--ok); color: #fff; }
.rd-btn--ghost { background: var(--paper-card); color: var(--ink-soft); border-color: var(--rule); }
.rd-btn--ghost:hover { border-color: var(--wine); color: var(--wine); }
.rd-btn--sm { padding: 6px 11px; font-size: var(--t-2xs); }
.rd-lien-danger { background: none; border: none; color: var(--wine); font: inherit; font-size: var(--t-2xs); text-decoration: underline; cursor: pointer; padding: 0; }
.rd-suppr { margin-top: var(--s4); }

/* ── Messages ────────────────────────────────────────────── */
.rd-flash { padding: 12px 16px; border-radius: var(--r); margin-bottom: var(--s4); font-size: var(--t-xs); font-weight: 500; }
.rd-flash--ok { background: var(--ok-wash); color: var(--ok); border: 1px solid rgba(31,107,50,.25); }
.rd-flash--err { background: var(--wine-wash); color: var(--wine-dark); border: 1px solid rgba(150,0,24,.25); }
.rd-refus { background: var(--wine-wash); border-left: 3px solid var(--wine); padding: var(--s3) var(--s4); border-radius: 0 var(--r) var(--r) 0; margin-bottom: var(--s4); }
.rd-refus strong { display: block; font-size: var(--t-xs); color: var(--wine-dark); margin-bottom: 4px; }
.rd-refus p { margin: 0; font-size: var(--t-xs); color: var(--ink-soft); }

/* ── Le circuit : l'élément central de chaque fiche ───────── */
.rd-circuit { list-style: none; margin: 0 0 var(--s5); padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); counter-reset: etape; }
.rd-circuit li { position: relative; padding-top: 26px; font-size: var(--t-2xs); color: var(--ink-mute); }
.rd-circuit li::before { content: ''; position: absolute; top: 7px; left: 0; right: 0; height: 2px; background: var(--rule); }
.rd-circuit li::after { content: ''; position: absolute; top: 1px; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 2px solid var(--rule); }
.rd-circuit li.fait::before { background: var(--wine); }
.rd-circuit li.fait::after { background: var(--wine); border-color: var(--wine); }
.rd-circuit li.ici { color: var(--ink); font-weight: 600; }
.rd-circuit li.ici::after { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px rgba(200,150,42,.22); }
.rd-circuit li.fait.ici::after { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 4px rgba(31,107,50,.18); }
.rd-circuit li.refuse::after { background: var(--wine); border-color: var(--wine); box-shadow: 0 0 0 4px rgba(150,0,24,.18); }
.rd-circuit li.retire::after { background: var(--ink-mute); border-color: var(--ink-mute); box-shadow: none; }
.rd-circuit li:last-child::before { right: auto; width: 14px; }
.rd-circuit small { display: block; color: var(--wine); font-weight: 600; }

/* ── Badges d'état ───────────────────────────────────────── */
.rd-badge { display: inline-block; font-size: var(--t-3xs); font-weight: 700; padding: 3px 9px; border-radius: 100px; white-space: nowrap; background: var(--paper-deep); color: var(--ink-soft); }
.rd-badge--avina  { background: #f6ecd2; color: #7a5710; }
.rd-badge--soumis { background: var(--gold); color: var(--wine-deep); }
.rd-badge--valide { background: var(--ok-wash); color: var(--ok); }
.rd-badge--refuse { background: var(--wine-wash); color: var(--wine); }
.rd-badge--masque { background: #ecebe8; color: var(--ink-mute); }

/* ── Listes ──────────────────────────────────────────────── */
.rd-filtres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s4); }
.rd-filtres a { font-size: var(--t-xs); padding: 6px 12px; border-radius: 100px; border: 1px solid var(--rule); color: var(--ink-soft); text-decoration: none; background: var(--paper-card); }
.rd-filtres a span { color: var(--ink-mute); margin-left: 3px; }
.rd-filtres a.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.rd-filtres a.is-on span { color: rgba(255,255,255,.6); }
.rd-table-wrap { overflow-x: auto; }
.rd-table { width: 100%; border-collapse: collapse; }
.rd-table th { text-align: left; font-size: var(--t-2xs); font-weight: 600; color: var(--ink-mute); padding: 8px 10px; border-bottom: 2px solid var(--rule); }
.rd-table td { padding: 12px 10px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; font-size: var(--t-xs); }
.rd-table tr:hover td { background: #fffaf0; }
.rd-table a.rd-titre { font-weight: 600; color: var(--ink); text-decoration: none; font-size: var(--t-s); }
.rd-table a.rd-titre:hover { color: var(--wine); }
.rd-mute { color: var(--ink-mute); font-size: var(--t-2xs); }
.rd-vide { text-align: center; padding: var(--s6) var(--s4); color: var(--ink-mute); }
.rd-vide .rd-btn { margin-top: var(--s3); }

/* ── Tableau de bord ─────────────────────────────────────── */
.rd-file { display: grid; gap: var(--s2); }
.rd-file a { display: grid; grid-template-columns: 90px minmax(0,1fr) auto; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); background: var(--paper-card); border: 1px solid var(--rule-soft); border-radius: var(--r); text-decoration: none; color: var(--ink); }
.rd-file a:hover { border-color: var(--wine); }
.rd-file .rd-type { font-size: var(--t-2xs); color: var(--ink-mute); }
.rd-file strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.rd-chiffre { background: var(--paper-card); border: 1px solid var(--rule-soft); border-radius: var(--r-lg); padding: var(--s4); text-decoration: none; color: var(--ink); }
.rd-chiffre b { display: block; font-family: var(--f-display); font-size: var(--t-xl); font-weight: 800; line-height: 1; }
.rd-chiffre span { font-size: var(--t-xs); color: var(--ink-mute); }
.rd-chiffre:hover { border-color: var(--wine); }

/* ── Carte Avina ─────────────────────────────────────────── */
.rd-avina { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--rule-soft); background: var(--paper-card); margin-bottom: var(--s4); }
.rd-avina header { display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); color: #fff; }
.rd-avina-a { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.rd-avina header small { display: block; font-size: var(--t-3xs); opacity: .85; }
.rd-avina header strong { font-size: var(--t-xs); line-height: 1.3; }
.rd-avina--bleu header { background: #1d4ed8; } .rd-avina--vert header { background: var(--ok); }
.rd-avina--orange header { background: #b45309; } .rd-avina--rouge header { background: var(--wine); }
.rd-avina--gris header { background: #6b7280; }
.rd-avina-txt { padding: var(--s4); font-size: var(--t-xs); line-height: 1.65; max-height: 70vh; overflow-y: auto; }

/* ── Avatars ─────────────────────────────────────────────── */
.rd-av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--wine); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.rd-av--sm { width: 34px; height: 34px; font-size: var(--t-xs); background: var(--gold); color: var(--wine-deep); }
.rd-av--lg { width: 96px; height: 96px; font-size: var(--t-xl); }

/* ── Connexion ───────────────────────────────────────────── */
.rd-solo { min-height: 100vh; display: grid; place-items: center; padding: var(--s5); }
.rd-login { width: 100%; max-width: 400px; }
.rd-login .rd-brand { color: var(--wine-deep); padding: 0 0 var(--s5); text-align: center; font-size: var(--t-xl); }
.rd-login .rd-brand span { color: var(--ink-mute); }
.rd-login .rd-btn { width: 100%; padding: 12px; font-size: var(--t-s); }
.rd-login-pied { text-align: center; margin-top: var(--s4); font-size: var(--t-xs); }

/* ── Recherche de spectacle ──────────────────────────────── */
.rd-spec { position: relative; }
.rd-spec-res { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--rule); border-top: none; max-height: 260px; overflow-y: auto; box-shadow: var(--sh); }
.rd-spec-res button { display: block; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--rule-soft); padding: 9px 12px; font: inherit; font-size: var(--t-xs); cursor: pointer; }
.rd-spec-res button:hover, .rd-spec-res button:focus { background: var(--wine-wash); }
.rd-spec-res small { display: block; color: var(--ink-mute); }
.rd-spec-lie { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); padding: 8px 12px; background: var(--ok-wash); border-radius: var(--r); font-size: var(--t-xs); color: var(--ok); }
.rd-spec-lie button { margin-left: auto; }

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

/* ── Lieu où le spectacle a été vu ───────────────────────── */
.rd-vu { border: 1px solid var(--rule-soft); border-radius: var(--r); padding: var(--s3) var(--s4); background: #fffaf0; }
.rd-vu[hidden] { display: none; }
.rd-vu legend { padding: 0 4px; }
.rd-vu .rd-check { margin-bottom: 6px; }
.rd-vu .rd-grid { margin-top: var(--s3); }
.rd-vu .rd-grid[hidden] { display: none; }
.rd-spec-lie[hidden], .rd-spec-res[hidden] { display: none; }
