:root {
  --bg: #f3f5f8;
  --card: #ffffff;
  --ink: #14222f;
  --ink-2: #3c4b5a;
  --muted: #6b7a89;
  --line: #dde3ea;
  --accent: #1f5fbf;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0fb;
  --ok: #1d7a46;
  --warn: #b25e00;
  --warn-soft: #fff3e3;
  --bad: #b3261e;
  --bad-soft: #fdecea;
  --radius: 10px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.hidden { display: none !important; }

/* ---------- mise en page */
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: .01em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--accent); }
.topbar .org { color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 16px 0; }
.tabs button {
  border: 0; background: none; padding: 10px 14px; font: inherit; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
main { padding-bottom: 48px; }
.banner { padding: 10px 16px; text-align: center; font-weight: 600; }
.banner.support { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid #f1d2a8; }

/* ---------- cartes et formulaires */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.center-card { max-width: 420px; margin: 8vh auto 24px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 4px; color: var(--ink-2); }
.field { margin-bottom: 14px; }
input[type=text], input[type=password], input[type=date], input[type=tel], select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; color: var(--ink); }
.check input { width: 18px; height: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; min-height: 42px;
}
.btn:hover { border-color: #c5ced8; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.small { padding: 6px 10px; min-height: 34px; font-size: .88rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.msg { padding: 10px 12px; border-radius: 8px; margin: 0 0 12px; font-size: .92rem; }
.msg.err { background: var(--bad-soft); color: var(--bad); }
.msg.ok { background: #e8f5ee; color: var(--ok); }
.msg.info { background: var(--accent-soft); color: #18457f; }
.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: #18457f; white-space: nowrap; }
.pill.grey { background: #eef1f4; color: var(--muted); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.ok { background: #e8f5ee; color: var(--ok); }

/* ---------- listes */
.people { display: grid; gap: 10px; }
.person {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-height: 56px; color: var(--ink);
}
.person:hover { border-color: var(--accent); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none;
}
.person .who { flex: 1; min-width: 0; }
.person .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 160px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-top: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f7f9fb; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.ev-detail { color: var(--muted); font-size: .85rem; word-break: break-word; }

.members li { align-items: center; }
.member-role select { min-width: 170px; }
@media (max-width: 600px) {
  .members li > * { flex-basis: 100%; }
  .member-role select { width: 100%; }
}

/* ---------- marque commune Météorem × StatWind */
.brand { display: inline-flex; align-items: center; gap: 6px; }
.brand .x, .brand-block .x { color: var(--muted); font-weight: 400; }
.tb-m { height: 15px; width: auto; }
.tb-s { height: 30px; width: auto; }
.brand-block { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 4px 0 12px; }
.brand-block .lg-m { height: 22px; width: auto; }
.brand-block .lg-s { height: 52px; width: auto; }
.brand-block .x { font-size: 1.3rem; }

/* ---------- boutons d'outils */
.tools-h { max-width: 720px; margin: 28px auto 12px; }
.tools { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); max-width: 980px; }
.wrap > .tools { max-width: 720px; margin: 0 auto; }
.tool {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; font: inherit; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-height: 88px;
  cursor: pointer; text-decoration: none;
}
.tool:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(31, 95, 191, .08); }
.tool.off { cursor: default; }
.tool.off:hover { border-color: var(--line); box-shadow: none; }
.tool.off .tool-ic { filter: grayscale(.6); opacity: .7; }
.tool-ic { font-size: 2rem; line-height: 1; flex: none; width: 44px; text-align: center; }
.tool-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tool-t b { font-size: 1.08rem; }
.tool-go { font-size: 1.3rem; color: var(--accent); flex: none; }

/* ---------- produits */
.product h2 { margin-bottom: 4px; }
.product .list { margin: 12px 0; }

/* ---------- fenêtre */
.modal-back {
  position: fixed; inset: 0; background: rgba(15, 25, 35, .45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 440px; max-height: 92vh; overflow: auto; padding: 20px; }
.modal.wide { max-width: 860px; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.pinpad button { font: inherit; font-size: 1.3rem; padding: 14px 0; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.pindots { display: flex; justify-content: center; gap: 10px; margin: 8px 0; min-height: 18px; }
.pindots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent); }
.pindots i.on { background: var(--accent); }
pre.json { background: #f6f8fa; border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; max-height: 55vh; font-size: .8rem; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; background: #f6f8fa; border: 1px dashed var(--line); padding: 10px 12px; border-radius: 8px; word-break: break-all; }
.sendbox { white-space: pre-wrap; font-size: .9rem; background: #f6f8fa; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
footer.foot { text-align: center; color: var(--muted); font-size: .82rem; padding: 24px 16px; }

@media (max-width: 600px) {
  .tb-m { height: 12px; }
  .tb-s { height: 26px; }
  .card { padding: 14px; }
  .center-card { margin-top: 4vh; }
  .hide-phone { display: none; }
}
