/* CheckCo — styles communs (site, espace pro, administration). Aucune police ni ressource tierce. */
:root {
  --primary: #1f6f8b;
  --accent: #e07a2f;
  --ink: #1b2430;
  --ink-soft: #4a5565;
  --muted: #7a8494;
  --line: #e3e7ee;
  --bg: #f6f7f9;
  --card: #ffffff;
  --ok: #1f8a4c;
  --warn: #b7791f;
  --danger: #c0392b;
  --info: #2b6cb0;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 8px 24px -16px rgba(20, 30, 50, .25);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --focus: 0 0 0 3px color-mix(in srgb, var(--primary) 35%, transparent);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; font-size: 16px; }
img, svg { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 2.5vw, 2.2rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.soft { color: var(--ink-soft); }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* En-tête */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); display: grid; place-items: center; color: #fff; flex: none; }
.brand .logo svg { width: 20px; height: 20px; }
.brand-logo { height: 44px; width: auto; display: block; }
@media (max-width: 480px) { .brand-logo { height: 36px; } }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .nav button { color: var(--ink-soft); padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: .95rem; background: none; border: 0; cursor: pointer; font-family: inherit; }
.nav a:hover, .nav button:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.nav .pill { background: var(--primary); color: #fff; }
.nav .pill:hover { background: color-mix(in srgb, var(--primary) 85%, black); color: #fff; }
.nav-toggle, .btn.nav-toggle { display: none; }
@media (max-width: 760px) {
  .nav-toggle, .btn.nav-toggle { display: inline-flex; margin-left: auto; }
  .nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-bottom: 10px; }
  .nav.open { display: flex; }
  .site-header .wrap { flex-wrap: wrap; }
}
.badge-dot { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .75rem; text-align: center; margin-left: 4px; }

/* Mise en page */
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.wrap-narrow { width: min(720px, 100% - 32px); margin-inline: auto; }
main { padding: 24px 0 48px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.section { margin: 28px 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; background: var(--primary); color: #fff; line-height: 1.2; text-decoration: none; }
.btn:hover { background: color-mix(in srgb, var(--primary) 85%, black); text-decoration: none; color: #fff; }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: color-mix(in srgb, var(--accent) 85%, black); }
.btn.ghost { background: transparent; color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.btn.ghost:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); color: var(--primary); }
.btn.light { background: var(--bg); color: var(--ink); border-color: var(--line); }
.btn.light:hover { background: var(--line); color: var(--ink); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #962d22; }
.btn.sm { padding: 6px 10px; font-size: .875rem; border-radius: 8px; }
.btn.icon { padding: 8px; border-radius: 50%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn svg, .icon-inline { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-inline { display: inline-block; vertical-align: -3px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; }

/* Formulaires */
label { font-weight: 600; display: block; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field .help { color: var(--muted); font-size: .85rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=url], input[type=tel], input[type=time], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #cbd2dc; border-radius: var(--radius-sm); font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: var(--focus); outline: none; }
textarea { min-height: 120px; resize: vertical; }
input[type=color] { width: 56px; height: 36px; padding: 2px; border: 1px solid #cbd2dc; border-radius: 6px; background: #fff; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.inline-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; margin: 0 0 14px; }
legend { font-weight: 700; padding: 0 6px; }
.required::after { content: " *"; color: var(--danger); }

/* Messages */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 12px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.flash.success { background: #edf8f1; border-color: #bfe3cc; color: #14532d; }
.flash.error { background: #fdf0ee; border-color: #f3c3bc; color: #7f1d1d; }
.flash.info { background: #eef4fb; border-color: #c6d9f0; color: #1e3a5f; }
.flash.warning { background: #fff7e6; border-color: #f3dca8; color: #633c01; }
.notice { padding: 12px 16px; border-radius: 10px; background: #eef4fb; border: 1px solid #c6d9f0; color: #1e3a5f; }
.notice.warn { background: #fff7e6; border-color: #f3dca8; color: #633c01; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }

/* Étiquettes */
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--primary) 10%, white); color: var(--primary); font-size: .85rem; font-weight: 600; margin: 2px 4px 2px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: .85rem; }
.status { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .8rem; font-weight: 700; }
.status.ok { background: #e6f6ec; color: var(--ok); }
.status.warn { background: #fff4e0; color: var(--warn); }
.status.danger { background: #fdecea; color: var(--danger); }
.status.info { background: #e8f0fb; color: var(--info); }
.status.muted { background: #eef0f3; color: var(--ink-soft); }
.stars { color: #e5a500; letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: #d5d9e0; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--card); }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; }
.table tr:hover td { background: #fbfcfd; }
.table td.actions { white-space: nowrap; }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 24px 0; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Pied de page */
.site-footer { border-top: 1px solid var(--line); background: var(--card); padding: 28px 0; color: var(--ink-soft); font-size: .9rem; }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.consent { position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 560px; margin: auto; background: var(--ink); color: #fff; padding: 14px 18px; border-radius: 12px; display: flex; gap: 12px; align-items: center; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.consent p { margin: 0; flex: 1; font-size: .9rem; }
details summary { cursor: pointer; font-weight: 600; }
.sparkline { display: flex; align-items: flex-end; gap: 2px; height: 40px; }
.sparkline i { flex: 1; background: var(--primary); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .85; }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-size: 1.6rem; line-height: 1; }
.kpi span { color: var(--muted); font-size: .85rem; }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); }
.lang-switch { display: inline-flex; gap: 4px; }
.lang-switch a { padding: 4px 8px; border-radius: 6px; font-size: .85rem; }
.lang-switch a.active { background: var(--line); color: var(--ink); }
@media print { .site-header, .site-footer, .no-print, .flash, .consent { display: none !important; } body { background: #fff; } main { padding: 0; } }
.notice.error { background: #fdecec; border-color: #f2c4c4; color: #7a1d1d; }

/* Une carte de grille ne déborde jamais sur sa voisine (contenu long : tableau, nom de fichier) — 1.0.15 */
.grid > * { min-width: 0; overflow-wrap: break-word; }
.table .status, .table th { white-space: nowrap; }
.grid > .full-row { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; max-width: 100%; }
.nowrap { white-space: nowrap; }
