/* =========================================================
   Bété Atelier — application de gestion
   Sobre et lisible : blanc, filets fins, Jost, rose poudré en accent.
   Ordinateur : menu latéral. Téléphone : onglets en bas d'écran.
   ========================================================= */
:root {
  --fond: #f7f5f3; --blanc: #fff; --encre: #161413; --doux: #7a736d; --filet: #e9e4de;
  --rose: #f3e3df; --accent: #b98a80; --rouge: #b4412a; --vert: #3f7a4e; --bleu: #2c4a7a;
  --nav: 232px; --rayon: 10px;
  --police: "Jost", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.g { margin: 0; font: 400 15px/1.5 var(--police); color: var(--encre); background: var(--fond); }
a { color: inherit; }
h1 { font-weight: 400; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.15; margin: .2rem 0 .3rem; letter-spacing: -.01em; }
h2 { font-weight: 500; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; margin: 0; }
p { margin: 0 0 .6rem; }
small { display: block; color: var(--doux); font-size: .8rem; }
.g-sur { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--doux); margin: 0; }
.g-aide { color: var(--doux); font-size: .88rem; }
.g-rouge { color: var(--rouge); } .g-vert { color: var(--vert); }
.g-barre { text-decoration: line-through; color: var(--doux); }
.g-gros { font-size: 1.25rem; margin-bottom: .2rem; }
.g-code { font-family: ui-monospace, monospace; background: var(--blanc); padding: .1rem .4rem; border-radius: 4px; }

/* ---------- Navigation ---------- */
.g-nav {
  position: fixed; inset: 0 auto 0 0; width: var(--nav); background: var(--blanc); border-right: 1px solid var(--filet);
  display: flex; flex-direction: column; padding: 1.4rem 1rem; z-index: 20;
}
.g-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; padding: 0 .6rem 1.6rem; }
.g-logo small { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; }
.g-logo__img { display: block; width: 86px; height: 36px; background: url("/assets/logo.jpg") 49% 46% / 150% auto no-repeat; mix-blend-mode: multiply; }
.g-logo__img--lg { width: 150px; height: 62px; margin: 0 auto; }
.g-menu { display: grid; gap: .2rem; }
.g-menu a { display: flex; align-items: center; gap: .8rem; padding: .7rem .8rem; border-radius: 8px; text-decoration: none; color: var(--doux); font-size: .95rem; }
.g-menu a:hover { background: var(--fond); color: var(--encre); }
.g-menu a.actif { background: var(--rose); color: var(--encre); font-weight: 500; }
.g-ico { width: 1.2rem; text-align: center; font-size: 1.05rem; }
.g-compte { margin-top: auto; display: grid; gap: .3rem; padding: 1rem .8rem 0; border-top: 1px solid var(--filet); font-size: .85rem; }
.g-compte span { font-weight: 500; }
.g-compte a, .g-compte button { color: var(--doux); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; text-align: left; cursor: pointer; }
.g-compte a:hover, .g-compte button:hover { color: var(--encre); }
.g-compte form { margin: 0; }

.g-main { margin-left: var(--nav); padding: 1.8rem clamp(1rem, 3vw, 2.4rem) 3rem; max-width: 1500px; }

/* ---------- En-tête de page ---------- */
.g-tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.4rem; }
.g-tete__actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.g-retour { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; color: var(--doux); }
.g-recherche { display: flex; gap: .5rem; flex-wrap: wrap; }
.g-recherche input, .g-recherche select { min-width: 0; }
.g-recherche input { width: min(320px, 70vw); }

/* ---------- Boutons, champs ---------- */
.g-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 42px; padding: .55rem 1.1rem;
  border: 1px solid var(--encre); border-radius: 999px; background: var(--blanc); color: var(--encre);
  font: 500 .86rem var(--police); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.g-btn:hover { background: var(--fond); }
.g-btn--plein { background: var(--encre); color: var(--blanc); }
.g-btn--plein:hover { background: #3a3532; }
input, select, textarea {
  font: 400 .95rem var(--police); color: var(--encre); background: var(--blanc); border: 1px solid var(--filet);
  border-radius: 8px; padding: .6rem .7rem; min-height: 42px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--rose); border-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; }
.g-form { display: grid; gap: .9rem; }
.g-form label { display: grid; gap: .3rem; font-size: .82rem; color: var(--doux); }
.g-form label > span { font-weight: 500; color: var(--encre); }
.g-form label em { font-style: normal; color: var(--rouge); font-size: .8rem; }
.g-form .g-erreur input, .g-form .g-erreur select, .g-form .g-erreur textarea { border-color: var(--rouge); }
.g-form--grille { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); align-items: end; }
.g-form--grille .g-photo, .g-form--grille label:has(textarea) { grid-column: 1 / -1; }
.g-case { display: flex !important; align-items: center; gap: .6rem !important; }
.g-actions { display: flex; justify-content: flex-end; gap: .6rem; grid-column: 1 / -1; margin-top: .4rem; }
.g-actions--gauche { justify-content: flex-start; flex-wrap: wrap; }
.g-segment { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.g-segment label { display: block !important; cursor: pointer; }
.g-segment input { position: absolute; opacity: 0; }
.g-segment span { display: block; text-align: center; padding: .65rem; border: 1px solid var(--filet); border-radius: 8px; font-size: .88rem; color: var(--doux); }
.g-segment input:checked + span { background: var(--encre); color: var(--blanc); border-color: var(--encre); }
.g-segment input:focus-visible + span { outline: 2px solid var(--accent); }
.g-segment ul, .g-segment div { display: contents; }

/* ---------- Cartes ---------- */
.g-carte { background: var(--blanc); border: 1px solid var(--filet); border-radius: var(--rayon); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.g-carte__tete { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .8rem; }
.g-carte__tete a { font-size: .82rem; color: var(--doux); text-decoration: none; }
.g-carte__tete a:hover { color: var(--encre); }
.g-carte--table { padding: 0; overflow-x: auto; }
.g-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 1rem; }
.g-colonnes--detail { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.g-vide { text-align: center; padding: 3rem 1rem; background: var(--blanc); border: 1px dashed var(--filet); border-radius: var(--rayon); }

.g-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.g-kpi { background: var(--blanc); border: 1px solid var(--filet); border-radius: var(--rayon); padding: 1rem 1.1rem; text-decoration: none; display: grid; gap: .2rem; }
.g-kpi span { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--doux); }
.g-kpi strong { font-weight: 400; font-size: 1.5rem; }
.g-kpi--neg strong { color: var(--rouge); }
a.g-kpi:hover { border-color: var(--accent); }

.g-ligne { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--filet); text-decoration: none; }
.g-carte__tete + .g-ligne, .g-aide + .g-ligne { border-top: 0; }
a.g-ligne:hover { color: var(--accent); }
.g-ligne__droite { display: flex; gap: .8rem; align-items: center; white-space: nowrap; }
.g-ligne__droite a { text-decoration: none; }

.g-pastille { display: inline-block; font-size: .74rem; padding: .15rem .6rem; border-radius: 999px; background: var(--fond); white-space: nowrap; }
.g-pastille--rouge { background: #f8e1db; color: var(--rouge); }
.g-pastille--vert { background: #e2efe5; color: var(--vert); }
.g-statut { display: inline-block; font-size: .72rem; font-weight: 500; padding: .2rem .65rem; border-radius: 999px; background: var(--fond); vertical-align: middle; white-space: nowrap; letter-spacing: .02em; }
.g-statut--nouvelle { background: #fde8de; color: #a3461f; }
.g-statut--confirmee { background: #e3e9f5; color: var(--bleu); }
.g-statut--coupe, .g-statut--couture, .g-statut--broderie { background: #ece6f5; color: #5d4a8a; }
.g-statut--prete { background: #e2efe5; color: var(--vert); }
.g-statut--livree { background: #eee; color: #555; }
.g-statut--annulee { background: #eee; color: #999; text-decoration: line-through; }
.g-rond { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: .4rem; vertical-align: -1px; border: 1px solid #0002; }
.g-citation { margin: .6rem 0 0; padding: .6rem .8rem; background: var(--fond); border-radius: 8px; color: var(--doux); }

.g-fiche { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1.2rem; margin: 0; }
.g-fiche dt { color: var(--doux); font-size: .85rem; }
.g-fiche dd { margin: 0; }
.g-mesures { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem; margin: 0; }
.g-mesures div { background: var(--fond); border-radius: 8px; padding: .45rem .6rem; }
.g-mesures dt { font-size: .74rem; color: var(--doux); }
.g-mesures dd { margin: 0; font-size: 1.05rem; }
.g-mesures dd::after { content: " cm"; font-size: .75rem; color: var(--doux); }
.g-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; margin: 0 0 .6rem; }
.g-chiffres dt { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--doux); }
.g-chiffres dd { margin: 0; font-size: 1.2rem; }

.g-deplier summary { cursor: pointer; font-weight: 500; font-size: .9rem; padding: .7rem 0 .2rem; list-style: none; }
.g-deplier summary::-webkit-details-marker { display: none; }
.g-deplier[open] summary { margin-bottom: .8rem; }
.g-deplier--carte summary { padding: 0; }

/* Tableau */
.g-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.g-table th { text-align: left; font-weight: 500; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--doux); padding: .8rem 1rem; border-bottom: 1px solid var(--filet); white-space: nowrap; }
.g-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--filet); vertical-align: top; }
.g-table tr:last-child td { border-bottom: 0; }
.g-table td a { text-decoration: none; }
.g-table tr[data-lien] { cursor: pointer; }
.g-table tr[data-lien]:hover td { background: #fbf9f7; }
.num { text-align: right !important; white-space: nowrap; }
.g-ligne-alerte td { background: #fdf3f0; }

/* Pipeline du tableau de bord */
.g-pipeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; }
.g-pipeline a { display: grid; text-decoration: none; text-align: center; padding: .8rem .3rem; border-radius: 8px; background: var(--fond); }
.g-pipeline a:hover { background: var(--rose); }
.g-pipeline strong { font-weight: 400; font-size: 1.6rem; }
.g-pipeline span { font-size: .72rem; color: var(--doux); }

/* Étapes sur la fiche commande */
.g-etapes { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 1rem; }
.g-etapes button { font: 500 .8rem var(--police); padding: .5rem .9rem; border-radius: 999px; border: 1px solid var(--filet); background: var(--blanc); color: var(--doux); cursor: pointer; min-height: 38px; }
.g-etapes button:hover { border-color: var(--encre); color: var(--encre); }
.g-etapes button.actif { background: var(--encre); color: var(--blanc); border-color: var(--encre); }
.g-etapes__annuler { margin-left: auto; }

/* ---------- Tableau des commandes (kanban) ---------- */
.g-kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: .8rem; overflow-x: auto; padding-bottom: 1rem; scroll-snap-type: x proximity; }
.g-col { background: #efebe7; border-radius: var(--rayon); padding: .7rem; min-height: 60vh; scroll-snap-align: start; transition: background .15s; }
.g-col.survol { background: var(--rose); }
.g-col__titre { display: flex; justify-content: space-between; align-items: center; margin: .1rem .2rem .7rem; }
.g-col__nb { font-size: .75rem; background: var(--blanc); border-radius: 999px; padding: .05rem .55rem; letter-spacing: 0; }
.g-col__cartes { display: grid; gap: .55rem; }
.g-col__vide { text-align: center; color: var(--doux); margin: 1rem 0; }
.g-ticket { position: relative; background: var(--blanc); border-radius: 8px; border: 1px solid var(--filet); }
.g-ticket[draggable="true"] { cursor: grab; }
.g-ticket.glisse { opacity: .45; }
.g-ticket__lien { display: grid; grid-template-columns: 46px 1fr; gap: .7rem; padding: .7rem 2.4rem .7rem .7rem; text-decoration: none; }
.g-ticket__lien img { width: 46px; height: 60px; object-fit: cover; object-position: center 20%; border-radius: 4px; background: var(--rose); }
.g-ticket__lien:not(:has(img)) { grid-template-columns: 1fr; }
.g-ticket p { margin: 0; }
.g-ticket__num { font-size: .7rem; letter-spacing: .08em; color: var(--doux); }
.g-ticket__client { font-weight: 500; }
.g-ticket__modele, .g-ticket__date, .g-ticket__prix { font-size: .8rem; color: var(--doux); }
.g-retard { color: var(--rouge) !important; font-weight: 500; }
.g-ticket__suivant {
  position: absolute; right: .45rem; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--filet); background: var(--blanc); cursor: pointer; font-size: 1rem;
}
.g-ticket__suivant:hover { background: var(--encre); color: var(--blanc); }

/* Dépenses */
.g-mois { display: flex; align-items: center; gap: .8rem; }
.g-mois a { text-decoration: none; font-size: 1.1rem; padding: .1rem .5rem; border-radius: 6px; }
.g-mois a:hover { background: var(--blanc); }
.g-barre-cat { position: relative; display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .7rem; margin-bottom: .35rem; border-radius: 8px; text-decoration: none; overflow: hidden; isolation: isolate; }
.g-barre-cat i { position: absolute; inset: 0 auto 0 0; background: var(--rose); z-index: -1; border-radius: 8px; }
.g-barre-cat.actif { outline: 1px solid var(--accent); }

/* Messages */
.g-messages { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .4rem; }
.g-message { padding: .75rem 1rem; border-radius: 8px; background: var(--blanc); border-left: 3px solid var(--accent); }
.g-message--success { border-color: var(--vert); }
.g-message--warning, .g-message--error { border-color: var(--rouge); background: #fdf3f0; }

/* Connexion (page commune Atelier / Client) */
.g--connexion { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.g-connexion { width: min(400px, 100%); background: var(--blanc); border: 1px solid var(--filet); border-radius: 14px; padding: 1.8rem 1.6rem 1.4rem; text-align: center; }
.g-connexion__logo { display: inline-block; margin-bottom: 1.2rem; }
.g-connexion .g-form { text-align: left; margin: 1.1rem 0 1rem; }
.g-connexion .g-sur { margin-top: .2rem; }
.g-connexion .g-btn { width: 100%; }
.g-onglets { display: grid; grid-template-columns: 1fr 1fr; background: var(--fond); border-radius: 999px; padding: 4px; margin-bottom: 1.4rem; }
.g-onglets button { font: 500 .9rem var(--police); border: 0; background: none; padding: .6rem; border-radius: 999px; cursor: pointer; color: var(--doux); }
.g-onglets button[aria-selected="true"] { background: var(--blanc); color: var(--encre); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.g-onglets button:focus-visible { outline: 2px solid var(--accent); }
.g-aide--petite { font-size: .8rem; }
.g-connexion__retour { margin: 1rem 0 0; font-size: .82rem; }
.g-connexion__retour a { color: var(--doux); text-decoration: none; }

/* ---------- Téléphone ---------- */
@media (max-width: 860px) {
  .g-nav { position: sticky; top: 0; inset: auto; width: auto; height: 56px; flex-direction: row; align-items: center; padding: 0 1rem; border-right: 0; border-bottom: 1px solid var(--filet); }
  .g-logo { padding: 0; }
  .g-menu {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0;
    background: var(--blanc); border-top: 1px solid var(--filet); padding: .3rem .3rem calc(.3rem + env(safe-area-inset-bottom));
  }
  .g-menu a { flex-direction: column; gap: .1rem; padding: .4rem .2rem; font-size: .68rem; border-radius: 8px; }
  .g-ico { font-size: 1.2rem; }
  .g-compte { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; gap: .9rem; align-items: center; }
  .g-compte span, .g-compte a { display: none; }
  .g-main { margin-left: 0; padding: 1.1rem 1rem 6rem; }
  .g-colonnes--detail { grid-template-columns: 1fr; }
  .g-pipeline { grid-template-columns: repeat(3, 1fr); }
  .g-kanban { grid-auto-columns: 82vw; margin: 0 -1rem; padding: 0 1rem 1rem; }
  .g-table th:nth-child(2), .g-table td:nth-child(2) { display: none; }
  .g-tete__actions, .g-recherche { width: 100%; }
  .g-recherche input { width: 100%; flex: 1; }
  .g-etapes { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .3rem; }
  .g-etapes__annuler { margin-left: 0; }
}

/* ---------- Site (contenu de la vitrine) ---------- */
.g-site-bloc { margin-bottom: 1.2rem; }
.g-site-bloc .g-carte__tete { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.g-site-bloc h2 { margin: 0; font-size: 1.05rem; }
.g-site-accueil { display: grid; grid-template-columns: 90px 90px 1fr; gap: .8rem; align-items: center; margin-top: .8rem; }
.g-site-accueil img { width: 90px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; }
.g-site-accueil small { display: block; color: var(--doux); }
.g-site-accueil strong { font-size: 1.3rem; font-weight: 400; }
.g-site-modeles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .9rem; margin-top: .6rem; }
.g-site-modele { display: grid; gap: .2rem; text-decoration: none; color: inherit; position: relative; }
.g-site-modele img, .g-site-modele__vide { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: center 20%; border-radius: 4px; background: #f1ede8; }
.g-site-modele__vide { display: grid; place-items: center; color: var(--doux); font-size: .8rem; }
.g-site-modele small { color: var(--doux); font-size: .75rem; }
.g-site-modele .g-pastille { position: absolute; top: .4rem; left: .4rem; }
.g-site-modele--masque img { opacity: .45; }
.g-site-groupe { margin: 0 0 1rem; border: 0; }
.g-site-groupe legend { font-weight: 600; font-size: 1rem; padding: .9rem 0 0; }
.g-site-photo { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.g-site-photo img, .g-site-photo video, .g-site-photo .g-site-modele__vide { width: 96px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; }
@media (max-width: 560px) { .g-site-accueil { grid-template-columns: 70px 70px; } .g-site-accueil div { grid-column: 1 / -1; } .g-site-accueil img { width: 70px; } }
.g-tissu { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.g-tissu img, .g-tissu__vide { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; border: 1px solid var(--filet); }
