/* Club Cyclo Quévy – administration et pages minimales
   Couleurs : noir #111111, blanc, rouge club #D71920 ; drapeau #000 / #FDDA24 / #EF3340 */

:root {
    --black: #111111;
    --ink: #1c1c1c;
    --muted: #5f5f5f;
    --line: #e2e2e2;
    --bg: #f4f4f4;
    --white: #ffffff;
    --red: #d71920;
    --red-dark: #a81118;
    --be-black: #000000;
    --be-yellow: #fdda24;
    --be-red: #ef3340;
    --ok: #1e7b34;
    --warn: #8a6100;
    --radius: 8px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: var(--red); }
a:hover { color: var(--red-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h2 { font-size: 1.15rem; }
code { font-size: .9em; background: #ececec; padding: 1px 5px; border-radius: 4px; }
img { max-width: 100%; height: auto; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.right { text-align: right; }
.lead { font-size: 1.1rem; }

/* Liseré tricolore */
.tricolore { display: flex; height: 5px; }
.tricolore span { flex: 1; }
.tricolore span:nth-child(1) { background: var(--be-black); }
.tricolore span:nth-child(2) { background: var(--be-yellow); }
.tricolore span:nth-child(3) { background: var(--be-red); }

/* Pages minimales (connexion, installation, erreurs) */
.page-minimal { background: var(--black); min-height: 100vh; }
.minimal-main { padding: 48px 16px; display: flex; justify-content: center; }
.card { background: var(--white); border-radius: 12px; padding: 32px; width: 100%; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.card--narrow { max-width: 440px; }
.card--wide { max-width: 720px; }
.logo-round { display: block; margin: 0 auto 12px; }
.display { font-size: 2.2rem; text-transform: uppercase; letter-spacing: .02em; }
.error-code { font-size: 3rem; font-weight: 800; color: var(--red); margin: 0; }
.debug { text-align: left; white-space: pre-wrap; font-size: .75rem; background: #fafafa; border: 1px solid var(--line); padding: 12px; overflow: auto; max-height: 400px; }

/* Formulaires */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .95rem; }
input, select, textarea {
    font: inherit; padding: 10px 12px; border: 1px solid #c9c9c9; border-radius: 6px; background: var(--white); color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid rgba(215,25,32,.35); outline-offset: 1px; border-color: var(--red); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.grid-2--top { align-items: start; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.stack { display: flex; flex-direction: column; gap: 24px; }

/* Boutons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
    padding: 10px 18px; border-radius: 6px; border: 1px solid var(--red); background: var(--red); color: var(--white);
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); color: var(--white); }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; color: var(--ink); border-color: #bdbdbd; }
.btn--ghost:hover { background: #ececec; color: var(--ink); border-color: #9a9a9a; }
.btn--danger { background: #fff; color: var(--red-dark); border-color: var(--red); }
.btn--danger:hover { background: var(--red); color: #fff; }
.btn--sm { min-height: 36px; padding: 6px 12px; font-size: .875rem; }

/* Alertes */
.alert { padding: 12px 16px; border-radius: 6px; margin: 0 0 16px; border-left: 4px solid; background: var(--white); }
.alert--success { border-color: var(--ok); background: #eef7f0; }
.alert--error { border-color: var(--red); background: #fdeeee; }
.alert--info { border-color: var(--black); background: #f0f0f0; }

/* Liste de vérification (installateur) */
.checklist { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 6px; }
.checklist li { display: flex; gap: 10px; align-items: baseline; }
.checklist__icon { font-weight: 800; width: 1.2em; }
.checklist .ok .checklist__icon { color: var(--ok); }
.checklist .ko .checklist__icon { color: var(--red); }
.checklist .warn .checklist__icon { color: var(--warn); }

/* Administration */
.admin-shell { display: flex; flex-wrap: wrap; min-height: calc(100vh - 5px); }
.admin-sidebar { flex: 1 1 240px; max-width: 100%; background: var(--black); color: #e6e6e6; display: flex; flex-direction: column; }
.admin-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.admin-brand { display: flex; gap: 12px; align-items: center; padding: 18px 20px; color: #fff; text-decoration: none; border-bottom: 1px solid #2a2a2a; }
.admin-brand:hover { color: #fff; }
.admin-brand span { display: flex; flex-direction: column; line-height: 1.2; }
.admin-brand small { color: #a8a8a8; }
.admin-nav { display: flex; flex-direction: column; padding: 12px 0; flex: 1; }
.admin-nav a, .admin-nav__soon { padding: 9px 20px; color: #e6e6e6; text-decoration: none; border-left: 4px solid transparent; }
.admin-nav a:hover { background: #1f1f1f; color: #fff; }
.admin-nav a.is-active { border-left-color: var(--red); background: #1f1f1f; color: #fff; font-weight: 600; }
.admin-nav__soon { color: #7d7d7d; cursor: default; }
.admin-nav__soon::after { content: " · bientôt"; font-size: .75rem; }
.admin-nav__group { padding: 16px 20px 4px; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: #8f8f8f; }
.admin-sidebar__foot { padding: 16px 20px; border-top: 1px solid #2a2a2a; }
.admin-sidebar__foot a { color: #e6e6e6; }

.admin-topbar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; padding: 18px 28px; background: var(--white); border-bottom: 1px solid var(--line); }
.admin-topbar h1 { margin: 0; font-size: 1.5rem; }
.admin-topbar__user { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.admin-topbar__user form { margin: 0; }
.admin-main > .alert { margin: 16px 28px 0; }
.admin-content { padding: 24px 28px 48px; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 24px; }
.panel--flush { padding: 0; }
.panel--danger { border-color: #f1c4c6; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.toolbar p { margin: 0; flex: 1 1 320px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 20px 0 24px; }
.stat { background: var(--white); border: 1px solid var(--line); border-top: 6px solid; border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; }
.stat--black { border-top-color: var(--be-black); }
.stat--yellow { border-top-color: var(--be-yellow); }
.stat--red { border-top-color: var(--be-red); }
.stat__value { font-size: 2rem; font-weight: 800; }
.stat__label { color: var(--muted); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafafa; }
.table tbody tr:last-child td { border-bottom: 0; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #ececec; color: var(--ink); }
.badge--admin { background: var(--black); color: #fff; }
.badge--redacteur { background: #fff4bf; color: #5c4a00; }
.badge--organisateur { background: #fde1e2; color: var(--red-dark); }
.status--active { color: var(--ok); font-weight: 600; }
.status--pending { color: var(--warn); font-weight: 600; }
.status--disabled { color: var(--muted); }

@media (max-width: 720px) {
    .admin-sidebar { flex-basis: 100%; }
    .admin-nav { flex-direction: row; flex-wrap: wrap; padding: 8px; }
    .admin-nav a, .admin-nav__soon { border-left: 0; padding: 8px 12px; }
    .admin-nav__group, .admin-nav__soon { display: none; }
    .admin-topbar, .admin-content { padding-left: 16px; padding-right: 16px; }
    .admin-main > .alert { margin: 12px 16px 0; }
    .card { padding: 24px 18px; }
}

/* Étape 3 : écrans de gestion */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.panel__title { margin: 0; padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.panel__empty { padding: 16px 20px; margin: 0; }
.inline, .inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline-form input, .inline-form select { width: auto; }
.inline-form label { font-weight: 600; }
.nowrap { white-space: nowrap; }
.is-muted td { opacity: .55; }
.is-editing td { background: #fff8d6; }
.cell-thumb { width: 56px; }
.cell-thumb img { border-radius: 50%; display: block; }
.thumb-initials { display: inline-flex; width: 40px; height: 40px; border-radius: 50%; background: var(--black); color: #fff; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.cell-logo { width: 110px; }
.cell-logo img { max-width: 96px; max-height: 48px; object-fit: contain; display: block; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check input { width: auto; }
.radio-row { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.radio-row legend { font-weight: 600; margin-bottom: 6px; }
.radio-row label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.radio-row input { width: auto; }
.current-image { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 8px; }
.current-image img { border-radius: 8px; border: 1px solid var(--line); }
.current-image--logo img { max-width: 200px; max-height: 100px; object-fit: contain; padding: 6px; background: #fff; }
.current-image--wide img { width: 100%; max-width: 480px; }
input[type="file"] { padding: 8px; background: #fafafa; }

.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .editor-layout { grid-template-columns: minmax(0, 1fr); } }
.revisions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.revisions li { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .9rem; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.revisions form { margin: 0; }

/* Éditeur Quill */
.ql-toolbar.ql-snow { border-radius: 6px 6px 0 0; border-color: #c9c9c9; background: #fafafa; font-family: var(--font); }
.ql-container.ql-snow { border-radius: 0 0 6px 6px; border-color: #c9c9c9; font-family: var(--font); font-size: 1rem; }
.editor .ql-editor { min-height: 360px; line-height: 1.6; }
.ql-editor h2 { font-size: 1.4rem; margin: 1em 0 .4em; }
.ql-editor h3 { font-size: 1.15rem; margin: 1em 0 .4em; }
.ql-snow .ql-tooltip { z-index: 5; }
/* Libellés français du sélecteur de titres de l'éditeur */
.ql-snow .ql-picker.ql-header { width: 120px; }
.ql-snow .ql-picker.ql-header .ql-picker-label::before,
.ql-snow .ql-picker.ql-header .ql-picker-item::before { content: "Texte normal"; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: "Titre"; }
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: "Sous-titre"; }
.ql-editor p { margin-bottom: .6em; }
.ql-editor ul, .ql-editor ol { margin-bottom: .6em; }

/* Étape 4 : nouvelles */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tabs a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); font-size: .9rem; }
.tabs a[aria-current="page"] { background: var(--black); color: #fff; border-color: var(--black); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cell-news { display: flex; gap: 12px; align-items: center; }
.cell-news img, .thumb-empty { width: 64px; height: 40px; border-radius: 4px; object-fit: cover; flex-shrink: 0; background: #e8e8e8; display: block; }
.status--scheduled { color: #1b4fa0; font-weight: 600; }
.input-lg { font-size: 1.25rem; font-weight: 600; }
.input-xs { width: 80px; padding: 6px 8px; }
.radio-col { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.radio-col label { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.radio-col input { width: auto; }
.grid-2--tight { grid-template-columns: 1fr 1fr; gap: 10px; }
.btn--block { width: 100%; }
.photo-admin { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.photo-admin li { display: flex; flex-direction: column; gap: 6px; }
.photo-admin img { width: 100%; height: auto; border-radius: 6px; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-admin input { padding: 6px 8px; font-size: .9rem; }
.photo-admin__row { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.photo-admin__row label { display: flex; gap: 6px; align-items: center; }
.file-admin { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-admin li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.editor.is-uploading { opacity: .6; }
.ql-editor img { max-width: 100%; height: auto; border-radius: 6px; }
.editor-layout > .stack, .editor-layout > aside { min-width: 0; }
.plain-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 6px; }
.alert--warning { border-color: var(--be-yellow); background: #fff8d6; }

/* Étape 5 : calendrier */
.table--events td { vertical-align: top; }
.table--events tr.is-past td { opacity: .55; }
.cat-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; background: #bdbdbd; }
.cat-organisation .cat-dot { background: var(--be-red); }
.cat-sortie .cat-dot { background: var(--black); }
.cat-vie_club .cat-dot { background: var(--be-yellow); }
.table--preview td { vertical-align: top; }
.row-dup td { background: #fffbe8; }
.row-error td { background: #fdeeee; }
.row-msg { display: inline-block; margin-top: 4px; font-size: .82rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.row-msg--error { background: var(--red); color: #fff; }
.row-msg--dup { background: var(--be-yellow); color: #000; }
.pre { white-space: pre-line; }
.select-sm { padding: 6px 8px; font-size: .88rem; width: auto; }

/* Étape 6 : randonnées */
.ride-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.ride-admin { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.ride-admin__head { display: flex; gap: 14px; align-items: center; }
.ride-admin__head img { border-radius: 6px; object-fit: cover; }
.ride-admin__head h2 { margin: 0; }
.ride-admin.is-muted { opacity: .6; }
.route-admin { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; background: #fff; }
.route-admin > summary { padding: 12px 16px; cursor: pointer; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.route-admin[open] > summary { border-bottom: 1px solid var(--line); }
.route-admin > form { padding: 16px; }
.route-admin--new { border-style: dashed; }
.route-admin .field label { display: flex; flex-direction: column; gap: 6px; }
.route-admin .field label input, .route-admin .field label select { font-weight: 400; }
.grid-3--end { align-items: end; }

/* --- Galerie (étape 7) --- */
.breadcrumb-admin { margin: 0 0 16px; }
.album-new { max-width: 640px; }
.stats--compact { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-top: 0; }
.table--albums td { vertical-align: middle; }
.album-row__title { display: flex; align-items: center; gap: 12px; font-weight: 600; text-decoration: none; color: var(--ink); }
.album-row__title:hover span { text-decoration: underline; }
.album-row__title img, .album-row__empty { width: 64px; height: 48px; flex: none; border-radius: 4px; object-fit: cover; background: #e9e9e9; }
.album-row--2 td:first-child { padding-left: 44px; }
.album-row--3 td:first-child { padding-left: 84px; }
.album-row--2 .album-row__title, .album-row--3 .album-row__title { font-weight: 500; }
.panel__title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.panel__title-row h2 { margin: 0; }
.grid-2--end { align-items: end; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 150px; padding: 24px; border: 2px dashed #b9b9b9; border-radius: 10px; background: #fafafa; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone:hover, .dropzone.is-over { border-color: var(--red); background: #fff5f5; }
.dropzone:focus-within { outline: 3px solid #fdda24; outline-offset: 2px; }
.dropzone__title { font-weight: 700; font-size: 1.1rem; }
.upload-progress progress { width: 100%; height: 12px; accent-color: var(--red); }
.upload-errors { color: var(--red-dark); margin: 4px 0 0; padding-left: 18px; }
.photo-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.photo-toolbar--actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.photo-toolbar__sep { flex: 1; }
.photo-admin--gallery { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.photo-admin--gallery li { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: grab; }
.photo-admin--gallery li:has(input[type="checkbox"]:checked) { border-color: var(--red); box-shadow: 0 0 0 2px #fde1e2; }
.photo-admin__img { position: relative; }
.photo-admin__check { position: absolute; top: 6px; left: 6px; display: flex; padding: 4px; background: rgba(255,255,255,.92); border-radius: 4px; }
.photo-admin__check input { width: 18px; height: 18px; margin: 0; }
[data-sortable] > li.is-dragging { opacity: .4; }
[data-sortable] > li.is-over { outline: 2px dashed var(--red); outline-offset: 2px; }
.sort-list { list-style: none; margin: 8px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sort-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: grab; }
.sort-list__handle { color: #9a9a9a; letter-spacing: -2px; }
details.field > summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
