:root {
  --brand: #0057a8;
  --brand-dark: #003f7d;
  --accent: #f39200;
  --text: #1b2430;
  --muted: #5b6675;
  --line: #d9e0e8;
  --bg: #f4f6f9;
  --panel: #fff;
  --ok: #2e7d32;
  --warn: #b26a00;
  --error: #c62828;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--brand); }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 15px; margin: 0 0 10px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.bar { background: var(--brand-dark); color: #fff; }
.bar-in { max-width: 1280px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; min-height: 52px; }
.logo { color: #fff; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.logo img { height: 35px; width: auto; background: #fff; border-radius: 6px; padding: 3px 6px; box-sizing: content-box; }
.logo span { font-weight: 400; opacity: .8; margin-left: 4px; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav a { color: #fff; text-decoration: none; padding: 6px 10px; border-radius: 6px; opacity: .85; }
.nav a:hover, .nav a.on { background: rgba(255,255,255,.15); opacity: 1; }
.who { display: flex; gap: 12px; align-items: center; font-size: 13px; margin-left: auto; }
.who a, .who .link { color: #fff; }
button.link { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; font: inherit; }
.page { max-width: 1280px; margin: 0 auto; padding: 20px 16px 40px; }
.narrow { max-width: 460px; }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.head-row h1 { margin: 0; }
.muted { color: var(--muted); }
.info, .alert, .success { padding: 10px 12px; border-radius: 8px; border: 1px solid; }
.info { background: #e8f0fb; border-color: #9bbbe3; }
.alert { background: #fdecea; border-color: var(--error); }
.success { background: #e8f5e9; border-color: var(--ok); margin-bottom: 16px; }
.secret { font-size: 15px; background: #fff; padding: 2px 6px; border-radius: 4px; user-select: all; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.stack label.check { flex-direction: row; align-items: center; gap: 8px; }
.stack small { font-weight: 400; color: var(--muted); }
.stack small.err { color: var(--error); }
.has-error input { border-color: var(--error); }
input, select, button, .button { font: inherit; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select {
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); }
input:disabled { background: var(--bg); color: var(--muted); }
button, .button { display: inline-block; padding: 7px 12px; border: 1px solid var(--brand); border-radius: 6px; background: #fff; color: var(--brand); cursor: pointer; text-decoration: none; }
button.primary, .button.primary { background: var(--brand); color: #fff; }
button:hover, .button:hover { background: #e8f0fb; }
button.primary:hover, .button.primary:hover { background: var(--brand-dark); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0 0 12px; }
.filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 2px; }
.filters label.check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #eef2f6; font-weight: 600; font-size: 13px; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.row-off td { color: var(--muted); }
.row-alert td { background: #fdecea; }
.actions { white-space: nowrap; }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0 6px 4px 0; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag-paid { background: #e8f5e9; color: var(--ok); }
.tag-pending { background: #fff4e0; color: var(--warn); }
.tag-failed { background: #fdecea; color: var(--error); }
.tag-expired { background: #eceff1; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; }
.kpi-alert { border-color: var(--error); }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 24px; font-weight: 700; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; margin-bottom: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.grid2 .panel { margin-bottom: 0; }
.panel table { border: 0; }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--brand); }
.chart .bar:hover { fill: var(--accent); }
.chart .axis { fill: var(--muted); font-size: 10px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
.pager { display: flex; gap: 16px; justify-content: center; }
@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
}
textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; resize: vertical; }
input[type=url], input[type=file] { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ad-preview { max-width: 360px; margin: 0 auto; border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.ad-preview img { max-width: 100%; max-height: 320px; border-radius: 8px; align-self: center; }
.ad-preview .ad-label { font-size: 11px; text-transform: uppercase; color: var(--muted); text-align: left; }
.ad-preview strong { color: var(--brand-dark); font-size: 16px; }
.ad-preview p { margin: 0; }
.fake-btn { display: block; background: var(--brand); color: #fff; border-radius: 8px; padding: 8px; font-weight: 600; }
fieldset.placements { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
fieldset.placements legend { font-weight: 600; padding: 0 4px; }
fieldset.placements.has-error { border-color: var(--error); }
fieldset.placements label.check { font-weight: 600; flex-wrap: wrap; }
fieldset.placements small { width: 100%; padding-left: 24px; }
/* Aperçu d'une diapositive du carrousel (mêmes règles que le portail) */
.slide { position: relative; max-width: 360px; margin: 0 auto 12px; aspect-ratio: 16 / 9; min-height: 190px; border-radius: 16px; overflow: hidden; color: #fff; display: flex; isolation: isolate; }
.slide::before { content: ""; position: absolute; width: 220px; height: 220px; right: -60px; top: -70px; border-radius: 50%; background: rgba(255,255,255,.12); z-index: -1; }
.slide-bleu { background: linear-gradient(135deg, #0a6fd1 0%, #0057a8 45%, #003f7d 100%); }
.slide-orange { background: linear-gradient(135deg, #f39200 0%, #d96c00 45%, #a94e00 100%); }
.slide-vert { background: linear-gradient(135deg, #14a364 0%, #0b8150 50%, #06603b 100%); }
.slide-nuit { background: linear-gradient(135deg, #24344d 0%, #15233a 55%, #0b1626 100%); }
.slide-body { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 6px; padding: 16px; width: 100%; }
.slide-tag { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; background: rgba(255,255,255,.2); padding: 3px 9px; border-radius: 999px; margin-bottom: auto; }
.slide-title { font-size: 20px; line-height: 1.2; font-weight: 800; }
.slide-text { margin: 0; font-size: 13px; line-height: 1.4; }
.slide-cta { margin-top: 4px; background: #fff; color: var(--brand-dark); font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 999px; }
.slide-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
.slide-has-image::before { display: none; }
.slide-has-image .slide-body { background: linear-gradient(to top, rgba(0,0,0,.62), rgba(0,0,0,0)); }
.ad-preview[hidden] { display: none; }
