/* Cantine Box — charte : rouge #C82F2A, vert #5D7D54, fait maison & avec amour */
:root {
  --red: #C82F2A;
  --red-dark: #A32621;
  --green: #5D7D54;
  --green-light: #E7EDE4;
  --cream: #FAF6EF;
  --ink: #2B2320;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(43, 35, 32, .08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* l'attribut hidden doit toujours gagner, même sur les éléments display:flex/grid */
[hidden] { display: none !important; }

body {
  font-family: 'Poppins', sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}

h1, h2, h3, .order-code {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  line-height: 1.15;
}

h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-bottom: 1rem; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }

img { max-width: 100%; }

/* header */
.site-header {
  background: var(--cream);
  border-bottom: 3px solid var(--green);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: .6rem; padding-bottom: .6rem;
}
.brand img { height: 58px; width: auto; display: block; margin-right: 3vw; }
.main-nav { display: flex; align-items: center; gap: 1.4rem; }
.main-nav a { color: var(--ink); text-decoration: none; font-weight: 500; line-height: 1.3; text-align: center;}
.main-nav a:hover { color: var(--red); }
.nav-toggle {
  display: none; background: none; border: none;
  font-size: 1.6rem; color: var(--red); cursor: pointer;
}

/* buttons */
.btn {
  display: inline-block; padding: .65rem 1.5rem; border-radius: 999px;
  font-weight: 600; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; font-family: inherit; font-size: 1rem;
  transition: transform .12s ease, background .15s ease, color .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:disabled { background: #cbb; cursor: not-allowed; }
.btn-outline { border-color: var(--green); color: var(--green); background: transparent; }
.btn-outline:hover { background: var(--green); color: #fff; }

/* hero */
.hero { padding: 4rem 0 3rem; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.2fr .8fr; gap: 2rem; align-items: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin-bottom: 1rem; }
.accent-red { color: var(--red); }
.accent-green { color: var(--green); }
.hero-text p { font-size: 1.1rem; max-width: 34rem; }
.hero-cta { display: flex; gap: 1rem; margin: 1.5rem 0; flex-wrap: wrap; }
.hero-points { list-style: none; display: flex; gap: 1.5rem; flex-wrap: wrap; font-weight: 500; }
.hero-art { text-align: center; }
.hero-mark { max-height: 320px; animation: float 5s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-3deg);} 50% { transform: translateY(-14px) rotate(3deg);} }

/* how it works */
.how { background: var(--green-light); padding: 3.5rem 0; }
.how h2 { text-align: center; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2rem; }
.how-card {
  background: #fff; border-radius: var(--radius); padding: 1.8rem;
  box-shadow: var(--shadow); text-align: center;
}
.how-num {
  display: inline-flex; width: 44px; height: 44px; border-radius: 50%;
  background: var(--red); color: #fff; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-size: 1.3rem; font-weight: 900; margin-bottom: .8rem;
}
.how-card h3 { margin-bottom: .4rem; color: var(--green); }

/* order section */
.order { padding: 3.5rem 0; }
.order-head { text-align: center; margin-bottom: 2rem; }
.week-label { color: var(--green); font-weight: 600; font-size: 1.1rem; }
.step-title { margin-bottom: 1.2rem; font-size: 1.05rem; }
.step-title .hint { color: #7a6f6a; font-size: .9rem; }

.days-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.day-card {
  background: #fff; border: 2px solid transparent; border-radius: var(--radius);
  padding: 1.1rem; cursor: pointer; display: flex; flex-direction: column; gap: .35rem;
  box-shadow: var(--shadow); transition: border-color .15s ease, transform .15s ease;
  position: relative;
}
.day-card:hover:not(.disabled) { transform: translateY(-3px); }
.day-card input { position: absolute; opacity: 0; }
.day-card.selected { border-color: var(--red); background: #fdf3f2; }
.day-card.selected::after {
  content: "✓"; position: absolute; top: .6rem; inset-inline-end: .8rem;
  color: var(--red); font-weight: 700; font-size: 1.1rem;
}
.day-card.disabled { opacity: .55; cursor: not-allowed; }
.day-head { font-weight: 700; color: var(--green); display: flex; justify-content: space-between; }
.day-head em { font-style: normal; color: #9a908b; font-weight: 500; }
.dish { font-weight: 600; }
.dish-desc { font-size: .85rem; color: #7a6f6a; }
.closed { font-size: .78rem; color: var(--red); font-weight: 600; }

.order-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 1.5rem; gap: 1rem; flex-wrap: wrap;
}
.totals { display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.totals strong { font-size: 1.25rem; color: var(--red); }
.discount-note { color: var(--green); font-weight: 600; }

/* form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.order-form label, .track-form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 500; }
input, select, textarea {
  font-family: inherit; font-size: 1rem; padding: .65rem .9rem;
  border: 2px solid #e4dbd2; border-radius: 12px; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: none; border-color: var(--green); }

.card {
  background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
}
.recap ul { list-style: none; margin: .8rem 0; }
.recap li { padding: .3rem 0; border-bottom: 1px dashed #eee1d8; }
.recap .recap-total { font-size: 1.2rem; color: var(--red); font-weight: 700; }
.form-error { color: var(--red); font-weight: 600; margin-top: 1rem; }

/* done */
.step-done { text-align: center; padding: 2rem 0; }
.done-mark { max-height: 120px; margin-bottom: 1rem; }
.order-code {
  font-size: 2rem; color: var(--red); letter-spacing: .1em; margin: .5rem 0 1rem;
}

/* values */
.values { background: var(--red); color: #fff; padding: 3rem 0; }
.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.values h3 { margin-bottom: .4rem; }

/* tracking */
.track { padding: 4rem 0; min-height: 50vh; }
.track-inner { max-width: 620px; }
.track h1 { margin-bottom: .6rem; }
.track-form { display: flex; gap: .8rem; margin-top: 1.4rem; flex-wrap: wrap; }
.track-form input { flex: 1; min-width: 220px; }
.track-order { margin-top: 1.5rem; }
.status-steps { display: flex; gap: .4rem; margin-top: .8rem; flex-wrap: wrap; }
.status-step {
  padding: .3rem .8rem; border-radius: 999px; font-size: .85rem;
  background: var(--green-light); color: var(--green);
}
.status-step.active { background: var(--green); color: #fff; font-weight: 600; }

/* admin */
.admin { padding: 3rem 0; }
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.admin h2 { margin-top: 2rem; }
.week-nav { display: flex; gap: 1rem; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
.menu-form .menu-row {
  display: grid; grid-template-columns: 140px 1fr 1.2fr 1fr 1.2fr; gap: .8rem; margin-bottom: .8rem; align-items: center;
}
.menu-day { font-weight: 600; color: var(--green); }
.table-wrap { overflow-x: auto; margin-top: 1rem; padding: .5rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: .55rem .7rem; text-align: start; border-bottom: 1px solid #f0e8df; vertical-align: top; }
th { color: var(--green); }

/* footer */
.site-footer { background: var(--green); color: #fff; padding: 2.5rem 0 1rem; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.footer-mark { max-height: 110px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.15)); }
.tagline { font-family: 'Fraunces', serif; font-style: italic; margin-top: .5rem; }
.site-footer h4 { font-family: 'Fraunces', serif; font-size: 1.1rem; margin-bottom: .5rem; }
.copyright { text-align: center; margin-top: 2rem; font-size: .85rem; opacity: .85; }

/* responsive */
@media (max-width: 900px) {
  .days-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .how-grid, .values-grid, .footer-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .main-nav {
    display: none; position: absolute; top: 100%; right: 0; left: 0;
    background: var(--cream); flex-direction: column; padding: 1rem 1.5rem 1.5rem;
    border-bottom: 3px solid var(--green); align-items: flex-start;
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .menu-form .menu-row { grid-template-columns: 1fr; gap: .4rem; }
}
@media (max-width: 540px) {
  .days-grid { grid-template-columns: 1fr; }
  .brand img { height: 46px; }
}

/* ---------- arabe / RTL ---------- */
.lang-switch {
  font-weight: 700;
  color: var(--red) !important;
  border: 2px solid var(--red);
  border-radius: 999px;
  padding: .25rem .9rem;
}
.lang-switch:hover { background: var(--red); color: #fff !important; }

html[dir="rtl"] body,
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] button {
  font-family: 'Tajawal', 'Poppins', sans-serif;
}
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] h4, html[dir="rtl"] .tagline, html[dir="rtl"] .how-num {
  font-family: 'Tajawal', serif;
  font-weight: 800;
}
html[dir="rtl"] .order-code { font-family: 'Fraunces', serif; direction: ltr; }

/* ---------- cartes repas (étape 1) ---------- */
.meals-grid { display: flex; flex-direction: column; gap: 1rem; max-width: 780px; margin: 0 auto; }
.meal-card {
  background: #fff; border: 2px solid transparent; border-radius: var(--radius);
  padding: .8rem; display: flex; flex-direction: row; gap: .9rem; align-items: stretch;
  box-shadow: var(--shadow); transition: border-color .15s ease;
}
.meal-body { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.meal-foot {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: .6rem; margin-top: auto; flex-wrap: wrap;
}
.meal-meta-list {
  display: flex; flex-direction: column; gap: .1rem;
  font-size: .78rem; color: #8a7f79; line-height: 1.45;
}
.meal-card.selected { border-color: var(--red); background: #fdf3f2; }
.meal-card.disabled { opacity: .55; }
.meal-top { display: flex; justify-content: space-between; align-items: baseline; }
.meal-date { font-weight: 700; color: var(--green); }
.meal-price { font-weight: 700; color: var(--red); font-size: 1.05rem; }
.meal-name { font-weight: 600; font-size: 1rem; line-height: 1.3; margin-bottom: .35rem; }
.qty-stepper {
  display: inline-flex; align-items: center; gap: .7rem;
  border: 2px solid var(--green); border-radius: 999px; padding: .1rem .4rem;
}
.qty-btn {
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: var(--green); color: #fff; font-size: 1.2rem; font-weight: 700;
  cursor: pointer; line-height: 1;
}
.qty-btn:hover { background: #4c6845; }
.qty-val { min-width: 1.4rem; text-align: center; font-weight: 700; font-size: 1.05rem; }
.meal-remark { margin-top: .4rem; font-size: .85rem; }
.no-meals { text-align: center; color: #7a6f6a; padding: 2rem 0; }

/* ---------- radio cards, enfants, carte ---------- */
.field-label { font-weight: 600; margin: 1.2rem 0 .5rem; }
.radio-cards { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.radio-cards-col { flex-direction: column; }
.radio-card {
  background: #fff; border: 2px solid #e4dbd2; border-radius: var(--radius);
  padding: .9rem 1.2rem; cursor: pointer; display: flex; flex-direction: column; gap: .3rem;
  flex: 1; min-width: 200px;
}
.radio-card input { position: absolute; opacity: 0; }
.radio-card.selected { border-color: var(--red); background: #fdf3f2; }
.radio-note { font-size: .85rem; color: #7a6f6a; font-weight: 400; }
.child-row {
  display: grid; grid-template-columns: 1fr 1.2fr 1fr auto; gap: .6rem;
  margin-bottom: .6rem; align-items: center;
}
.btn-remove-child {
  border: none; background: #f3e4e3; color: var(--red); width: 34px; height: 34px;
  border-radius: 50%; cursor: pointer; font-weight: 700;
}
.btn-small { padding: .4rem 1rem; font-size: .9rem; }
#map { height: 320px; border-radius: var(--radius); margin: .6rem 0 1rem; box-shadow: var(--shadow); }
.map-help { font-size: .9rem; color: var(--green); font-weight: 500; margin-top: .8rem; }
#precision-field { display: flex; flex-direction: column; gap: .3rem; font-weight: 500; margin-top: .8rem; }
.status-bad { background: #f6dbda !important; color: var(--red) !important; font-weight: 700; }
.track-items { list-style: none; margin: .5rem 0; font-size: .95rem; }
.track-items li { padding: .15rem 0; }

/* ---------- admin ---------- */
.admin-nav {
  display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 2rem;
  border-bottom: 3px solid var(--green); padding-bottom: 1rem;
}
.admin-nav a {
  text-decoration: none; color: var(--ink); font-weight: 600;
  padding: .45rem 1.1rem; border-radius: 999px;
}
.admin-nav a.active { background: var(--green); color: #fff; }
.admin-nav a:hover:not(.active) { background: var(--green-light); }
.admin-logout { margin-inline-start: auto; color: var(--red) !important; }
.input-small { width: 5.5rem; }
.week-range { color: #7a6f6a; font-size: .9rem; }
.week-nav label { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; }
.row-closed { opacity: .55; }
.row-actions { white-space: nowrap; }
.btn-mini {
  border: none; background: none; cursor: pointer; font-size: 1rem; padding: .2rem .3rem;
}
.inline-form { display: inline; }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.meal-form small { color: #9a908b; font-weight: 400; }
.qty-big { font-size: 1.3rem; color: var(--red); }
.status-filter { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.chip {
  text-decoration: none; color: var(--ink); background: #fff; border-radius: 999px;
  padding: .3rem .9rem; font-size: .88rem; font-weight: 500; box-shadow: var(--shadow);
}
.chip-active { background: var(--green); color: #fff; }
.order-card-admin { margin-bottom: .8rem; padding: 0; }
.order-card-admin summary {
  cursor: pointer; padding: 1rem 1.3rem; display: flex; gap: .7rem; align-items: center; flex-wrap: wrap;
}
.order-card-admin summary small { color: #9a908b; margin-inline-start: auto; }
.order-detail { padding: 0 1.3rem 1.2rem; }
.order-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.order-detail h4 { color: var(--green); margin: .6rem 0 .3rem; }
.order-detail ul { list-style: none; }
.order-detail li { padding: .2rem 0; }
.badge {
  padding: .2rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 700; color: #fff;
}
.badge-s0 { background: #4a7fb5; }      /* reçue */
.badge-s1 { background: #d98c26; }      /* en préparation */
.badge-s2 { background: #2a9d8f; }      /* prête */
.badge-s3 { background: #8461ad; }      /* en livraison */
.badge-s4 { background: var(--green); } /* livrée */
.badge-s5 { background: var(--red); }   /* non réponse */
.badge-s6 { background: #a3542a; }      /* retour */
.badge-s7 { background: #8d8680; }      /* annulée */
.login-form { max-width: 420px; display: flex; flex-direction: column; gap: 1rem; margin-top: 1.4rem; }
.login-form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 500; }
.order-detail-grid-2 { grid-template-columns: 2fr 1fr; }
@media (max-width: 900px) { .order-detail-grid-2 { grid-template-columns: 1fr; } }
.treso-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat { display: flex; flex-direction: column; gap: .3rem; padding: 1.1rem 1.3rem; }
.stat span { font-size: .85rem; color: #7a6f6a; }
.stat strong { font-size: 1.3rem; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.save-ok { color: var(--green); font-weight: 600; margin-bottom: 1rem; }
.config-form h2 { font-size: 1.2rem; margin: 1rem 0 .6rem; }

@media (max-width: 900px) {
  .order-detail-grid, .treso-stats, .form-grid-3 { grid-template-columns: 1fr; }
  .child-row { grid-template-columns: 1fr 1fr; }
}

/* ---------- bouton WhatsApp flottant ---------- */
.whatsapp-fab {
  position: fixed; bottom: 1.4rem; inset-inline-end: 1.4rem; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%;
  background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  transition: transform .15s ease;
}
.whatsapp-fab:hover { transform: scale(1.08); }
.step-note { color: var(--green); font-weight: 500; margin-bottom: 1rem; }

/* ---------- galerie photos des repas ---------- */
.meal-gallery {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  width: 128px; min-width: 128px; align-self: center;
  border-radius: 12px; cursor: zoom-in; background: #f2ece4;
}
.gallery-slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .6s ease;
}
.gallery-slide.current { opacity: 1; }
.gallery-dots {
  position: absolute; bottom: .5rem; left: 0; right: 0;
  display: flex; justify-content: center; gap: .35rem; z-index: 2;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255, 255, 255, .55); box-shadow: 0 0 3px rgba(0, 0, 0, .4);
}
.dot.on { background: #fff; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20, 14, 12, .92);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.lightbox[hidden] { display: none; }
.lightbox-img {
  position: absolute; inset: 0; margin: auto;
  max-width: 100%; max-height: 100%; border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5); cursor: pointer;
  transition: transform .38s ease;
}
.lightbox-close {
  position: absolute; top: 1rem; inset-inline-end: 1.2rem;
  background: none; border: none; color: #fff; font-size: 1.8rem; cursor: pointer;
}
.lightbox-dots { display: flex; gap: .45rem; margin-top: 1rem; }
.lightbox-dots .dot { width: 10px; height: 10px; }

/* vignettes photos dans l'admin */
.photo-cell { white-space: nowrap; }
.photo-thumb { position: relative; display: inline-block; margin-inline-end: .3rem; }
.photo-thumb img {
  width: 46px; height: 46px; object-fit: cover; border-radius: 8px; vertical-align: middle;
}
.thumb-btn {
  position: absolute; top: -6px; inset-inline-end: -4px;
  width: 18px; height: 18px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--green); color: #fff; font-size: .6rem; line-height: 1; padding: 0;
}
.thumb-btn.thumb-del { background: var(--red); top: auto; bottom: -6px; }
.toggle-btn { border: none; background: none; cursor: pointer; font-size: 1.1rem; }
.check-label { flex-direction: row !important; align-items: center; gap: .6rem !important; }
.check-label input { width: 1.2rem; height: 1.2rem; }

/* ---------- carrousel des semaines ---------- */
.week-carousel-nav {
  display: flex; align-items: center; justify-content: center; gap: 1.2rem;
  margin-bottom: 1.4rem;
}
.week-carousel-title { text-align: center; min-width: 240px; }
.week-carousel-title strong {
  display: block; font-family: 'Fraunces', serif; font-size: 1.35rem; color: var(--red);
}
html[dir="rtl"] .week-carousel-title strong { font-family: 'Tajawal', serif; }
.week-carousel-title span { color: var(--green); font-weight: 600; font-size: .95rem; }
.week-arrow {
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--green);
  background: #fff; color: var(--green); font-size: 1.5rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  transition: background .15s ease, color .15s ease;
}
.week-arrow:hover { background: var(--green); color: #fff; }
html[dir="rtl"] .week-arrow { transform: scaleX(-1); }

/* meal cards horizontales — mobile */
@media (max-width: 540px) {
  .meal-card { padding: .7rem; gap: .7rem; }
  .meal-gallery { width: 96px; min-width: 96px; }
  .meal-name { font-size: .92rem; }
  .meal-meta-list { font-size: .72rem; }
  .meal-foot { flex-direction: column; align-items: stretch; gap: .4rem; }
  .meal-foot .qty-stepper { align-self: flex-end; }
  .meal-foot .closed { align-self: flex-end; }
}


/* lightbox : flèches et zone image */
.lightbox-stage { position: relative; width: min(88vw, 1100px); height: 82vh; overflow: hidden; }
.lightbox-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.9rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.lightbox-arrow:hover { background: rgba(255, 255, 255, .3); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-dots .dot { cursor: pointer; }

/* admin : blocs photo individuels */
.photo-blocks-wrap { display: flex; flex-direction: column; gap: .5rem; }
.field-title { font-weight: 500; }
.field-title small { color: #9a908b; font-weight: 400; }
.photo-block { display: flex; align-items: center; gap: .5rem; }
.photo-block input[type="file"] { flex: 1; }
#add-photo-block { align-self: flex-start; }

/* ---------- pages éditoriales ---------- */
.content-page { padding: 3rem 0 4rem; }
.content-inner { max-width: 820px; }
.content-title { font-size: clamp(1.9rem, 4.5vw, 2.8rem); color: var(--red); margin-bottom: 2rem; }
.content-section { margin-bottom: 2.5rem; }
.content-section h2 { color: var(--green); font-size: 1.45rem; margin-bottom: .8rem; }
.content-body p { margin-bottom: .8rem; }
.content-body h3 { color: var(--ink); margin: 1rem 0 .4rem; font-size: 1.1rem; }
.content-body ul, .content-body ol { margin: 0 0 .8rem 1.4rem; }
html[dir="rtl"] .content-body ul, html[dir="rtl"] .content-body ol { margin: 0 1.4rem .8rem 0; }
.content-row { display: flex; gap: 1.5rem; align-items: flex-start; }
.content-row .content-body { flex: 1; min-width: 0; }
.content-side-images { display: flex; flex-direction: column; gap: .8rem; width: 240px; flex-shrink: 0; }
.content-side-images img, .content-gallery img {
  width: 100%; border-radius: var(--radius); cursor: zoom-in;
  box-shadow: var(--shadow); display: block;
}
.content-gallery {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem;
}
.content-quote {
  background: var(--green-light); border-inline-start: 5px solid var(--green);
  border-radius: var(--radius); padding: 1.6rem 2rem; margin: 2.5rem 0;
  font-size: 1.08rem; font-style: italic;
}
.content-quote cite { display: block; margin-top: 1rem; font-style: normal; font-weight: 600; color: var(--green); }
.content-cta { display: flex; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; }

/* admin pages */
.section-row { margin-bottom: .8rem; padding: 1rem 1.3rem; }
.section-row-head { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.section-actions { margin-inline-start: auto; display: flex; gap: .2rem; align-items: center; }
.section-actions .btn-mini { text-decoration: none; }
.section-preview { color: #8a7f79; font-size: .88rem; margin-top: .3rem; }
.quill-box { background: #fff; min-height: 130px; border-radius: 0 0 12px 12px; margin-bottom: 1rem; }
.ql-toolbar.ql-snow { border-radius: 12px 12px 0 0; border-color: #e4dbd2; }
.ql-container.ql-snow { border-color: #e4dbd2; border-radius: 0 0 12px 12px; font-size: 1rem; font-family: inherit; }

@media (max-width: 700px) {
  .content-row { flex-direction: column; }
  .content-side-images { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .content-side-images img { width: calc(50% - .4rem); }
  .content-gallery { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Paiement, capacité, saisie admin  (lots 0 à 3)
   ============================================================ */

/* pastilles de paiement — le statut se lit à la couleur */
.pay-badge { font-size: .74rem; }
.pay-en_attente { background: #d98c26; }
.pay-partiel    { background: #4a7fb5; }
.pay-payé       { background: var(--green); }
.pay-remboursé  { background: #8d8680; }
.pay-expiré     { background: var(--red); }
.chip.pay-en_attente, .chip.pay-partiel, .chip.pay-payé,
.chip.pay-remboursé, .chip.pay-expiré { background: #fff; color: var(--ink); }
.chip.pay-en_attente { border-color: #d98c26; }
.chip.pay-partiel { border-color: #4a7fb5; }
.chip.pay-payé { border-color: var(--green); }
.chip.pay-expiré { border-color: var(--red); }
.chip.chip-active { background: var(--green); color: #fff; }

.pay-border-en_attente { border-inline-start: 5px solid #d98c26; }
.pay-border-partiel    { border-inline-start: 5px solid #4a7fb5; }
.pay-border-payé       { border-inline-start: 5px solid var(--green); }
.pay-border-expiré     { border-inline-start: 5px solid var(--red); }
.pay-border-remboursé  { border-inline-start: 5px solid #8d8680; }

.pay-balance { color: var(--red); }
.pay-ok-text { color: var(--green); }
.pay-line { line-height: 1.7; }
.pay-form {
  display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: .5rem 0;
}
.pay-form input[type="number"] { width: 6.5rem; }
.pay-form input[type="date"] { width: 9.5rem; }

/* bandeau chiffres clés */
.kpi-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.kpi {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .9rem 1.3rem; min-width: 11rem; border-top: 4px solid #e4dbd2;
}
.kpi-paid { border-top-color: var(--green); }
.kpi-due { border-top-color: #d98c26; }
.kpi-n { display: block; font-family: 'Fraunces', serif; font-weight: 900; font-size: 1.5rem; }
.kpi-k { display: block; font-size: .82rem; color: #8a7f79; }

.src-tag {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .05em;
  background: var(--green-light); color: var(--green); padding: .1rem .4rem;
  border-radius: 6px; margin-inline-start: .3rem;
}

.search-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .8rem; }
.search-form input { padding: .5rem .8rem; border: 2px solid #e4dbd2; border-radius: 999px; font: inherit; }

/* capacité */
.capacity-cell .cap-ok { color: var(--green); font-weight: 600; }
.capacity-cell .cap-full { color: var(--red); font-weight: 700; }
.sold-out { color: var(--red); font-weight: 700; }
.meal-left { color: #d98c26; font-size: .85rem; font-weight: 600; margin-top: .2rem; }

/* listes nominatives cuisine / livraison */
.school-block { margin-top: 1.2rem; }
.school-block h4 { margin-bottom: .4rem; }
.day-meals { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .8rem; }
.day-meal {
  background: var(--green-light); border-radius: 999px; padding: .25rem .8rem; font-size: .9rem;
}

/* matrices repas × enfants (saisie admin + répartition client) */
.meal-matrix, .assign-matrix { width: 100%; border-collapse: collapse; font-size: .93rem; }
.meal-matrix th, .meal-matrix td,
.assign-matrix th, .assign-matrix td {
  padding: .45rem .6rem; border-bottom: 1px solid #efe7dd; text-align: start; vertical-align: middle;
}
.meal-matrix thead th, .assign-matrix thead th { background: var(--cream); font-size: .8rem; }
.matrix-week td { background: var(--green-light); font-weight: 600; }
.qty-cell, .assign-cell { width: 4.2rem; padding: .35rem; text-align: center; }
.remark-cell { width: 100%; min-width: 8rem; }
.qty-input { width: 4.5rem; }
.flag {
  font-size: .7rem; padding: .1rem .4rem; border-radius: 6px; margin-inline-start: .3rem;
  white-space: nowrap;
}
.flag-late { background: #fbe7cc; color: #8a5a12; }
.flag-full { background: #f8d9d7; color: var(--red-dark); }
.assign-ok { color: var(--green); font-weight: 600; }
.assign-todo { color: var(--red); font-weight: 600; }
.children-admin .child-row { margin-bottom: .5rem; }

/* consignes de prépaiement (écran de confirmation) */
.pay-instructions {
  background: var(--green-light); border-radius: var(--radius);
  padding: 1.2rem 1.5rem; margin: 1.5rem auto; max-width: 34rem; text-align: start;
}
.pay-instructions h4 { margin-bottom: .4rem; }
.bank-details { font-weight: 600; margin-top: .5rem; }
.pay-due { color: var(--red-dark); font-weight: 600; margin-top: .5rem; }
.track-pay { margin: .4rem 0; }

@media (max-width: 700px) {
  .kpi-row .kpi { flex: 1 1 100%; }
  .pay-form { flex-direction: column; align-items: stretch; }
}

/* feuille imprimable : cuisine et tournée */
@media print {
  .admin-nav, .status-filter, .search-form, .order-bar, .site-header,
  .site-footer, .whatsapp-fab, .order-card-admin { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  .school-block { break-inside: avoid; }
}

/* ============================================================
   Espace client (lot 4)
   ============================================================ */
.espace-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.espace-head h1 { margin-inline-end: auto; }
.espace-phone { color: #8a7f79; margin-bottom: 1rem; }
.espace-note { color: #8a7f79; font-size: .9rem; margin-bottom: 1rem; }
.espace-login { max-width: 30rem; }
.espace-order-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.espace-order-head h3 { margin-inline-end: auto; }
.espace-money { margin-top: .6rem; }
.credit-box {
  background: var(--green-light); border-inline-start: 5px solid var(--green);
  border-radius: var(--radius); padding: 1rem 1.3rem; margin-bottom: 1.5rem;
}
.credit-box p { margin: .2rem 0 0; font-size: .92rem; }
.track-items li {
  display: flex; gap: .8rem; align-items: baseline; flex-wrap: wrap;
  padding: .35rem 0; border-bottom: 1px solid #f1eae1;
}
.track-items .line-main { flex: 1 1 60%; }
.line-cancelled { opacity: .55; text-decoration: line-through; }
.line-cancelled .line-flag, .line-flag {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
  background: #f1eae1; color: #8a7f79; padding: .1rem .45rem; border-radius: 6px;
  text-decoration: none; white-space: nowrap;
}
.line-flag.muted { background: transparent; }
.link-box { margin-bottom: 1.2rem; }
.link-input {
  width: 100%; padding: .6rem .9rem; border: 2px solid var(--green);
  border-radius: 12px; font: inherit; font-size: .9rem; background: #fff;
}
.pay-credit { color: var(--green); font-weight: 600; margin-top: .4rem; }

/* messages (lot 5) */
.msg-card { margin-bottom: .9rem; }
.msg-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .5rem; }
.msg-head small { color: #8a7f79; }
.msg-whatsapp { background: #2a9d8f; }
.msg-email { background: #4a7fb5; }
.msg-body {
  background: var(--cream); border-radius: 12px; padding: .8rem 1rem; font-size: .9rem;
  white-space: pre-wrap; font-family: inherit; margin: 0 0 .6rem; max-height: 14rem; overflow-y: auto;
}
.msg-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.msg-done { opacity: .5; }
.nav-badge {
  background: var(--red); color: #fff; border-radius: 999px; padding: 0 .4rem;
  font-size: .75rem; font-weight: 700;
}

/* exports (lot 6) */
.export-links { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .5rem; }

/* formules (lot 7) */
.packs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.pack-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.3rem; border: 2px solid transparent; display: flex; flex-direction: column; gap: .35rem;
}
.pack-card.selected { border-color: var(--green); }
.pack-kind {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--green);
  background: var(--green-light); border-radius: 999px; padding: .1rem .6rem; align-self: flex-start;
}
.pack-price { font-family: 'Fraunces', serif; font-weight: 900; font-size: 1.8rem; }
.pack-meta { font-size: .9rem; color: #8a7f79; }
.pack-unit { font-size: .85rem; color: var(--green); font-weight: 600; }
.pack-desc { font-size: .9rem; }
.pack-card .btn { margin-top: auto; align-self: flex-start; }
.packs-mine { display: grid; gap: .6rem; margin-bottom: 1.5rem; }
.pack-mini {
  background: var(--green-light); border-radius: 12px; padding: .7rem 1rem;
  display: flex; gap: .8rem; align-items: baseline; flex-wrap: wrap;
}
.pack-mini .pack-left { font-weight: 700; color: var(--green); margin-inline-start: auto; }
.pack-off { background: #f1eae1; opacity: .8; }
.pack-off .pack-left { color: #8a7f79; }

/* ---------- tableaux récapitulatifs (planning) ---------- */
.plan-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: .8rem; flex-wrap: wrap; margin: 1.2rem 0 .4rem;
}
.plan-week { font-family: 'Fraunces', serif; font-size: 1.1rem; color: var(--green); }
.plan-jump { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .8rem; }
.plan-jump input { padding: .4rem .6rem; }
.plan-filters { flex-wrap: wrap; align-items: center; }
.plan-views { display: flex; gap: .4rem; }
.plan-account { margin: .6rem 0; color: var(--green); }
.plan-legend { font-size: .85rem; color: #8a7f79; margin: .6rem 0; display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; }
.plan-legend .lg { width: 14px; height: 14px; border-radius: 4px; display: inline-block; margin-inline-end: .2rem; vertical-align: -2px; }
.lg-vide { background: #ece7e2; }
.lg-payé { background: var(--green); }
.lg-impayé { background: var(--red); }
.lg-annulé { background: #b9b2ab; }

.plan-grid { width: 100%; border-collapse: separate; border-spacing: 4px; }
.plan-grid th, .plan-grid td { vertical-align: top; text-align: start; }
.plan-grid thead th {
  font-size: .8rem; color: var(--green); font-weight: 700; padding: .3rem .4rem; white-space: nowrap;
}
.plan-grid thead th small { display: block; font-weight: 500; color: #8a7f79; font-size: .72rem; }
.plan-grid thead th.col-current { background: var(--green-light); border-radius: 8px; }
.plan-head-day { min-width: 150px; }
.plan-day {
  min-width: 150px; background: #fff; border-radius: 10px; padding: .5rem .6rem;
  box-shadow: var(--shadow); font-size: .85rem;
}
.plan-date { display: block; font-weight: 700; color: var(--green); }
.plan-price { display: block; color: #8a7f79; font-size: .72rem; margin-top: .2rem; }
.plan-meal { display: flex; align-items: center; gap: .35rem; margin-top: .25rem; cursor: help; }
.plan-meal img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; flex: none; }
.plan-noimg { width: 34px; height: 34px; border-radius: 8px; background: var(--green-light); display: flex; align-items: center; justify-content: center; flex: none; }
.plan-meal-name { font-size: .78rem; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.plan-meal.meal-off { opacity: .5; }

.plan-cell {
  background: #ece7e2; border-radius: 10px; padding: .45rem .5rem; min-width: 130px;
  font-size: .8rem; border: 2px solid transparent;
}
.plan-cell.cell-payé { background: var(--green-light); border-color: var(--green); }
.plan-cell.cell-impayé { background: #fbeceb; border-color: var(--red); }
.plan-cell.cell-annulé { background: #f1eae1; }
.plan-cell.plan-out { opacity: .45; }
.plan-cell.plan-today { box-shadow: 0 0 0 2px #d98c26; }
.plan-cell-date { display: block; font-size: .7rem; color: #8a7f79; font-weight: 700; }
.plan-tag { display: inline-block; border-radius: 999px; padding: .1rem .5rem; font-weight: 700; font-size: .75rem; color: #fff; }
.tag-payé { background: var(--green); }
.tag-impayé { background: var(--red); }
.tag-annulé { background: #b9b2ab; }
.plan-code { display: block; color: #8a7f79; font-size: .7rem; letter-spacing: .04em; }
.plan-cancel { margin-top: .3rem; }
.plan-pick { display: flex; align-items: center; gap: .35rem; cursor: pointer; font-weight: 600; color: var(--green); }
.plan-pick input { width: 18px; height: 18px; accent-color: var(--green); }
.plan-bar { display: flex; justify-content: flex-end; margin-top: 1rem; }

.plan-kids { list-style: none; margin: .3rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.plan-kids li {
  border-radius: 6px; padding: .1rem .35rem; font-size: .75rem; cursor: help;
  border-inline-start: 3px solid transparent; background: #fff;
}
.kid-payé { border-inline-start-color: var(--green); color: var(--green); font-weight: 600; }
.kid-impayé { border-inline-start-color: var(--red); color: var(--red); font-weight: 600; }
.kid-annulé { color: #b9b2ab; text-decoration: line-through; }
.plan-scroll { max-height: 78vh; overflow: auto; }
.plan-admin .plan-day, .plan-admin .plan-head-day {
  position: sticky; inset-inline-start: 0; z-index: 2; background: #fff;
}
.plan-admin thead th { position: sticky; top: 0; z-index: 3; background: #fdfbf9; }
.plan-admin thead th.plan-head-day { z-index: 4; }

/* ---------- comptes école & facture mensuelle ---------- */
.school-grid .school-qty {
  width: 5.5rem; padding: .35rem .5rem; border: 2px solid var(--green);
  border-radius: 10px; font: inherit; font-weight: 700; text-align: center;
}
.school-grid .school-qty:disabled { border-color: #e4dbd2; color: #8a7f79; background: #f6f1ec; }
.school-grid td.num, .school-grid th.num { text-align: end; }
.force-late { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: #8a7f79; margin-inline-end: auto; }
.admin-form { padding: 1.2rem; margin-bottom: 1.5rem; }
.admin-form .form-grid { gap: .8rem; }
.check-line { display: flex; align-items: center; gap: .4rem; margin: .8rem 0; }
.pay-form { display: inline-flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.pay-form input[type="number"] { width: 6.5rem; }
.pay-form input, .pay-form select { padding: .3rem .5rem; border: 1px solid #e4dbd2; border-radius: 8px; font: inherit; font-size: .85rem; }
td.num, th.num { text-align: end; white-space: nowrap; }
.muted { color: #8a7f79; }

/* ---------- profil du compte ---------- */
.espace-menu { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.child-del { display: flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--red); white-space: nowrap; }
.espace-login .form-grid { margin-bottom: 1rem; }

/* raccourci vers la saisie en masse d'une école */
.school-shortcut { padding: 1.2rem; margin-bottom: 1.5rem; border-inline-start: 5px solid var(--green); }
.school-links { display: flex; gap: .5rem; flex-wrap: wrap; margin: .6rem 0; }
