/* =====================================================================
   _rider-notes.css — Drawer "info cavalier" + Non-competing horses (NCH)
   ---------------------------------------------------------------------
   Propriétaire unique de TOUT le style du drawer info cavalier
   (.rider-info-drawer et ses éléments internes) + des styles NCH.

   Reconstruit à partir du style V5.3 d'origine (textarea, boutons,
   liste chevaux, footer, badges) + ajout V5.13 (section NCH drawer
   et colonne NCH du tableau récap).

   NE PAS dupliquer .rider-info-drawer ailleurs (ni dans app.css).
   ===================================================================== */

/* ─── Cellule NOM cliquable (tableau récap) ─── */
.cell-rider-name {
    cursor: pointer;
    position: relative;
    transition: background 0.1s ease;
}
.cell-rider-name:hover {
    background: #e8f4fd !important;
}
.cell-rider-name strong {
    pointer-events: none; /* le clic remonte à la <td> */
}

/* ─── Bulle bleue "note présente" ─── */
.note-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    color: #3498db;
    vertical-align: middle;
    pointer-events: none;
}
.note-bubble svg {
    width: 100%;
    height: 100%;
    display: block;
}
.cell-rider-name.has-note strong {
    color: #2c3e50;
}

/* ─── Conteneur du drawer (panneau latéral droit, slide-in) ─── */
.rider-info-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 540px;
    max-width: 100vw;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 9001;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    flex-direction: column;
}
.rider-info-drawer.open {
    transform: translateX(0);
}

/* ─── En-tête du drawer ─── */
.rider-info-drawer .drawer-header {
    padding: 16px 20px;
    background: #2c3e50;
    color: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}
.rider-info-drawer .drawer-title-wrap {
    flex: 1;
    min-width: 0;
}
.rider-info-drawer .drawer-header h3 {
    margin: 0 0 4px;
    font-size: 16px;
    color: #fff;
    font-weight: 700;
}
.rider-info-drawer .drawer-subtitle {
    font-size: 12px;
    color: #bdc3c7;
}
.rider-info-drawer .drawer-close {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
}
.rider-info-drawer .drawer-close:hover {
    color: #e74c3c;
}

/* ─── Corps du drawer ─── */
.rider-info-drawer .drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}
.rider-info-drawer .section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #7f8c8d;
    letter-spacing: 0.5px;
    margin: 0 0 8px;
}
.rider-info-drawer .section + .section {
    margin-top: 20px;
}

/* ─── Liste chevaux acceptés ─── */
.rider-info-drawer .horse-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.rider-info-drawer .horse-list li {
    padding: 8px 10px;
    border: 1px solid #ecf0f1;
    border-radius: 6px;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #fdfefe;
}
.rider-info-drawer .horse-list .horse-name {
    font-weight: 600;
    color: #2c3e50;
}
.rider-info-drawer .horse-list .horse-fei {
    font-size: 11px;
    color: #95a5a6;
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
}
.rider-info-drawer .horse-list .horse-cells {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}
.rider-info-drawer .horse-list .horse-cell-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    background: #d5f5e3;
    color: #186a3b;
    font-size: 11px;
    font-weight: 600;
}
.rider-info-drawer .horse-list .empty {
    font-style: italic;
    color: #95a5a6;
    padding: 8px 10px;
}

/* ─── Textarea note ─── */
.rider-info-drawer .rider-note-textarea {
    width: 100%;
    min-height: 140px;
    padding: 10px 12px;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
}
.rider-info-drawer .rider-note-textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}
.rider-info-drawer .note-meta {
    font-size: 11px;
    color: #95a5a6;
    margin-top: 6px;
    min-height: 14px;
}

/* ─── Footer du drawer + boutons ─── */
.rider-info-drawer .drawer-footer {
    padding: 12px 20px;
    border-top: 1px solid #ecf0f1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
    background: #f8f9fa;
}
.rider-info-drawer .btn-save {
    background: #27ae60;
    color: #fff;
    border: 0;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}
.rider-info-drawer .btn-save:hover {
    background: #229954;
}
.rider-info-drawer .btn-save:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}
.rider-info-drawer .btn-cancel {
    background: #ecf0f1;
    color: #2c3e50;
    border: 0;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}
.rider-info-drawer .btn-cancel:hover {
    background: #d5dbdb;
}

/* ─── État de sauvegarde + badge accès ─── */
.rider-info-drawer .save-status {
    flex: 1;
    align-self: center;
    font-size: 12px;
}
.rider-info-drawer .save-status.success { color: #27ae60; }
.rider-info-drawer .save-status.error   { color: #e74c3c; }
.rider-info-drawer .access-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    background: #95a5a6;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
}

/* ─── Backdrop (fond sombre derrière le drawer) ─── */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 9000;
}
.drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* ─── V5.13 : Section NCH dans le drawer ─── */
.rider-info-drawer #rider-info-nch-section .nch-hint {
    margin: 0 0 10px;
    font-size: 12px;
    color: #7f8c8d;
}
.rider-info-drawer .nch-week-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
/* Chaque semaine = une petite carte */
.rider-info-drawer .nch-week-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: #faf6fc;            /* léger violet, assorti à la colonne NCH */
    border: 1px solid #e7d4ef;
    border-radius: 8px;
}
.rider-info-drawer .nch-week-label {
    flex: 0 0 auto;
    font-weight: 700;
    font-size: 14px;
    color: #2c3e50;
}
.rider-info-drawer .nch-week-input {
    width: 72px;
    padding: 8px 10px;
    border: 1px solid #c4a7d4;
    border-radius: 6px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    background: #fff;
}
.rider-info-drawer .nch-week-input:focus {
    outline: none;
    border-color: #8e44ad;
    box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.15);
}
.rider-info-drawer .nch-week-input:disabled {
    background: #f4f6f7;
    color: #95a5a6;
}

/* ─── V5.13 : Marqueur waiting list (cellule CAV/CHX en attente) ─── */
.riders-recap-table .cell-waiting-mark {
    display: inline-block;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 15px;
    color: #b35900;
    background: #fdebd0;
    border-radius: 8px;
    letter-spacing: 0.3px;
}

/* ─── V5.13 : Colonne NCH dédiée dans le tableau récap ─── */
/* Largeur étroite, alignée sur les colonnes RID/HRS de gauche.
   Ajuste 44px si tes colonnes RID/HRS ont une autre largeur.
   Fond violet léger pour distinguer la colonne du gris de la zone TOT/BOX.
   !important nécessaire car le fond gris vient d'une règle plus générale. */
.riders-recap-table .nch-col-header,
.riders-recap-table .nch-cell,
.riders-recap-table .nch-group-nch,
.riders-recap-table .nch-foot-nch {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    white-space: nowrap;
    text-align: center;
}
/* Fond violet léger : cellules de données + en-têtes + totaux de groupe.
   PAS le footer (.nch-foot-nch) : il reste sur le fond noir de la ligne TOTALS.
   !important nécessaire car le fond gris vient d'une règle plus générale. */
.riders-recap-table .nch-col-header,
.riders-recap-table .nch-cell,
.riders-recap-table .nch-group-nch {
    color: #8e44ad;   /* violet : distinct des couleurs de semaine */
    background: #f3e9f7 !important;   /* violet très clair */
}
.riders-recap-table .nch-col-header {
    background: #e7d4ef !important;   /* violet un peu plus soutenu pour l'en-tête */
}
.riders-recap-table .nch-cell {
    font-weight: 600;
}
.riders-recap-table .nch-group-nch {
    font-weight: 700;
}
/* Footer : reste sur le fond noir de la ligne TOTALS, texte clair pour lisibilité */
.riders-recap-table .nch-foot-nch {
    font-weight: 700;
    color: #fff;
}
/* ═══════════════ V5.x : Options dans le drawer cavalier ═══════════════ */
#rider-info-options-section .options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.opt-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    background: #f7f5fb;
    border: 1px solid #ece8f3;
    border-radius: 6px;
}
.opt-name-label {
    font-weight: 600;
    font-size: 13px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 6px;
}
.opt-cab-badge {
    color: #8e44ad;
    font-size: 11px;
}
.opt-week-cells {
    display: flex;
    gap: 10px;
}
.opt-week-cell {
    display: flex;
    align-items: center;
    gap: 5px;
}
.opt-week-label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
}
.opt-week-input {
    width: 52px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;
}
.opt-week-input:focus {
    border-color: #8e44ad;
    outline: none;
}
/* Pastille couleur dans le tableau d'options */
.opt-color-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.15);
    vertical-align: middle;
}
/* Bloc couleur dans la modale d'option */
.option-color-field {
    display: flex;
    align-items: center;
    gap: 8px;
}
.option-color-input {
    width: 48px;
    height: 34px;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    background: #fff;
}
.option-color-clear {
    padding: 5px 9px;
}
.option-color-none {
    color: #888;
    font-size: 12px;
    font-style: italic;
}