/* Atelier Solutions — palette 8 Cardinaux, mobile-first, touch >= 44 px, WCAG AA */
:root {
  --brun: #8a5943;
  --orange: #f3a260;
  --bleu: #a8c0d9;
  --creme: #fee3b3;
  --noir: #1b1b1b;
  --vert: #3b8c63;
  --vert-clair: #81c783;
  --rouge: #e57373;
  --fond: #fdf6e9;
  --carte: #ffffff;
  --ombre: 0 1px 4px rgba(27, 27, 27, .12);
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--fond);
  color: var(--noir);
  font-size: 16px;
  line-height: 1.45;
  padding-bottom: 84px; /* place pour la nav basse */
}

/* ---------- structure ---------- */
header.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--noir); color: var(--creme);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
}
header.topbar h1 { font-size: 17px; margin: 0; flex: 1; font-weight: 700; }
header.topbar .sub { font-size: 12px; opacity: .75; display: block; font-weight: 400; }
button.icon {
  background: none; border: none; color: var(--creme);
  font-size: 20px; min-width: 44px; min-height: 44px; cursor: pointer;
}

main { padding: 14px; max-width: 720px; margin: 0 auto; }

nav.bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: var(--noir);
  display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
nav.bottom a {
  color: var(--creme); text-decoration: none; text-align: center;
  font-size: 11px; min-width: 64px; min-height: 48px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 10px; opacity: .75;
}
nav.bottom a.active { opacity: 1; background: rgba(254, 227, 179, .14); }
nav.bottom a .ico { font-size: 20px; line-height: 1.1; }

/* ---------- composants ---------- */
.card {
  background: var(--carte); border-radius: var(--radius);
  box-shadow: var(--ombre); padding: 14px; margin-bottom: 12px;
}
.card.tap { cursor: pointer; }
.card.tap:active { transform: scale(.99); }

h2.section {
  font-size: 14px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--brun); margin: 18px 2px 8px;
  display: flex; align-items: center; gap: 8px;
}
.badge {
  display: inline-block; min-width: 22px; text-align: center;
  padding: 1px 7px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--noir); color: var(--creme);
}

.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; color: var(--noir);
}
.st-recue { background: var(--bleu); }
.st-a_preparer { background: var(--orange); }
.st-attente_manucure { background: var(--brun); color: #fff; }
.st-prete { background: var(--vert-clair); }
.st-expediee { background: var(--vert); color: #fff; }
.st-annulee { background: var(--rouge); color: #fff; }

.row { display: flex; align-items: center; gap: 10px; }
.row .grow { flex: 1; }
.muted { color: #6b6b6b; font-size: 13.5px; }
.small { font-size: 13px; }

/* boutons */
button.btn {
  display: block; width: 100%;
  min-height: 52px; border: none; border-radius: var(--radius);
  font-size: 17px; font-weight: 700; cursor: pointer;
  background: var(--vert); color: #fff; margin-top: 10px;
}
button.btn:disabled { opacity: .45; }
button.btn.secondary { background: #efe6d4; color: var(--noir); }
button.btn.warn { background: var(--orange); color: var(--noir); }
button.btn.danger { background: var(--rouge); }
button.btn.ghost { background: none; border: 2px solid var(--noir); color: var(--noir); }
button.mini {
  min-height: 44px; border: none; border-radius: 10px; padding: 0 14px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  background: #efe6d4; color: var(--noir);
}

/* formulaires */
label.field { display: block; margin: 12px 0 4px; font-weight: 600; font-size: 14px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="url"], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: 1.5px solid #d8cdb6; border-radius: 10px;
  font-size: 16px; background: #fff; color: var(--noir);
}
textarea { min-height: 80px; }

/* cases obligations */
.oblig { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px dashed #e3d9c4; }
.oblig:last-child { border-bottom: none; }
.oblig input[type="checkbox"] { width: 28px; height: 28px; accent-color: var(--vert); flex: none; }
.oblig .lab { flex: 1; font-weight: 600; }
.ok { color: var(--vert); font-weight: 700; }
.ko { color: var(--rouge); font-weight: 700; }

/* toast */
#toast {
  position: fixed; left: 12px; right: 12px; bottom: 96px; z-index: 60;
  background: var(--noir); color: #fff; padding: 14px 16px;
  border-radius: var(--radius); font-weight: 600;
  transform: translateY(20px); opacity: 0; pointer-events: none;
  transition: all .25s; white-space: pre-line;
}
#toast.show { transform: none; opacity: 1; }
#toast.err { background: var(--rouge); color: #fff; }
#toast.okk { background: var(--vert); }

/* modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(27, 27, 27, .55); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--fond); width: 100%; max-width: 720px;
  border-radius: 16px 16px 0 0; padding: 16px; max-height: 82vh; overflow: auto;
}

/* login */
.login-wrap { max-width: 380px; margin: 8vh auto; padding: 0 18px; }
.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo .big { font-size: 26px; font-weight: 800; letter-spacing: .02em; }
.login-logo .tag { color: var(--brun); font-size: 13px; margin-top: 8px; }
.banner-panel { background: var(--noir); border-radius: 14px; padding: 16px 14px; }
.banner-panel img { width: 100%; height: auto; display: block; }

.role-btn {
  display: block; width: 100%; min-height: 64px; margin-top: 12px;
  font-size: 19px; font-weight: 800; border: none; border-radius: var(--radius);
  cursor: pointer; color: var(--noir);
}

/* lignes de commande */
.item-line { padding: 10px 0; border-bottom: 1px dashed #e3d9c4; }
.item-line:last-child { border-bottom: none; }
.lot-tag {
  display: inline-block; background: var(--creme); border: 1.5px solid var(--brun);
  color: var(--noir); border-radius: 8px; padding: 2px 8px; font-weight: 700; font-size: 13px;
}

/* ---------- FICHE A4 (visible à l'écran ET à l'impression) ---------- */
.print-only { display: none; }

.fiche {
  background: #fff; border-radius: 12px; box-shadow: var(--ombre);
  padding: 18px; color: #000;
}
.fiche h1 { font-size: 20pt; margin: 0 0 2mm; }
.fiche .head { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 3mm; margin-bottom: 4mm; gap: 8mm; }
.fiche table { width: 100%; border-collapse: collapse; margin: 4mm 0; }
.fiche th, .fiche td { border: 1px solid #000; padding: 2.5mm; text-align: left; font-size: 11pt; }
.fiche th { background: #eee; }
.fiche .lot-cell { font-weight: 800; font-size: 12pt; }
.fiche .checks { display: flex; gap: 4mm; margin-top: 6mm; flex-wrap: wrap; }
.fiche .check {
  flex: 1; min-width: 130px; border: 2px solid #000; border-radius: 3mm; padding: 4mm 3mm; text-align: center;
  font-weight: 700; font-size: 10.5pt;
}
.fiche .check .box {
  display: block; width: 10mm; height: 10mm; border: 2.5px solid #000;
  margin: 0 auto 2mm; border-radius: 2mm;
}
.fiche .notes { border: 1px dashed #000; border-radius: 3mm; min-height: 22mm; padding: 3mm; margin-top: 5mm; }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; padding: 0; font-size: 12pt; }
  header.topbar, nav.bottom, .no-print, #toast { display: none !important; }
  main { max-width: none; padding: 0; }
  .print-only { display: block; }
  .fiche {
    page-break-after: always;
    box-shadow: none; border-radius: 0; padding: 0;
  }
}
