/* Data WM : feuille de style unique */
:root {
  --bg: #f5f6f8; --card: #fff; --text: #1d2430; --muted: #6b7280; --line: #e3e6ea;
  --accent: #1f5fbf; --accent-dark: #164a96; --ok: #1e7b45; --ok-bg: #e5f4ea; --ko: #b42318; --ko-bg: #fdecea;
  --neutral-bg: #eef0f3; --warn-bg: #fff6e0;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 16px 0 8px; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
pre { background: var(--neutral-bg); padding: 10px; overflow: auto; font-size: 12px; }

.top { display: flex; align-items: center; gap: 20px; background: #16213a; color: #fff; padding: 0 20px; height: 52px; position: sticky; top: 0; z-index: 10; }
.top .brand { color: #fff; font-weight: 700; font-size: 16px; }
.top nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.top nav a { color: #c9d3e6; padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.top nav a.active, .top nav a:hover { background: #26345a; color: #fff; text-decoration: none; }
.top .logout { display: flex; align-items: center; gap: 8px; color: #c9d3e6; font-size: 12px; white-space: nowrap; }
.top .logout button { color: #fff; }

main { max-width: 1400px; margin: 0 auto; padding: 24px 20px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 18px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + .card, .grid2 + table { margin-top: 18px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; color: var(--muted); }
.stat span { display: block; font-size: 26px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 12px; }
table.list { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 18px; }
.card table.list { border: 0; }
table.kv th { width: 160px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.wrap { max-width: 320px; overflow-wrap: anywhere; }
tr.highlight td { background: var(--warn-bg); }
tr.muted td { color: var(--muted); }
table.funnel { max-width: 640px; margin-top: 12px; }
table.funnel tr.total td { font-weight: 700; border-top: 2px solid var(--text); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--neutral-bg); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.ko { background: var(--ko-bg); color: var(--ko); }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--neutral-bg); overflow-wrap: anywhere; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--ko-bg); color: var(--ko); }
.muted { color: var(--muted); }
.small { font-size: 11px; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-size: 13px; display: inline-flex; margin-right: 10px; }
input, select, textarea { font: inherit; color: var(--text); padding: 6px 8px; border: 1px solid #cdd2d9; border-radius: 6px; background: #fff; min-width: 0; }
select[multiple] { min-width: 200px; }
textarea { width: 100%; }
button, .button { display: inline-block; font: inherit; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
button:hover, .button:hover { background: var(--accent-dark); text-decoration: none; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; }
button.danger, .danger button { background: var(--ko); border-color: var(--ko); }
form.danger { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack > button { align-self: flex-start; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 10px; }
.inline { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0; }
.filters .row .sep { color: var(--muted); }
.mapping { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 12px 0; }
.pager { display: flex; gap: 14px; align-items: center; }

.login { max-width: 380px; margin: 80px auto; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.optout { max-width: 520px; margin: 80px auto; }
