/* Style minimal, gros boutons, lisible sur téléphone bas de gamme */

* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, sans-serif;
    margin: 0;
    padding: 1.5rem;
    background: #f4f4f2;
    color: #1a1a1a;
    font-size: 1.1rem;
}

.carte {
    max-width: 420px;
    margin: 2rem auto;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 1.4rem;
    text-align: center;
}

input {
    width: 100%;
    padding: 0.9rem;
    font-size: 1.3rem;
    margin: 0.5rem 0 1rem 0;
    border: 2px solid #ccc;
    border-radius: 8px;
    text-align: center;
}

button {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    background: #d97706;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

button:active {
    background: #b45309;
}

.bouton-lien {
    display: block;
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    background: #d97706;
    border: none;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.bouton-lien:active {
    background: #b45309;
}

.erreur {
    color: #b91c1c;
    text-align: center;
    font-weight: bold;
}

/* --- Admin : nav + pages larges (tables de gestion) --- */

.nav-admin {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #1a1a1a;
    padding: 1rem 1.5rem;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
}

.nav-admin a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.nav-deconnexion {
    margin-left: auto;
}

.nav-deconnexion button {
    width: auto;
    padding: 0.4rem 1rem;
    font-size: 0.95rem;
}

.page-large {
    max-width: 900px;
    margin: 0 auto;
}

.page-large h1 {
    text-align: left;
}

table.tableau {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

table.tableau th,
table.tableau td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

table.tableau th {
    background: #f4f4f2;
}

table.tableau tr.inactif {
    opacity: 0.5;
}

table.tableau tr.a-regler {
    background: #fef3c7;
}

.pastille-etat {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: bold;
}

.pastille-etat.pastille-attention {
    background: #fde68a;
    color: #92400e;
}

.pastille-etat.pastille-ok {
    background: #dcfce7;
    color: #166534;
}

/* Pastille de la nav (staff/admin) — attire l'attention sur un onglet à
   vérifier (ex : chambres avec ardoise en attente). Vide (aucun contenu
   HTMX renvoyé) quand il n'y a rien à signaler. */
.nav-admin .pastille {
    display: inline-block;
    min-width: 1.3rem;
    padding: 0.05rem 0.4rem;
    margin-left: 0.3rem;
    border-radius: 999px;
    background: #dc2626;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
}

.formulaire-inline {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.formulaire-inline input,
.formulaire-inline select {
    width: auto;
    margin: 0;
    padding: 0.6rem;
    font-size: 1rem;
}

.formulaire-inline button {
    width: auto;
    padding: 0.6rem 1.2rem;
}

.bouton-petit {
    width: auto;
    padding: 0.35rem 0.8rem;
    font-size: 0.9rem;
    margin-right: 0.3rem;
}

.bouton-secondaire {
    background: #6b7280;
}

.bouton-danger {
    background: #b91c1c;
}

/* --- Client (menu QR) --- */

.client-entete {
    text-align: center;
    padding: 1rem 0 1.5rem 0;
}

.client-entete h1 {
    text-align: center;
    margin-bottom: 0.2rem;
}

.carte-sejour {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.carte-sejour div {
    margin: 0.2rem 0;
}

.categorie-titre {
    font-size: 1.1rem;
    font-weight: bold;
    margin: 1.5rem 0 0.5rem 0;
    color: #78350f;
}

.produit-ligne {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.produit-info {
    flex: 1;
}

.produit-nom {
    font-weight: bold;
}

.produit-prix {
    color: #555;
    font-size: 0.95rem;
}

.stepper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.stepper button {
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    font-size: 1.4rem;
    border-radius: 50%;
}

.stepper .quantite {
    min-width: 1.5rem;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.panier-barre {
    position: sticky;
    bottom: 0;
    background: #1a1a1a;
    color: white;
    padding: 1rem;
    margin: 1.5rem -1.5rem -1.5rem -1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.recap-commande {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
}

.recap-commande textarea {
    width: 100%;
    padding: 0.7rem;
    font-size: 1rem;
    border: 2px solid #ccc;
    border-radius: 8px;
    font-family: inherit;
    min-height: 4rem;
}

.message-etat {
    padding: 0.8rem;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    margin-top: 1rem;
}

.message-etat.succes {
    background: #dcfce7;
    color: #166534;
}

.message-etat.echec {
    background: #fee2e2;
    color: #991b1b;
}

/* --- Staff : suivi des commandes --- */

.grille-commandes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.carte-commande {
    background: white;
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border-left: 6px solid #d97706;
}

.carte-commande.statut-en_preparation {
    border-left-color: #2563eb;
}

.carte-commande .zone-titre {
    font-size: 1.3rem;
    font-weight: bold;
}

.carte-commande .statut-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: bold;
    background: #fef3c7;
    color: #92400e;
    margin-bottom: 0.5rem;
}

.carte-commande.statut-en_preparation .statut-badge {
    background: #dbeafe;
    color: #1e40af;
}

.carte-commande.statut-servie {
    border-left-color: #16a34a;
}

.carte-commande.statut-servie .statut-badge {
    background: #dcfce7;
    color: #166534;
}

.carte-commande.statut-annulee {
    border-left-color: #991b1b;
}

.carte-commande.statut-annulee .statut-badge {
    background: #fee2e2;
    color: #991b1b;
}

.carte-commande .boutons-paiement {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.carte-commande .boutons-paiement button {
    flex: 1 1 auto;
    width: auto;
    font-size: 1rem;
    padding: 0.7rem;
}

.carte-commande .boutons-paiement button.bouton-ardoise {
    background: #78350f;
}

.carte-commande button.bouton-annuler {
    width: 100%;
    margin-top: 0.6rem;
    background: transparent;
    color: #991b1b;
    border: 2px solid #991b1b;
}

/* --- Staff : suivi de l'ardoise des chambres --- */

.carte-commande.reglee {
    border-left-color: #16a34a;
}

.carte-commande.reglee .statut-badge {
    background: #dcfce7;
    color: #166534;
}

.carte-commande.a-regler {
    border-left-color: #dc2626;
}

.carte-commande.a-regler .statut-badge {
    background: #fee2e2;
    color: #991b1b;
}

.formulaire-checkin {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.formulaire-checkin input {
    width: 100%;
    margin: 0;
    padding: 0.6rem;
    font-size: 1rem;
}

.formulaire-checkin label {
    font-size: 0.9rem;
    color: #555;
}

.carte-commande .lignes-commande {
    margin: 0.7rem 0;
}

.carte-commande .note-commande {
    font-style: italic;
    color: #555;
    margin: 0.5rem 0;
}

.carte-commande .prenom-commande {
    font-weight: bold;
    font-size: 1.1rem;
    color: #1e293b;
}

.carte-commande .total-commande {
    font-weight: bold;
    margin-bottom: 0.8rem;
}

.carte-commande button {
    font-size: 1.15rem;
    padding: 1rem;
}

.carte-commande .recu-commande {
    margin-top: 0.6rem;
}

.commandes-chambre {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.commandes-chambre .commande-lecture-seule {
    margin-top: 0.4rem;
}

.commandes-chambre .statut-badge {
    margin-bottom: 0;
    margin-right: 0.4rem;
}

.carte-commande .recu-commande a {
    display: block;
    text-align: center;
    padding: 0.7rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: #1e293b;
    font-weight: bold;
    text-decoration: none;
}

.aucune-commande {
    text-align: center;
    color: #555;
    padding: 3rem 0;
}

.etat-connexion {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
}

/* --- Pages d'accueil (racine, /admin, /staff) : gros boutons centrés ---
   Placé en fin de fichier : les sélecteurs .page-large h1 (plus haut, pages
   de gestion) et .page-accueil h1 ont la même spécificité CSS — l'ordre
   dans la feuille de style tranche. Doit rester après .page-large pour que
   le titre soit bien centré même sur /admin et /staff (imbriqués dans
   .page-large via le layout). */

.page-accueil {
    max-width: 480px;
    margin: 2rem auto;
    text-align: center;
}

.page-accueil h1 {
    text-align: center;
}

.sous-titre {
    text-align: center;
    color: #666;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
}

.grille-accueil {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.grille-accueil .bouton-lien {
    padding: 1.3rem;
    font-size: 1.25rem;
}
