/* Odoo Sync — feuille de style maison, d'après la maquette validée (docs/maquette). */

:root {
  --bg: #F4F4F1;
  --surface: #FFFFFF;
  --ink: #1A1D21;
  --ink-2: #3D4248;
  --muted: #565C63;
  --line: #E1E2DD;
  --line-soft: #F0F1EC;
  --line-strong: #CDD0CA;
  --chip: #F0F1EC;

  --side-bg: #16191D;
  --side-raised: #20252A;
  --side-active: #2A2F35;
  --side-border: #3A4047;
  --side-ink: #E9EAE6;
  --side-link: #C9CCC5;
  --side-muted: #A9ADA6;
  --side-heading: #8E938B;

  --accent: #0F6E6A;
  --accent-ink: #0A4F4C;
  --accent-soft: #F2F8F7;

  --ok-bg: #E7F4EE; --ok-fg: #145C3E; --ok-dot: #2E9D68;
  --run-bg: #E3F1F0; --run-fg: #0B4B48; --run-dot: #0F6E6A;
  --warn-bg: #FFF1E0; --warn-fg: #8A3B0B; --warn-dot: #D97A1E;
  --err-bg: #FDECEA; --err-fg: #7A1F15; --err-dot: #C8372A; --err-line: #F3C2BC;
  --info-bg: #EEF3FB; --info-fg: #1F3F73; --info-line: #CFDCF2;

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --tap: 44px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.45; }
input, select, button, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 30px; font-weight: 700; }
.h2 { font-size: 22px; font-weight: 700; }
.h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
.mono { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.muted { color: var(--muted); font-size: 13px; }
.strong { font-weight: 600; color: var(--ink); }

/* Mise en page : la barre latérale passe au-dessus du contenu sur petit écran. */
.layout { display: flex; flex-wrap: wrap; min-height: 100vh; }
.main { flex: 999 1 560px; min-width: 0; padding: 40px 32px 64px; }
.container { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
@media (max-width: 640px) { .main { padding: 24px 16px 48px; } }

/* Barre latérale */
.sidebar { flex: 1 1 220px; background: var(--side-bg); color: var(--side-ink); padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: inherit; text-decoration: none; min-height: var(--tap); }
.brand:hover { color: inherit; }
.brand-mark { width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--side-muted); }
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-heading { padding: 0 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--side-heading); }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 0 12px; border-radius: var(--radius-sm); color: var(--side-link); text-decoration: none; font-size: 14px; }
.nav-link:hover { background: var(--side-raised); color: #FFFFFF; }
.nav-link[aria-current="page"] { background: var(--side-active); color: #FFFFFF; font-weight: 600; }
.nav-button { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; }
.project-current { min-height: var(--tap); display: flex; align-items: center; padding: 0 12px; margin-bottom: 4px; border-radius: var(--radius-sm); border: 1px solid var(--side-border); background: var(--side-raised); color: #FFFFFF; font-size: 14px; font-weight: 600; }
.project-current.is-empty { color: var(--side-muted); font-weight: 400; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.sidebar-stats { padding: 12px; border-radius: var(--radius-sm); background: var(--side-raised); display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--side-link); }
.stat-line { display: flex; align-items: center; gap: 8px; }
.sidebar-user { display: flex; flex-direction: column; gap: 2px; padding: 0 0 0 0; font-size: 12px; }
.user-email { padding: 0 12px; color: var(--side-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { padding: 0 12px 4px; color: var(--side-muted); }

/* Pastilles de statut : toujours accompagnées d'un texte. */
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot-ok { background: #4CC38A; }
.dot-run { background: #5FC9C1; }
.dot-muted { background: #7C8279; }
.dot-error { background: var(--err-dot); }
.main .dot-ok { background: var(--ok-dot); }
.main .dot-muted { background: #8E938B; }

/* En-tête de page */
.page-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.page-intro { display: flex; flex-direction: column; gap: 6px; }
.lead { font-size: 15px; color: var(--muted); max-width: 660px; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; border: 1px solid transparent; }
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-ink); color: #FFFFFF; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn:disabled, .btn[aria-disabled="true"] { background: #E4E5E0; color: #5E646B; cursor: not-allowed; }

/* Cartes et indicateurs */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-size: 26px; font-weight: 700; }
.kpi-sub { font-size: 15px; font-weight: 500; color: var(--muted); }
.tone-run { color: #0B5C58; }
.tone-warn { color: var(--warn-fg); }
.card-list { display: flex; flex-direction: column; gap: 12px; }
.project-card { padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.project-main { flex: 2 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.project-meta { flex: 1 1 170px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.empty-state { padding: 28px; display: flex; flex-direction: column; gap: 8px; }
.empty-state p { color: var(--muted); max-width: 640px; }

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 999px; background: var(--chip); color: var(--ink-2); white-space: nowrap; }
.badge-sh { background: #EDE9F7; color: #4B3A8C; font-weight: 600; }
.badge-online { background: #E6EEFB; color: #1F4A8A; font-weight: 600; }
.badge-self { background: #EEEFEA; color: var(--ink-2); font-weight: 600; }

/* Panneaux en liste */
.panel { overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 18px 20px; border-bottom: 1px solid #ECEDE8; }
.panel-empty { padding: 18px 20px; color: var(--muted); font-size: 14px; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 14px 20px; }
.row + .row { border-top: 1px solid var(--line-soft); }
.row-main { flex: 2 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.row-status { flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.status-ok { color: var(--ok-fg); }
.status-error { color: var(--err-fg); }
.status-muted { color: var(--muted); }

/* Encadrés */
.notice { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); font-size: 14px; }
.notice svg { flex: none; margin-top: 1px; }
.notice-info { background: var(--info-bg); border: 1px solid var(--info-line); color: var(--info-fg); }
.notice-error { display: block; background: var(--err-bg); border: 1px solid var(--err-line); color: var(--err-fg); border-radius: var(--radius-sm); }

/* Formulaires */
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea { min-height: var(--tap); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 12px; font-size: 14px; font-weight: 400; color: var(--ink); background: var(--surface); }
.field input:focus-visible { outline-offset: 0; }

/* Page de connexion */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-title { font-weight: 700; font-size: 16px; }

/* --- Jalon 2 : formulaires de connexion -------------------------------------------------- */
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split-main { flex: 1.6 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.form-card { flex: 1 1 340px; min-width: 0; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.form-narrow { max-width: 560px; }
.row.is-selected { background: var(--accent-soft); }
.btn-sm { min-height: var(--tap); padding: 0 14px; font-size: 13px; }
.btn-outline { background: var(--surface); color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); color: var(--accent-ink); }
.btn-danger { background: var(--surface); color: var(--err-fg); border-color: var(--err-line); }
.btn-danger:hover { background: var(--err-bg); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-zone { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.field .help { font-size: 12px; font-weight: 400; color: var(--muted); }
.field .error, fieldset .error { font-size: 12px; font-weight: 600; color: var(--err-fg); }
.field.has-error input { border-color: var(--err-dot); }
.req { color: var(--err-fg); }
.field select { min-height: var(--tap); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 12px; background: var(--surface); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.plain-fieldset { display: flex; flex-direction: column; gap: 16px; }
.radio-cards { display: flex; flex-direction: column; gap: 8px; }
.radio-card { position: relative; min-height: 56px; padding: 8px 14px 8px 44px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.radio-card input { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin: -9px 0 0; accent-color: var(--accent); }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.radio-card-title { font-size: 14px; font-weight: 600; }
.radio-card-hint { font-size: 12px; color: var(--muted); }
/* Aides propres au type d'hébergement choisi (sans JavaScript). */
.kind-form .hint-kind { display: none; }
.kind-form:has(#kind-sh:checked) .hint-sh,
.kind-form:has(#kind-online:checked) .hint-online,
.kind-form:has(#kind-self:checked) .hint-self { display: block; }
.kind-form:has(#kind-online:checked) p.hint-online { display: flex; }
.advanced summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); }
.advanced[open] { display: flex; flex-direction: column; gap: 16px; }
.result { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; }
.result-ok { background: var(--ok-bg); color: var(--ok-fg); }
.result-error { background: var(--err-bg); color: var(--err-fg); }
.result .muted { color: inherit; opacity: .85; }
ul.plain { margin: 0; padding-left: 18px; }
.notice-ok { display: block; background: var(--ok-bg); border: 1px solid #BFE3D0; color: var(--ok-fg); }
.breadcrumb { font-size: 13px; color: var(--muted); }
.htmx-indicator { display: none; }
.htmx-indicator.htmx-request { display: block; }

/* --- Jalon 3 : projets, catalogue, statuts ------------------------------------------------ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.chip[aria-current="true"] { background: var(--side-bg); border-color: var(--side-bg); color: #FFFFFF; }
.project-card.is-watch { border-color: var(--err-line); }
.project-status { flex: 1.4 1 230px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.project-actions { flex: 0 0 auto; display: flex; gap: 8px; }
.pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.pill-ok { background: var(--ok-bg); color: var(--ok-fg); }
.pill-run { background: var(--run-bg); color: var(--run-fg); }
.pill-warn { background: var(--warn-bg); color: var(--warn-fg); }
.pill-error { background: var(--err-bg); color: var(--err-fg); }
.pill-muted { background: var(--chip); color: var(--ink-2); }
.main .dot-run { background: var(--run-dot); }
.dot-warn { background: var(--warn-dot); }
.detail { font-size: 13px; color: var(--muted); }
.detail-warn { color: var(--warn-fg); }
.detail-error { color: var(--err-fg); }
progress.progress { width: 100%; height: 8px; border: 0; border-radius: 999px; background: #E3EEEC; overflow: hidden; appearance: none; }
progress.progress::-webkit-progress-bar { background: #E3EEEC; border-radius: 999px; }
progress.progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress.progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.badge-warn { background: var(--warn-bg); color: var(--warn-fg); }
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 8px 0 0; padding: 0; font-size: 14px; color: var(--muted); }
.steps li { display: flex; align-items: center; gap: 8px; }
.steps li[aria-current="step"] { color: var(--ink); font-weight: 600; }
.step-num { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--chip); font-size: 12px; font-weight: 700; }
.steps li[aria-current="step"] .step-num { background: var(--accent); color: #FFFFFF; }
.check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }

.project-switcher { position: relative; }
.project-switcher summary { list-style: none; cursor: pointer; justify-content: space-between; gap: 8px; }
.project-switcher summary::-webkit-details-marker { display: none; }
.project-current-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-list { list-style: none; margin: 4px 0 8px; padding: 4px; border-radius: var(--radius-sm); background: var(--side-raised); }
.switcher-list a[aria-current="true"] { color: #FFFFFF; font-weight: 600; }

.catalogue { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.catalogue-list { flex: 1 1 320px; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.catalogue-detail { flex: 1.6 1 460px; min-width: 0; overflow: hidden; }
.catalogue-search { padding: 12px 20px; display: flex; gap: 8px; align-items: flex-end; border-bottom: 1px solid var(--line-soft); }
.catalogue-search .field { flex: 1; }
.model-list { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow-y: auto; }
.model-item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 20px; color: var(--ink); text-decoration: none; border-top: 1px solid var(--line-soft); }
.model-item:hover { background: #FAFAF8; color: var(--ink); }
.model-item[aria-current="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.model-check { width: 20px; height: 20px; flex: none; border-radius: 5px; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #FFFFFF; }
.model-item:has(.sr-only) .model-check { background: var(--accent); border-color: var(--accent); }
.model-names { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.model-label { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.catalogue-tools { padding: 16px 20px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 12px; }
.catalogue-tools form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { align-items: flex-end !important; }
.inline-form .field { flex: 1 1 200px; }
.detail-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.radio-cards-row { flex-direction: row; flex-wrap: wrap; }
.radio-cards-row legend { width: 100%; }
.radio-cards-row .radio-card { flex: 1 1 180px; }
.field textarea { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; min-height: 64px; }
.fields-box { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.fields-head { display: flex; gap: 8px; align-items: baseline; padding: 10px 14px; margin: 0; }
.field-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.field-row { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 6px 14px; border-top: 1px solid var(--line-soft); cursor: pointer; }
.field-row input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.field-row.is-missing { opacity: .7; }
.field-names { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.field-badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.catalogue-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 14px 20px; position: sticky; bottom: 12px; }
.footer-status { display: flex; flex-direction: column; gap: 4px; min-width: 200px; flex: 1 1 220px; }

/* --- Page Données ---------------------------------------------------------------------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.data-table th { background: #FAFAF8; font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
.data-rows td { white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.data-rows tbody tr:hover { background: #FAFAF8; }
.structure summary { min-height: var(--tap); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.structure[open] summary { margin-bottom: 8px; }
.preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.pager { display: flex; align-items: center; gap: 12px; }
/* Page Données : plus large que les autres, liste étroite, tableaux sans retour à la ligne. */
.container:has(.explorer) { max-width: 1600px; }
.explorer { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .explorer { grid-template-columns: minmax(0, 1fr); } }
.explorer .catalogue-list, .explorer .catalogue-detail { min-width: 0; }
.explorer .data-table td.mono, .explorer .data-table th { white-space: nowrap; }
.explorer .structure { margin-top: 8px; }

/* --- Planification ----------------------------------------------------------------------- */
.field-row-group { display: flex; flex-wrap: wrap; gap: 16px; }
.field-row-group .field { flex: 1 1 180px; }
.next-run { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 14px; }
.check-with-input { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.input-short { width: 90px; min-height: var(--tap); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 10px; }
.split > .form-card { flex: 1 1 340px; }

/* --- Historique --------------------------------------------------------------------------- */
.history { display: flex; flex-direction: column; gap: 24px; }
.kpi-text { font-size: 18px; }
.table-flat { border: 0; border-radius: 0; }
.data-table tr.is-selected { background: var(--accent-soft); }
.data-table td.wrap { white-space: normal; min-width: 220px; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--line-soft); }
.pre-line { white-space: pre-line; }

/* --- Administration ---------------------------------------------------------------------- */
.token-once { border-color: var(--accent); background: var(--accent-soft); }
.code-block { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--side-bg); color: #E9EAE6; font-family: var(--mono); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.plain-list { list-style: none; margin: 0 0 0 28px; padding: 0; }
.catalogue-search { flex-wrap: wrap; }
.catalogue-search .field { flex: 1 1 160px; }
.catalogue-search select { min-height: var(--tap); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 10px; background: var(--surface); }

/* --- Interface de rapports (/r/) ---------------------------------------------------------- */
.notice-warn { display: block; background: var(--warn-bg); border: 1px solid #F3D3AE; color: var(--warn-fg); border-radius: var(--radius-sm); }
.r-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 12px 32px; background: var(--surface); border-bottom: 1px solid var(--line); }
.r-brand { display: flex; align-items: center; gap: 12px; min-height: var(--tap); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 17px; }
.r-brand:hover { color: var(--ink); }
.r-user { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 14px; }
.r-email { color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-link { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--accent); font-weight: 600; text-decoration: none; }
.r-button { border: 0; background: none; padding: 0; cursor: pointer; }
.r-main { padding: 32px 32px 64px; }
.r-container { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
@media (max-width: 640px) { .r-header { padding: 8px 16px; } .r-main { padding: 24px 16px 48px; } }

.r-search { max-width: 420px; }
.r-group { display: flex; flex-direction: column; gap: 12px; }
.r-group-title { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.r-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.r-card { position: relative; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.r-card:hover { border-color: var(--line-strong); }
.r-card-link { font-size: 17px; font-weight: 600; color: var(--ink); text-decoration: none; }
.r-card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.r-card-link:hover { color: var(--accent-ink); }
.r-card-desc { color: var(--ink-2); font-size: 14px; }

.r-report-head { display: flex; flex-direction: column; gap: 8px; }
#report-body { display: flex; flex-direction: column; gap: 16px; }
.r-filters { padding: 16px 20px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; }
.r-filter { min-width: 200px; }
.r-range { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; }
.r-range-custom { display: none; gap: 12px; }
.r-range:has(option[value="custom"]:checked) .r-range-custom { display: flex; }
.r-range:has(option[value="custom"]:checked) .r-range-text { display: none; }
.r-range-text { min-height: var(--tap); display: inline-flex; align-items: center; }
.r-multi { position: relative; }
.r-multi summary { min-height: var(--tap); display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-weight: 400; font-size: 14px; cursor: pointer; }
.r-multi-list { position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; min-width: 100%; max-height: 320px; overflow-y: auto; margin: 0; padding: 6px 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); box-shadow: 0 8px 24px rgba(26, 29, 33, .12); }
.r-check { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px; font-weight: 400; font-size: 14px; white-space: nowrap; cursor: pointer; }
.r-check input { width: 18px; height: 18px; accent-color: var(--accent); }

.r-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.r-widget { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; grid-column: span 12; }
.r-w3 { grid-column: span 3; } .r-w4 { grid-column: span 4; } .r-w6 { grid-column: span 6; } .r-w8 { grid-column: span 8; }
@media (max-width: 900px) { .r-w3 { grid-column: span 6; } .r-w4, .r-w6, .r-w8 { grid-column: span 12; } }
@media (max-width: 560px) { .r-w3 { grid-column: span 12; } }
.r-widget-title { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.r-kpi-value { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.r-kpi-compare { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.r-chart { width: 100%; height: 320px; }
.r-widget-error { color: var(--err-fg); font-size: 14px; }
.r-data summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.r-data .table-scroll { margin-top: 8px; max-height: 360px; overflow-y: auto; }
.r-widget .table-scroll { max-height: 560px; overflow-y: auto; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media print {
  .r-header, .r-search, .r-data, noscript { display: none !important; }
  body { background: #FFFFFF; }
  .r-main { padding: 0; }
  .r-filters select, .r-filters input { border: 0; }
  .r-widget { break-inside: avoid; }
  .r-widget .table-scroll { max-height: none; overflow: visible; }
}
