/* TRANSIGO — noir encre, vert citron, blanc cassé. Grotesque grasse, comme le logo. */
:root {
  --bg: #0b0b0d;
  --panel: #141417;
  --panel-2: #1b1b1f;
  --line: #2a2a30;
  --line-soft: #202025;
  --fg: #f5f6f1;
  --muted: #a3a5ab;
  --lime: #dcfe62;
  --lime-dim: #b8d84a;
  --on-lime: #0b0b0d;
  --danger: #ff8b7d;
  --amber: #f5c15a;
  --blue: #86bcff;
  --violet: #bfaeff;
  --green: #66d99a;
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  padding-inline: 16px;
  min-height: 100vh;
}
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -0.02em; font-weight: 800; text-wrap: balance; }
p { margin: 0; }
a { color: var(--lime); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1120px; margin-inline: auto; }

/* ---------- barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  margin-inline: -16px; padding: 12px 16px;
  background: rgba(11, 11, 13, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.brand img { width: 36px; height: 36px; border-radius: 10px; display: block; }
.wordmark { font-size: 26px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.wordmark b { color: var(--lime); font-weight: 800; }
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.who strong { color: var(--fg); font-weight: 600; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-block: 14px 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer;
  text-decoration: none; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--fg); border-color: #3a3a42; }
.tab[aria-current="page"] { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
.tab .count { background: var(--danger); color: #1a0705; border-radius: 999px; font-size: 12px; padding: 0 7px; line-height: 18px; font-weight: 700; }

main { padding-block: 24px 64px; }
.page-title { font-size: clamp(28px, 5vw, 44px); margin-bottom: 6px; }
.page-sub { color: var(--muted); max-width: 60ch; margin-bottom: 24px; }
.section-title { font-size: 20px; margin: 32px 0 14px; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; cursor: pointer; text-decoration: none; background: var(--lime); color: var(--on-lime);
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn:hover { background: #e6ff85; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { border-color: #46464f; background: var(--panel-2); }
.btn.danger { background: transparent; color: var(--danger); border-color: #4a2b27; }
.btn.danger:hover { background: #2a1613; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn.block { width: 100%; }

/* ---------- formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .legend { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.field .hint { font-size: 13px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="date"],
input[type="time"], input[type="number"], input[type="month"], input[type="search"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--fg);
}
textarea { resize: vertical; min-height: 84px; }
input::placeholder, textarea::placeholder { color: #6f7178; }
input:hover, select:hover, textarea:hover { border-color: #3d3d46; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--lime); outline-offset: 0; border-color: var(--lime); }
input[type="date"], input[type="time"], input[type="month"] { color-scheme: dark; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 20px, calc(100% - 14px) 20px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--lime); }
.error { color: var(--danger); font-size: 14px; min-height: 20px; }

/* options en cartes (radio) */
.opts { display: grid; gap: 10px; }
.opts.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opt { position: relative; min-width: 0; }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.opt .face {
  display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel-2); transition: border-color 0.12s, background 0.12s;
}
.opt input:hover + .face { border-color: #46464f; }
.opt input:checked + .face { border-color: var(--lime); background: #1b2008; }
.opt input:focus-visible + .face { outline: 2px solid var(--lime); outline-offset: 2px; }
.opt input:disabled { cursor: not-allowed; }
.opt input:disabled + .face { opacity: 0.4; }
.opt .t { font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.opt .t svg { width: 22px; height: 22px; flex: none; }
.opt .s { font-size: 14px; color: var(--muted); }
.opt .p { font-weight: 700; color: var(--lime); font-size: 15px; margin-top: 2px; }

/* ---------- panneaux ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 20px; margin-bottom: 14px; }
.panel h2 + .lead { margin-top: -10px; }
.panel .opts + .field, .panel .grid2 + .rule, .panel .opts + .rule { margin-top: 14px; }
.panel .lead { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.summary { position: sticky; top: 92px; border-color: #3a4220; background: #12140a; }
.summary dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-weight: 600; color: var(--fg); }
.price { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; color: var(--lime); line-height: 1; }
.price small { display: block; font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-top: 6px; }
.rule { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--fg); }
.rule.warn { border-color: #5a4a1e; color: var(--amber); }

.banner { border: 1px solid #5a4a1e; background: #1d1809; color: var(--amber); padding: 14px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 20px; }
.banner a { color: inherit; font-weight: 700; }
.banner.info { border-color: var(--line); background: var(--panel); color: var(--muted); }
.banner.ok { border-color: #1f4a35; background: #0d1d15; color: var(--green); }

/* ---------- indicateurs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 8px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.kpi .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin-top: 4px; line-height: 1.1; overflow-wrap: anywhere; }
.kpi .v.lime { color: var(--lime); }
.kpi .d { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- statuts ---------- */
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; padding: 3px 11px 3px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.demande { color: var(--amber); }
.pill.confirmee { color: var(--blue); }
.pill.en_cours { color: var(--violet); }
.pill.livree, .pill.payee { color: var(--green); }
.pill.annulee { color: #8b8d94; }
.pill.emise { color: var(--amber); }
.pill.late { color: var(--danger); }

/* ---------- listes de courses ---------- */
.list { display: flex; flex-direction: column; gap: 12px; }
.order { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 12px; }
.order .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.order .ref { font-weight: 800; font-size: 15px; letter-spacing: 0.02em; }
.order .when { color: var(--muted); font-size: 14px; }
.order .route { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 15px; }
.order .route span:nth-child(odd) { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 3px; }
.order .route span { overflow-wrap: anywhere; }
.order .foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.order .amount { font-weight: 800; font-size: 18px; }
.order .amount small { font-weight: 600; color: var(--muted); font-size: 13px; margin-left: 6px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.tag.lime { color: var(--lime); border-color: #3f4a1c; }
.admin-edit { display: grid; grid-template-columns: 150px 120px minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.empty { text-align: center; padding: 48px 16px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty strong { display: block; color: var(--fg); font-size: 18px; margin-bottom: 4px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; cursor: pointer; min-height: 40px; }
.chip:hover { color: var(--fg); }
.chip[aria-pressed="true"] { background: var(--panel-2); color: var(--lime); border-color: var(--lime); }

/* ---------- tableaux ---------- */
.tablebox { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
td .sub { display: block; color: var(--muted); font-size: 13px; }

/* ---------- accueil / connexion ---------- */
.auth { max-width: 1040px; margin-inline: auto; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-block: 40px; }
.hero img.logo { width: min(260px, 60%); height: auto; display: block; margin-bottom: 28px; border-radius: 6px; }
.hero h1 { font-size: clamp(36px, 6vw, 60px); margin-bottom: 16px; }
.hero h1 em { font-style: normal; color: var(--lime); }
.hero p { color: var(--muted); max-width: 44ch; font-size: 18px; }
.hero ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.hero li { display: flex; gap: 12px; align-items: baseline; font-weight: 600; }
.hero li::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--lime); transform: translateY(1px); }
.hero .call { margin-top: 32px; font-size: 14px; color: var(--muted); }
.hero .call strong { color: var(--fg); }
.authcard { padding: 26px; }
.switch { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel-2); border-radius: 999px; padding: 4px; margin-bottom: 22px; }
.switch button { border: 0; background: transparent; color: var(--muted); padding: 10px; border-radius: 999px; font-weight: 700; cursor: pointer; min-height: 44px; }
.switch button[aria-selected="true"] { background: var(--lime); color: var(--on-lime); }

.done { text-align: center; padding: 36px 20px; }
.done .check-mark { width: 64px; height: 64px; border-radius: 20px; background: var(--lime); color: var(--on-lime); display: grid; place-items: center; margin: 0 auto 18px; }
.done h2 { font-size: 28px; margin-bottom: 8px; }
.done .refbox { display: inline-block; margin: 14px 0 22px; padding: 8px 16px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 800; letter-spacing: 0.05em; }

footer.site { border-top: 1px solid var(--line-soft); padding-block: 22px 40px; margin-inline: -16px; padding-inline: 16px; color: var(--muted); font-size: 14px; }
footer.site .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-weight: 700; z-index: 50; max-width: calc(100vw - 32px); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }
.toast.err { background: var(--danger); color: #1a0705; }
.noscript { padding: 24px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .auth { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 24px; min-height: 0; }
  .admin-edit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .admin-edit .wide { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .grid2, .grid3, .opts.c3 { grid-template-columns: minmax(0, 1fr); }
  .opts.c3 .face { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
  .panel { padding: 18px; }
  .who span.name { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* utilitaires (aucun style en ligne : la politique de sécurité les interdit) */
.row.center { justify-content: center; }
.mt { margin-top: 20px; }
.mt-s { margin-top: 8px; }
.narrow { max-width: 640px; }
.narrow.wide { max-width: 720px; }
.w240 { max-width: 240px; }
.w260 { max-width: 260px; }

/* --- tarifs, carnet d'adresses --- */
.tgrid input.money { width: 92px; min-height: 38px; padding: 6px 10px; text-align: right; font-variant-numeric: tabular-nums; }
.tgrid th .sub { display: block; font-weight: 500; }
.tgrid td, .tgrid th { vertical-align: middle; }
.editrow > td { background: var(--panel-2); padding: 18px; }
.editrow .tablebox { background: var(--panel); }
.addr-pick { margin-bottom: 8px; min-height: 40px; font-size: 14px; color: var(--muted); }
.banner.ops { color: var(--fg); line-height: 1.55; }
.banner.ops strong { color: var(--lime); }
.order .foot .row { gap: 10px; }
@media (max-width: 720px) {
  .tgrid input.money { width: 76px; }
  .order .foot { flex-wrap: wrap; gap: 10px; }
}
.h3 { font-size: 15px; font-weight: 800; margin: 6px 0 4px; }
.tgrid input.money.tiny { width: 58px; }
.tgrid .pair { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; }
.tgrid input.bar-name { width: 100%; min-width: 180px; min-height: 38px; padding: 6px 10px; }
.scrollbox { max-height: 460px; overflow: auto; }
.scrollbox thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.row .grow { flex: 1 1 220px; }
.row > .btn { align-self: flex-end; }
.sticky-save { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); }

.tag.warn { color: var(--amber); border-color: #5a4a1e; }
.banner.cancelreq { margin: 0; }
.banner.cancelreq .row { display: flex; }

/* --- notifications de suivi --- */
fieldset.notif { border: 0; padding: 0; margin: 0; }
fieldset.notif .chips { margin: 8px 0 0; }
.chip-radio { position: relative; }
.chip-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip-radio span { display: inline-flex; align-items: center; min-height: 40px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; }
.chip-radio input:checked + span { background: var(--panel-2); color: var(--lime); border-color: var(--lime); }
.chip-radio input:focus-visible + span { outline: 2px solid var(--lime); outline-offset: 2px; }
.maillog { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.maillog .warn { color: var(--amber); }
.mailframe { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: var(--radius); background: #f4f4f1; }
.row .grow { flex: 1 1 160px; }
/* page publique de suivi */
.track { padding-block: 32px 64px; }
.track-ref { color: var(--muted); margin-bottom: 6px; }
.track-steps { list-style: none; padding: 0; margin: 18px 0 22px; display: grid; gap: 10px; }
.track-steps li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); font-weight: 700; }
.track-steps li .ic { font-size: 20px; filter: grayscale(1); opacity: .5; }
.track-steps li.done { color: var(--fg); }
.track-steps li.done .ic, .track-steps li.now .ic { filter: none; opacity: 1; }
.track-steps li.now { border-color: var(--lime); background: #1b2008; color: var(--lime); }
.track-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.track-dl dt { color: var(--muted); }
.track-dl dd { margin: 0; font-weight: 600; }
.order .route .maillog span { color: var(--muted); font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; padding: 0; }
.order .route .maillog span.warn { color: var(--amber); }

/* --- assistant IA --- */
.panel.ai { margin-bottom: 20px; border-color: #3a4220; background: linear-gradient(180deg, #151a08, var(--panel)); }
.ai-row { display: flex; gap: 10px; align-items: stretch; }
.ai-row textarea { flex: 1; min-height: 52px; }
.ai-row .btn { flex: none; align-self: stretch; }
.ai-result { margin-top: 10px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--line); display: grid; gap: 6px; font-size: 14px; }
.ai-result .warn { color: var(--amber); }
.ai-result .small { font-size: 13px; }
.ai-q { margin: 0; padding-left: 18px; color: var(--fg); }
.ai-filled { outline: 2px solid var(--lime) !important; outline-offset: 1px; transition: outline-color .6s; }
@media (max-width: 640px) { .ai-row { flex-direction: column; } }

/* clients VIP */
.tag.vip { color: var(--on-lime, #0b0b0d); background: var(--lime); border-color: var(--lime); font-weight: 700; }
.vipbox { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.vipadd { flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.vipadd .grow { flex: 1 1 260px; }
.vipadd .w160 { flex: 0 0 160px; }
.vipadd .error { flex-basis: 100%; }
@media (max-width: 640px) { .vipadd .w160 { flex: 1 1 100%; } }
