:root {
  --bg: #F5F7FA; --surface: #FFFFFF; --border: #E2E7EE; --line: #EEF1F5; --input: #D5DCE6;
  --text: #111827; --text-2: #374151; --muted: #4B5563; --faint: #6B7280;
  --accent: #0F5FC2; --accent-dark: #0B4A99; --accent-soft: #E8F0FB; --accent-ink: #0B3F82;
  --warn-bg: #FFF1E0; --warn: #8A4200; --ok-bg: #E7F5EC; --ok: #1E6B3A; --danger: #B42318; --new-bg: #F1ECFB; --new: #5B3BA8;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1 { font-size: 24px; margin: 0; font-weight: 700; }
h2 { font-size: 17px; margin: 0; font-weight: 600; }
h3 { font-size: 15px; margin: 0; font-weight: 600; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Structure */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-in { max-width: 1200px; margin: 0 auto; padding: 0 16px; min-height: 60px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; }
.brand { font-weight: 700; font-size: 17px; }
.topnav { display: flex; flex-wrap: wrap; gap: 4px; flex-grow: 1; }
.topnav a { padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; text-decoration: none; }
.topnav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 110px; display: flex; flex-direction: column; gap: 16px; }
main.narrow { max-width: 560px; }
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; height: calc(68px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border); display: flex; z-index: 10; }
.bottombar a { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12.5px; font-weight: 500; text-decoration: none; }
.bottombar a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.bottombar svg, .icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 900px) { .bottombar { display: none; } main { padding-bottom: 48px; } }
@media (max-width: 899px) { .topnav .member-link { display: none; } }

/* Composants */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.card.hero { background: var(--accent); border-color: transparent; color: #fff; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.kpi strong { font-size: 24px; }
.kpi span { font-size: 13px; color: var(--muted); }
.list > * + * { border-top: 1px solid var(--line); }
.list > * { padding: 9px 0; }
.list > span:not(.row) { display: block; }
.list > span.row { display: flex; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--input); background: var(--surface); color: var(--text); font-weight: 500; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-dark); color: #fff; }
.btn.big { min-height: 54px; font-size: 17px; border-radius: 14px; width: 100%; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn.danger { color: var(--danger); border-color: transparent; background: transparent; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: default; }
.iconbtn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--input); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.play { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; border: 0; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.play svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }

.mic { width: 92px; height: 92px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; align-self: center; }
.mic svg { width: 38px; height: 38px; }
.mic.rec { background: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(180,35,24,.45); } 50% { box-shadow: 0 0 0 14px rgba(180,35,24,0); } }

label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text-2); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], input[type=month], select, textarea {
  min-height: 44px; border: 1px solid var(--input); border-radius: 10px; padding: 8px 12px; background: var(--surface); font-weight: 400; width: 100%; }
textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fields { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--input); background: var(--surface); font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; border-radius: 6px; padding: 2px 8px; background: var(--line); color: var(--text-2); white-space: nowrap; }
.tag.video { background: var(--warn-bg); color: var(--warn); }
.tag.offerte, .tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.new { background: var(--new-bg); color: var(--new); }
.tag.accent { background: var(--accent-soft); color: var(--accent-ink); }

.item { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.item-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.eleve-row { display: grid; grid-template-columns: minmax(0, 1.4fr) 70px auto; gap: 6px; align-items: center; }
.alert { border-radius: 10px; padding: 10px 12px; font-size: 14px; white-space: pre-line; }
.alert.warn { background: #FFF8EC; color: #6B3A00; }
.alert.err { background: #FDECEA; color: #8B1D13; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.seg { display: inline-grid; grid-auto-flow: column; background: #E9EDF3; border-radius: 10px; padding: 3px; }
.seg button { height: 38px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; }

.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { color: var(--muted); font-weight: 600; border-bottom-color: var(--border); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
td.tot, th.tot { background: var(--bg); font-weight: 700; }
tfoot td, tfoot th { font-weight: 700; border-bottom: 0; }
tr.group th { background: var(--bg); font-size: 15px; }
.empty { color: var(--muted); text-align: center; padding: 24px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; font-size: 14px; max-width: 90vw; }
.login { max-width: 380px; margin: 10vh auto; padding: 0 16px; }
