/* ===== Calendrier de réservation — complète style.css ===== */

/* Messages flash (confirmation verte / erreur rouge) */
.flash {
    margin: 18px 0;
    padding: 14px 20px;
    border-radius: 14px;
    font-weight: 600;
}
.flash-success { background: #dcfce7; color: #166534; }
.flash-error   { background: #fee2e2; color: #991b1b; }

/* Barre de contrôle */
.controles {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 26px 0 14px;
}
.choix-machine { display: flex; gap: 8px; flex-wrap: wrap; }
.pastille {
    padding: 9px 16px;
    border-radius: 999px;
    background: white;
    color: #0f172a;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid transparent;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}
.pastille.active { background: #1e88ff; color: white; }
.pastille.bloquee { opacity: .55; }
.nav-semaine { display: flex; gap: 8px; }
.btn-nav {
    padding: 9px 14px;
    border-radius: 10px;
    background: #07111f;
    color: white;
    text-decoration: none;
    font-size: .9rem;
}

/* Cartes */
.carte {
    background: white;
    border-radius: 20px;
    padding: 24px;
    margin: 18px 0;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .10);
    overflow-x: auto;
}
.carte h2 { margin-bottom: 14px; font-size: 1.15rem; }

/* La grille */
.calendrier {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 760px;
}
.calendrier th {
    padding: 10px 6px;
    font-size: .85rem;
    color: #475569;
    text-transform: capitalize;
}
.calendrier th.jour-actuel { color: #1e88ff; }
.calendrier td {
    border: 1px solid #e2e8f0;
    height: 40px;
    text-align: center;
    font-size: .8rem;
}
.col-heure {
    width: 46px;
    border: none !important;
    color: #94a3b8;
    font-weight: 600;
}

/* Les 3 états d'un créneau */
.calendrier td.libre a {
    display: block;
    height: 100%;
    line-height: 40px;
    color: transparent;
    text-decoration: none;
}
.calendrier td.libre a:hover {
    background: #dbeafe;
    color: #1e88ff;
    font-weight: bold;
}
.calendrier td.occupe {
    background: #1e88ff;
    color: white;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0 4px;
}
.calendrier td.occupe .instructeur {
    display: block;
    font-size: .68rem;
    font-weight: 400;
    opacity: .85;
}
.calendrier td.indispo {
    background: #f1f5f9;
    background-image: repeating-linear-gradient(
        45deg, transparent, transparent 6px, #e2e8f0 6px, #e2e8f0 8px);
}

/* Formulaire + mes réservations côte à côte */
.deux-colonnes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
@media (max-width: 900px) { .deux-colonnes { grid-template-columns: 1fr; } }

.carte form p { margin-bottom: 12px; }
.carte form label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .9rem; }
.carte form input, .carte form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: .95rem;
}
.errorlist { color: #991b1b; font-size: .85rem; list-style: none; }

.btn-principal {
    background: #1e88ff;
    color: white;
    border: none;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
}
.btn-principal:hover { background: #1668c7; }

.ma-resa {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}
.ma-resa:last-child { border-bottom: none; }
.btn-annuler {
    background: #fee2e2;
    color: #991b1b;
    border: none;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
}
.btn-annuler:hover { background: #fecaca; }

.vide { color: #94a3b8; padding: 8px 0; }

/* ===== Workflow instructeur + soleil ===== */

/* Créneau réservé mais en attente d'accord instructeur */
.calendrier td.occupe.attente {
    background: repeating-linear-gradient(
        45deg, #f59e0b, #f59e0b 8px, #fbbf24 8px, #fbbf24 16px);
}

/* Heures de soleil dans l'en-tête */
.calendrier th .soleil {
    display: block;
    font-size: .68rem;
    font-weight: 400;
    color: #94a3b8;
    text-transform: none;
}

.btn-demandes { background: #f59e0b; }

/* Page mes demandes */
.demande {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
}
.demande:last-child { border-bottom: none; }
.demande-actions form { display: inline-flex; gap: 8px; }
.demande-actions details { margin-top: 8px; }
.demande-actions summary { cursor: pointer; color: #1e88ff; font-weight: 600; }
.form-decaler { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.form-decaler label { font-size: .85rem; font-weight: 600; }
.form-decaler input { display: block; padding: 8px; border: 1px solid #cbd5e1; border-radius: 8px; }

/* ===== Boutique ===== */
.grille-articles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.article {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px;
    text-align: center;
}
.article .prix { font-size: 1.4rem; font-weight: bold; color: #1e88ff; margin: 8px 0 4px; }
.article .stock { color: #94a3b8; font-size: .85rem; margin-bottom: 10px; }
.article .stock.rupture { color: #991b1b; font-weight: 600; }
.article .qte { width: 64px; padding: 8px; border: 1px solid #cbd5e1; border-radius: 8px; margin-right: 6px; }

/* ===== Statuts documents (Mes papiers / Membres) ===== */
.statut-doc { padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.statut-doc.attente { background: #fef3c7; color: #92400e; }
.statut-doc.valide  { background: #dcfce7; color: #166534; }
.statut-doc.refuse  { background: #fee2e2; color: #991b1b; }

/* ===== Onglets des bases + grilles instructeurs ===== */
.onglets-base {
    display: flex;
    gap: 10px;
    margin: 26px 0 0;
}
/* Même style que les pastilles d'immatriculation, en un peu plus grand */
.onglet {
    padding: 11px 22px;
    border-radius: 999px;
    background: white;
    color: #0f172a;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid transparent;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}
.onglet.actif {
    background: #1e88ff;
    color: white;
}
.nom-instructeur { margin: 18px 0 8px; font-size: 1rem; }
.calendrier-instructeur td { height: 26px; }
.calendrier td.dispo-instructeur { background: #f0fdf4; }

/* ===== Lignes d'atterrissage (page valider un vol) ===== */
.ligne-atterrissage {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.ligne-atterrissage p { margin: 0; flex: 1 1 130px; }
.ligne-atterrissage label { font-size: .8rem; }
.ligne-atterrissage input,
.ligne-atterrissage select { width: 100%; }
.ligne-atterrissage .helptext { display: none; }
.btn-plus {
    background: #dbeafe;
    color: #1e40af;
    border: 2px dashed #1e88ff;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
}
.btn-plus:hover { background: #bfdbfe; }

/* Fiche de renseignement (Mes papiers) en deux colonnes */
.fiche-grille {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 18px;
}
.fiche-grille p:last-child { grid-column: 1 / -1; }
@media (max-width: 700px) { .fiche-grille { grid-template-columns: 1fr; } }

/* Photo d'article boutique */
.photo-article {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
}

/* Cellule cours théorique dans les grilles */
.calendrier td.occupe.cours-cell { background: #7c3aed; }

/* Pagination des carnets */
.pagination-carnet {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}
