/* ==========================================================================
   Tenues de travail — La Parisienne / Dream Cake
   Charte La Parisienne : Playfair Display + Lato, brun / doré / crème.
   ========================================================================== */

:root {
  --beige: #F5E6C8;
  --brun: #6B3A2A;
  --dore: #D4A853;
  --blanc: #FDFAF4;
  --brun-dark: #4A2518;
  --brun-light: #8B5E4A;
  --text: #3A2010;
  --text-muted: #8B5E4A;
  --shadow: rgba(107, 58, 42, 0.13);
  --bordure: rgba(107, 58, 42, 0.18);
  --succes-bg: #d4edda; --succes-text: #155724;
  --erreur-bg: #f8d7da; --erreur-text: #721c24;
  --alerte-bg: #fff3cd; --alerte-text: #6b4e00;
  --danger: #A3392F;
  --vert: #2e7d4f;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Lato', sans-serif; background: var(--beige); color: var(--text); line-height: 1.55; }
a { color: var(--brun); }

/* ===== Header ===== */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(253, 250, 244, 0.95);
  backdrop-filter: blur(8px); border-bottom: 2px solid var(--dore); }
.topbar-inner { max-width: 1150px; margin: 0 auto; padding: 0.6rem 1.25rem; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: 0.6rem 1.5rem; }
.logo { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.logo img { height: 42px; width: auto; }
.logo-txt { display: flex; flex-direction: column; line-height: 1.1; }
.logo-main { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.25rem; color: var(--brun); }
.logo-sub { font-size: 0.6rem; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--dore); margin-top: 2px; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1.3rem; }
.nav-links a { position: relative; text-decoration: none; color: var(--brun); font-weight: 700; font-size: 0.78rem;
  letter-spacing: 1.1px; text-transform: uppercase; padding: 6px 0; }
.nav-links a::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--dore); transition: width .25s; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--dore); }
.nav-links a.cta { background: var(--brun); color: var(--beige); padding: 0.45rem 1rem; border-radius: 50px; }
.nav-links a.cta::after { display: none; }
.nav-links .user { font-size: 0.75rem; color: var(--text-muted); }

/* ===== Layout ===== */
.container { max-width: 1150px; margin: 0 auto; padding: 1.6rem 1.25rem 3rem; }
h1, h2 { font-family: 'Playfair Display', serif; font-weight: 700; color: var(--brun); }
h1 { font-size: 1.8rem; margin: 0.2rem 0 1rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.8rem; }
h2::after, h1::after { content: ''; display: block; width: 46px; height: 2px; background: var(--dore); margin-top: 6px; }
h3 { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin: 1.4rem 0 0.5rem; }
.muted { color: var(--text-muted); font-size: 0.88rem; }
.entete-page { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; }
.entete-page h1 { margin-bottom: 0.6rem; }

.grille { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.carte { background: var(--blanc); border: 1px solid var(--bordure); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; box-shadow: 0 2px 10px var(--shadow); }
.carte.alerte { border-left: 4px solid var(--danger); }
.chiffre { font-family: 'Playfair Display', serif; font-size: 2.1rem; font-weight: 700; color: var(--brun); line-height: 1.1; }
.chiffre-lib { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; }

.actions-rapides { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.5rem 0 1.25rem; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: 0 2px 10px var(--shadow); }
table.t { width: 100%; border-collapse: collapse; background: var(--blanc); }
table.t th, table.t td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--bordure); text-align: left; vertical-align: middle; }
table.t thead th { background: var(--beige); color: var(--brun); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }
table.t tbody tr:hover { background: rgba(212, 168, 83, 0.07); }
table.t td.n, table.t th.n { text-align: center; white-space: nowrap; }
.zero { color: var(--danger); font-weight: 700; }
.bas { color: #b06a00; font-weight: 700; }
.ligne-clic { cursor: pointer; }

.badge { display: inline-block; padding: 0.12rem 0.6rem; border-radius: 50px; font-size: 0.72rem; font-weight: 700;
  background: var(--beige); color: var(--brun); white-space: nowrap; }
.badge.ok { background: var(--succes-bg); color: var(--succes-text); }
.badge.ko { background: var(--erreur-bg); color: var(--erreur-text); }
.badge.warn { background: var(--alerte-bg); color: var(--alerte-text); }
.badge.remise { background: #e9dcc6; }
.badge.restitution { background: #dfe9e2; color: #24543a; }

/* ===== Forms ===== */
label.champ { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--brun); }
input, select, textarea { font: inherit; padding: 0.6rem 0.75rem; border: 2px solid var(--bordure); border-radius: 9px;
  background: #fff; color: var(--text); font-size: 1rem; outline: none; text-transform: none; letter-spacing: 0; font-weight: 400; }
input:focus, select:focus, textarea:focus { border-color: var(--dore); box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.2); }
textarea { width: 100%; min-height: 9rem; line-height: 1.45; }
.form-ligne { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: flex-end; }
.form-ligne > label.champ { flex: 1 1 180px; }
input[type=number] { width: 5.2rem; text-align: center; }
input.qte { width: 4.4rem; padding: 0.55rem 0.3rem; font-size: 1.1rem; font-weight: 700; }
input.qte:not(:placeholder-shown) { border-color: var(--dore); background: #fffaf0; }
.case { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.95rem; cursor: pointer; }
.case input { width: 1.4rem; height: 1.4rem; flex: none; margin-top: 2px; accent-color: var(--brun); }

button, .bouton { padding: 0.65rem 1.4rem; background: var(--brun); color: var(--beige); border: none; border-radius: 50px;
  font: inherit; font-size: 0.88rem; font-weight: 700; letter-spacing: 0.02em; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.4rem; transition: background .2s, transform .2s; }
button:hover, .bouton:hover { background: var(--brun-dark); transform: translateY(-1px); }
.bouton.grand, button.grand { padding: 0.9rem 1.8rem; font-size: 1rem; }
.bouton.second, button.second { background: transparent; color: var(--brun); border: 2px solid var(--brun); }
.bouton.second:hover, button.second:hover { background: var(--brun); color: var(--beige); }
.bouton.dore, button.dore { background: var(--dore); color: var(--brun-dark); }
button.danger { background: var(--danger); color: #fff; }
button.petit, .bouton.petit { padding: 0.35rem 0.9rem; font-size: 0.78rem; }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ===== Saisie des quantités (remise) ===== */
.article-bloc { background: var(--blanc); border: 1px solid var(--bordure); border-radius: var(--radius); padding: 0.9rem 1.1rem; margin-bottom: 0.75rem; }
.article-bloc .titre { font-weight: 700; color: var(--brun); margin-bottom: 0.5rem; }
.article-bloc .titre small { color: var(--text-muted); font-weight: 400; }
.tailles { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.taille { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.taille b { font-size: 0.85rem; color: var(--brun); }
.taille small { font-size: 0.72rem; color: var(--text-muted); }
.taille.vide { opacity: 0.4; }

/* ===== Choix du salarié ===== */
.recherche { position: relative; }
.recherche input { width: 100%; font-size: 1.1rem; }
.suggestions { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; background: #fff; border: 2px solid var(--dore);
  border-top: 0; border-radius: 0 0 10px 10px; max-height: 320px; overflow-y: auto; display: none; }
.suggestions div { padding: 0.65rem 0.9rem; cursor: pointer; border-bottom: 1px solid var(--bordure); }
.suggestions div:hover, .suggestions div.sel { background: #fff6e3; }
.suggestions small { color: var(--text-muted); }
.choisi { display: none; align-items: center; justify-content: space-between; gap: 1rem; background: #fff6e3;
  border: 2px solid var(--dore); border-radius: 10px; padding: 0.7rem 1rem; }
.choisi strong { font-size: 1.1rem; color: var(--brun); }
.onglets { display: flex; gap: 0.5rem; margin-bottom: 0.9rem; }
.onglets button { background: transparent; color: var(--brun); border: 2px solid var(--bordure); }
.onglets button.actif { background: var(--brun); color: var(--beige); border-color: var(--brun); }
.cache { display: none !important; }
.barre-bas { position: sticky; bottom: 0; background: rgba(253, 250, 244, 0.97); border-top: 2px solid var(--dore);
  padding: 0.8rem 1.25rem; margin: 1.5rem -1.25rem -3rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* ===== Signature (mode tablette) ===== */
body.kiosque { background: var(--blanc); }
.kiosque .container { max-width: 900px; }
.doc { background: #fff; border: 1px solid var(--bordure); border-radius: var(--radius); padding: 1.4rem 1.6rem; box-shadow: 0 2px 12px var(--shadow); }
.doc .marque { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-bottom: 2px solid var(--dore); padding-bottom: 0.7rem; margin-bottom: 1rem; }
.doc .marque img { height: 54px; }
.doc .marque .soc { text-align: right; font-size: 0.8rem; color: var(--text-muted); }
.doc .texte p { margin: 0 0 0.6rem; font-size: 1.02rem; }
.doc .texte ul { margin: 0 0 0.6rem; padding-left: 1.3rem; }
.doc .texte li { margin-bottom: 0.25rem; font-size: 1.02rem; }
.zone-sig { margin-top: 1.2rem; }
.cadre-sig { position: relative; border: 2px dashed var(--brun-light); border-radius: 12px; background: #fffdf8; touch-action: none; }
.cadre-sig canvas { display: block; width: 100%; height: 240px; touch-action: none; cursor: crosshair; }
.cadre-sig .indice { position: absolute; left: 1rem; bottom: 0.6rem; color: #c9b9a6; font-size: 0.9rem; pointer-events: none; }
.cadre-sig .ligne { position: absolute; left: 6%; right: 6%; bottom: 52px; border-bottom: 1px solid #e3d6c3; pointer-events: none; }
.merci { text-align: center; padding: 3rem 1rem; }
.merci .coche { width: 92px; height: 92px; border-radius: 50%; background: var(--succes-bg); color: var(--vert); font-size: 3rem;
  display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }

/* ===== Messages ===== */
.messages { margin-bottom: 1.1rem; }
.message { padding: 0.75rem 1.1rem; border-radius: 8px; margin-bottom: 0.5rem; font-size: 0.92rem; border-left: 4px solid transparent; }
.message.success { background: var(--succes-bg); color: var(--succes-text); border-left-color: #34a853; }
.message.error { background: var(--erreur-bg); color: var(--erreur-text); border-left-color: var(--danger); }
.message.warning { background: var(--alerte-bg); color: var(--alerte-text); border-left-color: var(--dore); }

/* ===== Connexion ===== */
.connexion { max-width: 380px; margin: 3rem auto; }
.connexion img { display: block; width: 240px; margin: 0 auto 1.2rem; }
.connexion form { display: flex; flex-direction: column; gap: 0.9rem; }

/* ===== Footer ===== */
.site-footer { background: var(--brun-dark); color: rgba(245, 230, 200, 0.7); padding: 1.1rem 0; margin-top: 2rem; }
.footer-inner { max-width: 1150px; margin: 0 auto; padding: 0 1.25rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; }
.footer-logo { font-family: 'Playfair Display', serif; color: var(--beige); }
.footer-logo .dot { color: var(--dore); }

details.carte summary { cursor: pointer; font-weight: 700; color: var(--brun); }
dl.infos { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; }
dl.infos dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; padding-top: 2px; }
dl.infos dd { margin: 0; }

@media (max-width: 700px) {
  .topbar-inner { flex-direction: column; align-items: flex-start; }
  .logo img { height: 34px; }
  .doc { padding: 1rem; }
  .doc .marque { flex-direction: column; align-items: flex-start; }
  .doc .marque .soc { text-align: left; }
  dl.infos { grid-template-columns: 1fr; }
}
@media print {
  .topbar, .site-footer, .no-print { display: none !important; }
  body { background: #fff; }
}
