/* CACI — charte graphique. Vert profond (confiance) + ambre (énergie commerçante). */
:root {
  --teal: #0F766E; --teal-dark: #115E59; --teal-bg: #E7F3F1;
  --amber: #F59E0B; --ink: #0F172A; --muted: #64748B;
  --bg: #F6F8F8; --card: #fff; --line: #E2E8F0; --danger: #DC2626;
  --radius: 14px; --shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 16px;
}
a { color: var(--teal); text-decoration: none; }
h1 { font-size: 26px; margin: 0; } h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.muted { color: var(--muted); } .center { text-align: center; }
.error { color: var(--danger); font-weight: 600; }

/* ---- barre du haut ---- */
.topbar {
  display: flex; align-items: center; gap: 18px; padding: 10px 18px;
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800;
         font-size: 20px; letter-spacing: 1px; color: var(--teal-dark); }
.brand img { width: 30px; height: 30px; }
.brand.center { justify-content: center; width: 100%; margin-bottom: 8px; }
.mainnav { display: flex; gap: 4px; flex-wrap: wrap; }
.mainnav a { padding: 8px 13px; border-radius: 9px; color: var(--ink); font-weight: 600; font-size: 15px; }
.mainnav a:hover { background: var(--teal-bg); color: var(--teal-dark); }
.topright { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; }
.langsel, .shopsel {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; font-size: 14px; color: var(--ink);
}

/* ---- boutons ---- */
.btn { display: inline-block; border: none; cursor: pointer; font-weight: 700;
       border-radius: 10px; padding: 9px 16px; font-size: 15px; text-align: center; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-primary:disabled { background: #9CB8B5; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--teal-dark); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--teal-bg); }
.btn-lg { padding: 13px 24px; font-size: 17px; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { display: block; width: 100%; }
.danger { color: var(--danger); }

/* ---- mise en page ---- */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 18px 60px; }
.pagehead { display: flex; align-items: center; justify-content: space-between;
            gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.pagehead-actions { display: flex; gap: 10px; align-items: center; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 18px; border: 1px solid var(--line); }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 800px) { .cols2 { grid-template-columns: 1fr; } }

/* ---- stats ---- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 700px) { .stats { grid-template-columns: 1fr; } }
.stat { background: linear-gradient(135deg, var(--teal), var(--teal-dark)); color: #fff;
        border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 13px; opacity: .85; } .stat-val { font-size: 27px; font-weight: 800; }

/* ---- tableaux ---- */
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: start; color: var(--muted); font-size: 12.5px; text-transform: uppercase;
     letter-spacing: .4px; padding: 6px 8px; border-bottom: 2px solid var(--line); }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }
.alert-row td { background: #FEF3E7; }
.rowactions { white-space: nowrap; text-align: end; }
.pthumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; display: inline-flex; }
.pthumb-txt { background: var(--teal-bg); color: var(--teal-dark); font-weight: 800;
              align-items: center; justify-content: center; font-size: 16px; }

/* ---- formulaires ---- */
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 12px; color: var(--ink); }
input, select { width: 100%; margin-top: 5px; padding: 11px 12px; font-size: 16px;
                border: 1px solid var(--line); border-radius: 10px; background: #fff; }
input:focus, select:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
.formcard { max-width: 560px; }
.formrow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.formactions { display: flex; gap: 10px; margin-top: 6px; }
.stackform { margin-top: 10px; }

/* ---- auth ---- */
.authpage { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.authcard { background: #fff; border-radius: 18px; box-shadow: 0 8px 40px rgba(15, 23, 42, .1);
            padding: 34px 30px; width: 100%; max-width: 420px; }
.authcard h1 { text-align: center; margin-bottom: 18px; font-size: 22px; }
.authalt { text-align: center; margin-top: 14px; font-size: 14.5px; }

/* ---- vitrine ---- */
.landing { max-width: 1080px; margin: 0 auto; padding: 18px; }
.landing-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 30px; }
.hero { text-align: center; padding: 50px 10px 40px; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.15; max-width: 820px; margin: 0 auto;
           color: var(--teal-dark); }
.hero p { font-size: 18px; color: var(--muted); max-width: 660px; margin: 18px auto 30px; line-height: 1.55; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding: 30px 0 50px; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.feature { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
           padding: 22px; box-shadow: var(--shadow); }
.feature .fico { font-size: 30px; margin-bottom: 10px; }
.feature h3 { margin: 0 0 8px; color: var(--teal-dark); text-transform: none; font-size: 17px; letter-spacing: 0; }
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.landing-foot { text-align: center; color: var(--muted); font-size: 13.5px; padding: 20px 0 40px; }
.how { padding: 20px 0 40px; text-align: center; }
.how h2 { font-size: 28px; color: var(--teal-dark); margin-bottom: 24px; }
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; text-align: start; }
@media (max-width: 800px) { .how-steps { grid-template-columns: 1fr; } }
.how-step { background: var(--teal-bg); border-radius: var(--radius); padding: 22px; }
.how-step h3 { margin: 0 0 8px; color: var(--teal-dark); text-transform: none; font-size: 17px; letter-spacing: 0; }
.how-step p { margin: 0; color: #33534F; font-size: 14.5px; line-height: 1.5; }
.how-step .fico { font-size: 28px; margin-bottom: 8px; }
.cta-final { text-align: center; background: linear-gradient(135deg, var(--teal), var(--teal-dark));
             border-radius: 18px; padding: 44px 20px; margin: 10px 0 30px; color: #fff; }
.cta-final h2 { font-size: 26px; margin-bottom: 8px; }
.cta-final .freebadge { color: #FCD34D; font-weight: 700; margin: 0 0 18px; }
.cta-final .btn-primary { background: #fff; color: var(--teal-dark); }

/* ---- caisse (POS) ---- */
.pos-main { display: grid; grid-template-columns: 1fr 340px; gap: 0;
            height: calc(100vh - 55px); }
.pos-left { padding: 14px; overflow-y: auto; }
.pos-tools { display: flex; gap: 10px; margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.pos-tools input[type=search] { flex: 1; min-width: 160px; margin-top: 0; }
.shopname { font-weight: 700; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px;
         cursor: pointer; text-align: center; user-select: none; box-shadow: var(--shadow);
         transition: transform .06s; }
.pcard:active { transform: scale(.96); }
.pcard img, .pcard .pph { width: 100%; height: 74px; object-fit: cover; border-radius: 9px;
                          background: var(--teal-bg); display: flex; align-items: center;
                          justify-content: center; font-size: 30px; font-weight: 800; color: var(--teal-dark); }
.pcard .pname { font-weight: 600; font-size: 13.5px; margin: 7px 0 3px; line-height: 1.2;
                min-height: 2.4em; overflow: hidden; }
.pcard .pprice { color: var(--teal-dark); font-weight: 800; font-size: 14px; }
.pcard.out { opacity: .45; }
.pcard .pstock { font-size: 11px; color: var(--muted); }
.pcard .pstock.low { color: var(--danger); font-weight: 700; }

.pos-cart { background: #fff; border-inline-start: 1px solid var(--line); padding: 16px;
            display: flex; flex-direction: column; overflow-y: auto; }
.cartlines { flex: 1; overflow-y: auto; }
.cline { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.cline .cname { flex: 1; font-size: 14px; font-weight: 600; }
.cline .cqty { display: flex; align-items: center; gap: 6px; }
.cline button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line);
                background: #fff; font-size: 16px; cursor: pointer; font-weight: 700; }
.cline .camt { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.cart-totals { border-top: 2px solid var(--line); padding-top: 10px; margin-top: 8px; }
.tl { display: flex; justify-content: space-between; font-size: 14px; padding: 2px 0; }
.tl.total { font-size: 21px; font-weight: 800; color: var(--teal-dark); padding: 6px 0; }
.customer-sel { width: 100%; margin-top: 10px; }
.paybtns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 10px 0; }
.paybtn { border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 4px;
          font-size: 12.5px; font-weight: 700; cursor: pointer; }
.paybtn.selected { border-color: var(--amber); background: #FEF3E7; }

@media (max-width: 860px) {
  .pos-main { grid-template-columns: 1fr; height: auto; }
  .pos-cart { border-inline-start: none; border-top: 1px solid var(--line);
              position: sticky; bottom: 0; max-height: 46vh; }
}

/* ---- scan & hors-ligne ---- */
.offline-badge { background: #FEF3E7; color: #B45309; border: 1px solid var(--amber);
                 padding: 5px 10px; border-radius: 9px; font-size: 13px; font-weight: 700; }
.pending { font-size: 13px; text-align: center; padding-top: 6px; }
.scanoverlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .92); z-index: 100;
               display: flex; align-items: center; justify-content: center; }
.scanoverlay[hidden] { display: none; }
.scanoverlay video { width: min(92vw, 560px); border-radius: 14px; }
.scanoverlay button { position: absolute; top: 18px; inset-inline-end: 18px; }

/* ---- commandes en ligne ---- */
.orders-banner { display: block; background: #FEF3E7; border: 2px solid var(--amber);
                 color: #92400E; font-weight: 700; border-radius: var(--radius);
                 padding: 13px 18px; margin-bottom: 18px; }
.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
            gap: 12px; margin: 16px 0 20px; }
.pub-card { background: #fff; border: 1px solid var(--line); border-radius: 12px;
            padding: 12px; text-align: center; box-shadow: var(--shadow); }
.pub-card img, .pub-card .pph { width: 100%; height: 90px; object-fit: cover; border-radius: 9px;
            background: var(--teal-bg); display: flex; align-items: center; justify-content: center;
            font-size: 34px; font-weight: 800; color: var(--teal-dark); }
.pub-name { font-weight: 700; font-size: 14.5px; margin: 8px 0 3px; }
.pub-price { color: var(--teal-dark); font-weight: 800; }
.pub-stock { font-size: 12.5px; margin: 4px 0 8px; }
.pub-stock.ok { color: #15803D; } .pub-stock.ko { color: var(--danger); }
.pub-qty { display: flex; align-items: center; justify-content: center; gap: 12px; }
.pub-qty button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
                  background: #fff; font-size: 18px; font-weight: 700; cursor: pointer; }
.pub-qty b { min-width: 20px; }
.orderbox { position: sticky; bottom: 10px; box-shadow: 0 6px 30px rgba(15,23,42,.18); }
.status-badge { display: inline-block; padding: 7px 12px; border-radius: 9px;
                font-size: 13.5px; font-weight: 700; }
.st-pending { background: #FEF3E7; color: #92400E; }
.st-confirmed { background: #E0F2FE; color: #075985; }
.st-delivered { background: #DCFCE7; color: #166534; }
.st-cancelled { background: #FEE2E2; color: #991B1B; }
.orderlist { display: flex; flex-direction: column; gap: 14px; }
.orderhead { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
             align-items: flex-start; margin-bottom: 8px; }
.orderactions { display: flex; gap: 8px; flex-wrap: wrap; }
.orderactions form { display: inline; }
.sharebox { display: flex; gap: 12px; align-items: center; font-size: 13.5px;
            word-break: break-all; }
.shopqr { width: 74px; height: 74px; flex-shrink: 0; }

/* ---- boutiques ---- */
.shopgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.cashierlist { margin: 4px 0; padding-inline-start: 4px; list-style: none; }
.cashierlist li { padding: 3px 0; }
details summary { list-style: none; cursor: pointer; display: inline-block; margin-top: 8px; }
.newshop { border: 2px dashed var(--line); box-shadow: none; }
