/* BAZO GROUP — feuille de style (admin + site public) */
:root {
  --navy: #0f2a4a;
  --navy-2: #173b63;
  --orange: #f28c1c;
  --orange-d: #d9740a;
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #16202c;
  --muted: #667085;
  --line: #e4e7ec;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --err: #b42318;
  --err-bg: #fef3f2;
  --wa: #1fa855;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); line-height: 1.5; font-size: 15px; }
a { color: var(--navy-2); }
h1 { font-size: 1.6rem; margin: .2em 0 .5em; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 0 0 .7em; }
h3 { font-size: 1rem; margin: 1em 0 .5em; }
img { max-width: 100%; }
code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.r { text-align: right; }
.due { color: var(--err); font-weight: 600; }
.ok { color: var(--ok); font-weight: 600; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--navy); color: #fff; border: 0; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--navy-2); }
.btn-light { background: #fff; color: var(--navy); border: 1px solid #cfd6e0; }
.btn-light:hover { background: #f2f5f9; }
.btn-orange { background: var(--orange); }
.btn-orange:hover { background: var(--orange-d); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: #178a45; }
.btn-danger { background: var(--err); }
.btn-sm { padding: 6px 10px; font-size: .85rem; border-radius: 8px; }
.btn-big { padding: 14px 20px; font-size: 1.02rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Admin : barre du haut ---------- */
.topbar { background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-weight: 800; letter-spacing: .3px; display: inline-flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.logo-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--orange); color: #fff; font-weight: 900; font-size: .85rem; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: #d6e2f0; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: .92rem; }
.nav a:hover, .nav a.on { background: rgba(255,255,255,.12); color: #fff; }
.menu-btn { display: none; background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; font-size: 1.2rem; border-radius: 8px; padding: 4px 10px; }
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; padding-top: 8px; }
  .nav-open .nav { display: flex; }
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 18px 16px 60px; }
.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.danger { border-color: #f4c7c3; }
details.card > summary { cursor: pointer; }
details > summary { cursor: pointer; color: var(--navy-2); margin: 8px 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.page-head > div:last-child { display: flex; gap: 8px; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

/* ---------- Messages ---------- */
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; }
.flash-ok { background: var(--ok-bg); color: var(--ok); border-color: #abefc6; }
.flash-err { background: var(--err-bg); color: var(--err); border-color: #fecdca; }

/* ---------- Formulaires ---------- */
.form label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
input, select, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #cfd6e0; border-radius: 9px; background: #fff; color: var(--text); margin-top: 4px; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(242,140,28,.45); border-color: var(--orange); }
input[type=checkbox], input[type=radio] { width: auto; margin: 0 6px 0 0; }
.form label.check, label.check { display: flex; align-items: center; font-weight: 500; margin: 6px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; align-items: end; }
.grid3 .end { padding-bottom: 12px; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 2px 0; }
form.inline input, form.inline select { margin: 0; padding: 6px 8px; width: auto; }
input.sm { max-width: 170px; }
.inline-form { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.inline-form label { flex: 1; margin-bottom: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; flex: 1 1 160px; margin: 0; }
.filters label { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.filters label input { flex: none; }
.chip { padding: 6px 12px; border-radius: 99px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: .9rem; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }

.seg { display: flex; gap: 10px; flex-wrap: wrap; }
.seg-opt { flex: 1 1 180px; border: 2px solid var(--line); border-radius: 12px; padding: 14px; font-weight: 700; font-size: 1.05rem; cursor: pointer; display: flex; align-items: center; }
.seg-opt:has(input:checked) { border-color: var(--orange); background: #fff7ed; }

/* Lignes de facturation */
.ligne { display: grid; grid-template-columns: 1.4fr 2fr 1fr 1.4fr auto auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.ligne input, .ligne select { margin: 0; }
.dims { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.qte-wrap { display: flex; align-items: center; gap: 6px; font-weight: 600; margin: 0 !important; }
.qte-wrap .l-unite { order: 2; color: var(--muted); font-size: .85rem; min-width: 34px; }
.l-montant { font-weight: 700; text-align: right; min-width: 90px; }
.total-box { margin-top: 14px; font-size: 1.15rem; text-align: right; }
.total-box strong { color: var(--navy); font-size: 1.4rem; }
#ajout-ligne { margin-top: 10px; }
@media (max-width: 800px) {
  .ligne { grid-template-columns: 1fr 1fr; }
  .ligne .l-cat, .ligne .dims, .ligne .l-det { grid-column: 1 / -1; }
}

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
tfoot th, tfoot td { border-bottom: 0; color: var(--text); text-transform: none; font-size: .95rem; }
tr.off { opacity: .5; }
table.rows-link tbody tr { cursor: pointer; }
table.rows-link tbody tr:hover { background: #f8fafc; }
td.actions { white-space: nowrap; }

/* ---------- Badges de statut ---------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: #eef1f5; color: #344054; white-space: nowrap; }
.st-recu_chine { background: #fef0c7; color: #93370d; }
.st-charge, .st-pret { background: #e0eaff; color: #2d31a6; }
.st-en_mer, .st-en_vol { background: #d1e9ff; color: #175cd3; }
.st-arrive_port, .st-arrive_ouaga, .st-route_ouaga, .st-dedouanement { background: #ebe9fe; color: #5925dc; }
.st-disponible { background: #dcfae6; color: #067647; }
.st-retire { background: #e4e7ec; color: #344054; }
.st-annule { background: #fee4e2; color: #b42318; }

/* ---------- Tableau de bord ---------- */
.quick { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.quick .btn { flex: 1 1 260px; }
.search-big { display: flex; gap: 8px; }
.search-big input { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--muted); font-size: .88rem; }
.kpi span { display: block; color: var(--navy); font-size: 1.45rem; font-weight: 800; }
a.kpi:hover { border-color: var(--orange); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
ul.plain { padding-left: 18px; }

/* Suivi (admin) */
.steps { list-style: none; padding: 0; margin: 0 0 14px; counter-reset: s; }
.steps li { position: relative; padding: 6px 0 6px 30px; color: var(--muted); }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: #eef1f5; font-size: .72rem; display: grid; place-items: center; font-weight: 700; }
.steps li.done { color: var(--text); }
.steps li.done::before { content: "✓"; background: var(--ok); color: #fff; }
.steps li.now { color: var(--navy); font-weight: 800; }
.steps li.now::before { background: var(--orange); color: #fff; }
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.photo { max-height: 220px; border-radius: 10px; border: 1px solid var(--line); }

/* Conteneurs */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card.envoi { text-decoration: none; color: var(--text); display: block; }
.card.envoi:hover { border-color: var(--orange); }
.envoi-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.envoi-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .85rem; color: var(--muted); margin: 8px 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.stats div { background: #f8fafc; border-radius: 10px; padding: 10px; font-size: .82rem; color: var(--muted); }
.stats span { display: block; font-size: 1.2rem; font-weight: 800; color: var(--navy); }
.check-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin: 8px 0 12px; }

/* ---------- Site public ---------- */
.pub-wrap { max-width: 1100px; margin: 0 auto; padding: 0 18px; }
.pub-top { background: var(--navy); position: sticky; top: 0; z-index: 10; }
.pub-nav { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; padding-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.pub-nav nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pub-nav nav a:not(.btn) { color: #d6e2f0; text-decoration: none; padding: 6px 8px; font-size: .92rem; }
@media (max-width: 640px) { .pub-nav nav a:not(.btn) { display: none; } }
.hero { background: linear-gradient(135deg, var(--navy) 0%, #1d4a7a 100%); color: #fff; padding: 46px 0 56px; }
.hero-in { display: grid; grid-template-columns: 1.2fr 1fr; gap: 34px; align-items: center; }
@media (max-width: 860px) { .hero-in { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); margin-bottom: .3em; }
.hero .lead { font-size: 1.08rem; color: #d6e2f0; max-width: 560px; }
.eyebrow { text-transform: uppercase; letter-spacing: 1px; font-size: .8rem; font-weight: 700; color: var(--orange); margin: 0 0 6px; }
.track-card { background: #fff; color: var(--text); border-radius: 16px; padding: 22px; box-shadow: 0 20px 40px rgba(0,0,0,.25); }
.track-card input { font-size: 1.15rem; padding: 14px; text-transform: uppercase; margin-bottom: 10px; }
.track-card .btn { width: 100%; }
.section { padding: 40px 18px; }
.section h2 { font-size: 1.5rem; }
.tarifs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .tarifs { grid-template-columns: 1fr; } }
.tarif-card { background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--orange); border-radius: var(--radius); padding: 20px; }
.tarif-card h3 { margin-top: 0; font-size: 1.2rem; }
.tarif-card ul { list-style: none; padding: 0; margin: 0; }
.tarif-card li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.tarif-card strong { color: var(--navy); white-space: nowrap; }
.how { padding-left: 22px; }
.how li { margin-bottom: 12px; }
.addr { display: block; background: #fff; border: 1px dashed var(--orange); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.pub-foot { background: #0b1f38; color: #b8c7d9; padding: 26px 0; font-size: .92rem; }
.pub-foot a { color: #fff; }

/* Résultat de suivi */
.track-inline { display: flex; gap: 8px; margin-bottom: 18px; }
.track-inline input { margin: 0; font-size: 1.05rem; text-transform: uppercase; }
.track-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.track-top h1 { margin: 0; font-size: 1.9rem; }
.track-status { padding: 10px 16px; border-radius: 12px; font-weight: 800; font-size: 1.05rem; background: #eef1f5; }
.eta { background: #fff7ed; border-radius: 10px; padding: 10px 12px; }
.timeline { list-style: none; padding: 0; margin: 18px 0; }
.timeline li { display: flex; gap: 14px; position: relative; padding-bottom: 18px; color: var(--muted); }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 9px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li.done:not(:last-child)::after { background: var(--ok); }
.timeline .dot { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--line); background: #fff; margin-top: 2px; }
.timeline li.done { color: var(--text); }
.timeline li.done .dot { background: var(--ok); border-color: var(--ok); }
.timeline li.now { color: var(--navy); }
.timeline li.now .dot { background: var(--orange); border-color: #fde3c4; box-shadow: 0 0 0 4px #fff3e2; }
.pay-box { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.pay-box div { background: #f8fafc; border-radius: 10px; padding: 10px; }
.pay-box span { display: block; font-size: .8rem; color: var(--muted); }
.tel-check { background: #f8fafc; border-radius: 10px; padding: 12px; margin: 12px 0; }
.tel-check label { font-size: .9rem; display: block; margin-bottom: 8px; }
.tel-check input { max-width: 140px; display: block; }
@media (max-width: 560px) { .pay-box { grid-template-columns: 1fr; } }

/* Ajustements */
.form .ligne label.qte-wrap { display: flex; margin: 0; }
.ligne .l-suppr { justify-self: end; }
.section .btn, .hero .btn { white-space: normal; text-align: center; }
body.public { overflow-x: hidden; }
