:root {
  --radius: 8px;
  --background: #f7f8fb;
  --foreground: #1b2434;
  --surface: #ffffff;
  --primary: #1f3357;
  --primary-foreground: #f4f6fa;
  --secondary: #eef1f6;
  --muted: #f1f3f7;
  /* Contraste ≥ 4.5:1 sur --background et sur --muted (WCAG AA). */
  --muted-foreground: #5b6680;

  --border: #dfe3ec;
  --ring: #2f9c9a;
  --destructive: #b4272b;
  --shadow-panel: 0 1px 2px rgba(31, 51, 87, .06), 0 12px 32px rgba(31, 51, 87, .08);
  --shadow-pill: 0 1px 2px rgba(31, 51, 87, .12);
}

* { box-sizing: border-box; border-color: var(--border); }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Libre Franklin", system-ui, sans-serif; letter-spacing: -.02em; margin: 0; }
a { color: inherit; }
.wrap { max-width: 1500px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted-foreground); }
.small { font-size: 12px; }
.pad { padding: 16px; }

/* En-tête */
.site-header { position: relative; z-index: 1000; background: var(--primary); color: var(--primary-foreground); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 20px; padding-bottom: 20px; }
.eyebrow { margin: 0; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .16em; color: rgba(244,246,250,.82); }
.site-header h1 { margin-top: 4px; font-size: 28px; font-weight: 600; }

.header-brand { display: flex; align-items: center; gap: 12px; }
.header-logo { display: flex; flex-shrink: 0; line-height: 0; }
.header-logo img { width: 40px; height: 56px; object-fit: contain; }
.header-titles { display: flex; flex-direction: column; }

.stats { display: flex; gap: 24px; text-align: right; margin: 0; }
.stats dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: rgba(244,246,250,.82); }
.stats dd { margin: 0; font-family: "Libre Franklin", sans-serif; font-size: 20px; font-weight: 600; }

.stats-bar { background: var(--muted); border-bottom: 1px solid var(--border); }
.stats-bar .wrap { padding-top: 12px; padding-bottom: 12px; }
.stats-centered { justify-content: center; text-align: center; gap: 40px; }
.stats-centered dt { color: var(--muted-foreground); }
.stats-centered dd { color: var(--foreground); }

/* Filtres */
.filters { background: var(--surface); border-bottom: 1px solid var(--border); }
.filters-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); font-size: 18px; }
.search input, .filters select {
  height: 40px; width: 100%; border: 1px solid var(--border); border-radius: 6px;
  background: var(--background); font: inherit; font-size: 14px; color: inherit; outline: none;
}
.search input { padding: 0 12px 0 32px; }
.filters select { width: auto; min-width: 220px; padding: 0 10px; }
.search input:focus, .filters select:focus { border-color: var(--ring); box-shadow: 0 0 0 2px rgba(47,156,154,.25); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--background);
  color: #2a3550; transition: background-color .15s, color .15s;
}
.chip:hover { background: var(--secondary); }
.chip[aria-pressed="true"] { background: var(--primary); color: var(--primary-foreground); border-color: transparent; }
.chip .dot { width: 8px; height: 8px; border-radius: 999px; }
.chip .count { color: var(--muted-foreground); }
.chip[aria-pressed="true"] .count { color: inherit; opacity: .7; }
.reset { height: 40px; padding: 0 12px; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 500; color: var(--muted-foreground); border-radius: 6px; cursor: pointer; }
.reset:hover { background: var(--secondary); color: var(--foreground); }

/* Carte et liste */
.layout { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 16px; padding-bottom: 16px; align-items: stretch; }
.map-panel { position: relative; flex: 1 1 520px; min-height: 420px; height: calc(100vh - 208px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-panel); overflow: hidden; }
#map { position: absolute; inset: 0; }
.map-note { position: absolute; left: 12px; bottom: 12px; z-index: 500; margin: 0; padding: 6px 10px; border-radius: 6px; background: rgba(255,255,255,.92); box-shadow: var(--shadow-pill); font-size: 11px; color: var(--muted-foreground); max-width: calc(100% - 24px); overflow-wrap: break-word; }
.map-modes { position: absolute; right: 12px; top: 12px; z-index: 500; display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.94); box-shadow: var(--shadow-pill); }
.map-mode { border: 0; cursor: pointer; padding: 5px 12px; border-radius: 999px; background: transparent; font: inherit; font-size: 12px; color: var(--muted-foreground); }
.map-mode:hover { color: var(--foreground); }
.map-mode.is-active { background: var(--foreground, #1f2937); color: #fff; }
.list-panel { display: flex; flex-direction: column; width: 420px; max-width: 100%; flex: 0 1 420px; height: calc(100vh - 208px); min-height: 420px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-panel); overflow: hidden; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.list-head h2 { font-size: 14px; font-weight: 600; }
.list-head span { font-size: 12px; }
.list-body { flex: 1; overflow-y: auto; }
#job-list { list-style: none; margin: 0; padding: 0; }
#job-list li + li { border-top: 1px solid var(--border); }
#job-list a { display: block; padding: 12px 16px; text-decoration: none; }
#job-list a:hover { background: var(--secondary); }
.job-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.job-meta { margin: 4px 0 0; font-size: 12px; color: var(--muted-foreground); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border: 1px solid var(--border); border-radius: 999px; font-size: 11px; font-weight: 500; }
.tag .dot { width: 6px; height: 6px; border-radius: 999px; }
.tag-type { background: var(--muted); color: var(--muted-foreground); border-color: transparent; }

/* Pied de page */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; padding-bottom: 16px; font-size: 12px; color: var(--muted-foreground); }

/* Leaflet */
.leaflet-container { font-family: "IBM Plex Sans", system-ui, sans-serif; background: #e6eaf1; }
.leaflet-popup-content-wrapper { border-radius: var(--radius); box-shadow: var(--shadow-panel); padding: 0; }
.leaflet-popup-content { margin: 0; width: 264px !important; }
.cegep-marker-wrap { background: none; border: 0; }
.cegep-marker {
  display: grid; place-items: center; border-radius: 999px; border: 2px solid var(--surface);
  box-shadow: var(--shadow-pill); background: var(--primary); color: var(--primary-foreground);
  font-family: "Libre Franklin", sans-serif; font-size: 12px; font-weight: 600; width: 100%; height: 100%;
}
.popup { padding: 12px 14px; }
.popup h3 { font-size: 13px; margin-bottom: 2px; }
.popup .popup-sub { font-size: 11px; color: var(--muted-foreground); margin: 0 0 8px; }
.popup ul { list-style: none; margin: 0; padding: 0; max-height: 210px; overflow-y: auto; }
.popup li + li { border-top: 1px solid var(--border); }
.popup li a { display: block; padding: 6px 0; font-size: 12px; text-decoration: none; }
.popup li a:hover { text-decoration: underline; }
.popup .popup-cat { font-size: 10.5px; }
.popup .popup-filter { display: inline-block; margin-top: 8px; font-size: 11px; background: none; border: 0; padding: 0; color: var(--ring); cursor: pointer; }

/* Administration */
.admin-body { background: var(--background); }
.admin-header { background: var(--primary); color: var(--primary-foreground); }
.admin-header .header-inner { padding-top: 16px; padding-bottom: 16px; }
.admin-header a { color: rgba(244,246,250,.85); font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-panel); }
.admin-main { padding-top: 20px; padding-bottom: 40px; display: grid; gap: 16px; }
table.jobs { width: 100%; border-collapse: collapse; font-size: 13px; }
table.jobs th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-foreground); padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.jobs td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.jobs tr:hover td { background: var(--secondary); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; border: 1px solid var(--border); }
.badge-off { background: var(--muted); color: var(--muted-foreground); }
.badge-new { background: #1d4ed8; border-color: #1d4ed8; color: #fff; font-weight: 600; }

input.field, select.field, textarea.field {
  height: 40px; width: 100%; border: 1px solid var(--border); border-radius: 6px; background: var(--background);
  padding: 0 12px; font: inherit; font-size: 13px; color: inherit; outline: none;
}
input.field:focus, select.field:focus { border-color: var(--ring); box-shadow: 0 0 0 2px rgba(47,156,154,.25); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
label.lbl { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-foreground); margin-bottom: 4px; }
.btn { height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 6px; background: var(--primary); color: var(--primary-foreground); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-ghost { background: var(--surface); color: var(--foreground); border-color: var(--border); }
.btn-danger { background: var(--destructive); }
.notice { padding: 10px 14px; border-radius: 6px; font-size: 13px; background: #e8f5f2; color: #14554f; }
.notice-error { background: #fbeaea; color: #8d2124; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.login-wrap { max-width: 380px; margin: 12vh auto; display: grid; gap: 12px; padding: 24px; }

/* Boutons compacts dans le tableau d'administration */
table.jobs .row-actions { flex-wrap: nowrap; }
table.jobs .btn { height: 32px; padding: 0 10px; font-size: 12px; }
table.jobs form { margin: 0; }

/* Navigation et pages textuelles */
.site-nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.site-nav a { padding: 6px 10px; border-radius: 6px; font-size: 14px; font-weight: 500; text-decoration: none; color: rgba(244,246,250,.78); }
.site-nav a:hover { background: rgba(244,246,250,.12); color: var(--primary-foreground); }
.site-nav a[aria-current="page"] { background: rgba(244,246,250,.16); color: var(--primary-foreground); }
.header-home { text-decoration: none; }
.header-title { display: inline-block; margin-top: 4px; font-family: "Libre Franklin", system-ui, sans-serif; font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 14px; }
.page-main { padding-top: 24px; padding-bottom: 40px; }
.prose { max-width: 760px; padding: 32px 36px; overflow-wrap: break-word; word-break: normal; }
.prose * { max-width: 100%; }
.prose p, .prose li, .prose h1, .prose h2, .prose h3, .prose blockquote, .prose td, .prose th { overflow-wrap: break-word; white-space: normal; }
.prose table { display: block; overflow-x: auto; }
.prose h1 { font-size: 30px; margin-bottom: 8px; }
.prose h2 { font-size: 18px; margin: 26px 0 8px; }
.prose h3 { font-size: 15px; margin: 20px 0 6px; }
.prose p, .prose li { font-size: 15px; line-height: 1.65; }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--ring); text-decoration: underline; }
.prose blockquote { margin: 0 0 14px; padding: 8px 16px; border-left: 3px solid var(--ring); color: var(--muted-foreground); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 14px; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.prose img { display: block; height: auto; max-width: 100%; margin: 18px 0; border-radius: 8px; }
.prose figure { margin: 18px 0; }
.prose figcaption { font-size: 13px; color: var(--muted-foreground); margin-top: 6px; }
.prose .page-updated { margin-top: 28px; }

textarea.field.field-area { height: auto; padding: 12px; line-height: 1.6; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; resize: vertical; }
@media (max-width: 720px) {
  .prose { padding: 22px 20px; }
  .header-title { font-size: 22px; }
}

/* Formulaire de contact */
.contact-form { margin-top: 28px; border-top: 1px solid var(--border); padding-top: 20px; }
.contact-form h2 { margin-top: 0; }
.contact-grid { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.contact-form .field { width: 100%; }
.contact-form textarea.field { min-height: 150px; line-height: 1.55; padding: 10px 12px; }
.contact-form input.field-short { max-width: 120px; }
.contact-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Page « Établissements » (carte + liste) */
.inst-intro h1 { font-size: 26px; margin-bottom: 8px; }
.inst-intro p { margin: 0 0 12px; font-size: 15px; line-height: 1.6; }
.inst-legend { display: flex; flex-wrap: wrap; gap: 14px; list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--muted-foreground); }
.inst-legend li { display: flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 999px; display: inline-block; flex: none; }
.inst-map-card { margin-top: 16px; overflow: hidden; padding: 0; }
.inst-map { height: 520px; width: 100%; }
.inst-toolbar { max-width: 420px; margin-bottom: 18px; }
.inst-toolbar .field { width: 100%; }
.inst-list { display: grid; gap: 14px; }
.inst-group { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.inst-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; justify-content: space-between; }
.inst-head h2 { font-size: 16px; }
.inst-head h2 a { text-decoration: none; }
.inst-head h2 a:hover { text-decoration: underline; }
.inst-head p { margin: 4px 0 0; }
.inst-badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.inst-children { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; border-top: 1px solid var(--border); padding-top: 10px; }
.inst-children li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.inst-children a { color: var(--ring); }
.inst-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.inst-check { display: flex; align-items: flex-end; }
.inst-check label.lbl { text-transform: none; letter-spacing: 0; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.inst-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.inst-actions .btn-ghost { display: inline-flex; align-items: center; text-decoration: none; }
.link-danger { border: 0; background: none; padding: 0 0 0 8px; color: var(--destructive); font: inherit; font-size: 13px; cursor: pointer; }
@media (max-width: 700px) { .inst-map { height: 380px; } }

.footer-copy { margin-top: 12px; font-size: 12px; color: var(--muted-foreground); }

/* ---------------------------------------------------------------- */
/* Abonnement aux alertes courriel                                   */
/* ---------------------------------------------------------------- */
.subs-form { margin-top: 18px; display: grid; gap: 18px; }
.subs-form .field-row { margin: 0; }
.subs-form .field { width: 100%; max-width: 420px; }
.subs-form .field-short .field { max-width: 120px; }
.subs-fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 0; }
.subs-fieldset legend { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-foreground); padding: 0 6px; }
.subs-form .hint { font-size: 12px; color: var(--muted-foreground); margin: 4px 0 10px; }
.subs-checks { display: grid; gap: 6px 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.subs-checks-scroll { max-height: 280px; overflow-y: auto; padding-right: 6px; }
.subs-check, .subs-radio { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.subs-radio { margin-right: 18px; display: inline-flex; }
.subs-actions { margin: 0; }
.form-note { border-radius: var(--radius); padding: 12px 14px; font-size: 14px; margin: 16px 0 0; overflow-wrap: break-word; }
.form-note.is-ok { background: rgba(18,137,124,.1); border: 1px solid rgba(18,137,124,.35); }
.form-note.is-error { background: rgba(190,60,60,.08); border: 1px solid rgba(190,60,60,.3); }
.subs-admin-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 16px 0; }
.subs-admin-search { display: flex; gap: 8px; }

.subs-check.is-hidden { display: none; }
[hidden] { display: none !important; }
.list-alert { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0; padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--muted, #f4f5f7); font-size: 13px; }
.list-alert-link { font-weight: 600; white-space: nowrap; }

/* ---------------------------------------------------------------- */
/* Accessibilité                                                     */
/* ---------------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 2000;
  padding: 10px 14px; border-radius: 6px; background: var(--surface); color: var(--foreground);
  font-size: 13px; font-weight: 600; text-decoration: none; box-shadow: var(--shadow-panel);
  transition: top .15s ease-in-out;
}
.skip-link:focus { top: 8px; }
:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}
.site-header :focus-visible, .site-footer a:focus-visible { outline-color: #7fd7d5; }
a:hover { text-decoration: underline; }
.site-nav a, .footer-nav a, .chip, .map-mode, .btn { text-decoration: none; }
#map:focus-visible, .inst-map:focus-visible { outline-offset: -3px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- */
/* Logos des cégeps (page Établissements)                            */
/* ---------------------------------------------------------------- */
.inst-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.inst-identity-text { min-width: 0; }
.inst-logo {
  position: relative; flex: none; width: 40px; height: 40px; border-radius: 999px;
  display: grid; place-items: center; overflow: hidden;
  background: var(--muted); border: 1px solid var(--border);
  font-family: "Libre Franklin", system-ui, sans-serif; font-size: 13px; font-weight: 700;
  color: var(--muted-foreground);
}
.inst-logo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: var(--surface); padding: 4px; border-radius: 999px;
}

/* ---------------------------------------------------------------- */
/* Adaptation mobile                                                 */
/* ---------------------------------------------------------------- */
@media (max-width: 1024px) {
  .map-panel, .list-panel { height: auto; }
  .map-panel { min-height: 60vh; }
  .list-panel { flex: 1 1 100%; width: 100%; max-height: 70vh; }
}
@media (max-width: 820px) {
  .wrap { padding: 0 14px; }
  .header-inner { align-items: flex-start; gap: 10px; padding-top: 14px; padding-bottom: 14px; }
  .site-header h1, .header-title { font-size: 21px; line-height: 1.2; }
  .site-nav { gap: 2px; margin-left: -6px; }
  .site-nav a { padding: 8px 8px; font-size: 13px; }
  .stats-centered { gap: 18px 22px; flex-wrap: wrap; }
  .stats dd { font-size: 17px; }
  .filters-inner { gap: 10px; }
  .search { flex: 1 1 100%; min-width: 0; }
  .filters select { width: 100%; min-width: 0; }
  .chips { width: 100%; gap: 6px; }
  .chip { height: 44px; flex: 1 1 calc(50% - 6px); justify-content: center; font-size: 13px; }
  .reset { width: 100%; height: 44px; border: 1px solid var(--border); }
  .layout { gap: 12px; padding-top: 12px; }
  .map-panel { min-height: 340px; height: 55vh; }
  .list-panel { max-height: none; height: auto; }
  .list-body { max-height: 60vh; }
  .list-alert { flex-wrap: wrap; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .inst-intro h1 { font-size: 21px; }
  .inst-intro p { font-size: 14px; }
  .inst-head { flex-direction: column; }
  .inst-badge { align-self: flex-start; }
  .inst-toolbar { max-width: none; }
  .subs-checks { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  table.jobs { display: block; overflow-x: auto; white-space: nowrap; }
}
@media (max-width: 480px) {
  .chip { flex: 1 1 100%; }
  .inst-logo { width: 34px; height: 34px; font-size: 12px; }
  .inst-logo img { padding: 3px; }
  .site-header h1, .header-title { font-size: 19px; }
}

/* Bouton secondaire (ex. lien de désabonnement) */
.btn-secondary {
  background: #fff;
  color: #1f3357;
  border: 1px solid #c9d0e0;
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: #f2f5fb;
  border-color: #1f3357;
}

/* ---- Espace de gestion : en-tête fixe et menu toujours complet ---- */
.admin-header { position: sticky; top: 0; z-index: 900; box-shadow: 0 2px 10px rgba(15, 23, 42, .18); }
.admin-header .header-inner { align-items: flex-start; gap: 16px; }
.admin-header h1 { font-size: 24px; }
.admin-header .header-inner { flex-wrap: wrap; }
/* Menu d'administration en bandeau plein largeur sous le titre. */
.admin-nav-block { flex: 1 1 100%; order: 3; text-align: left; }
.admin-nav {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid rgba(244, 246, 250, .18);
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 8px 16px;
}
.admin-nav-user { margin: 0; font-size: 14px; color: rgba(244, 246, 250, .7); }

.admin-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px 8px; justify-content: flex-start;
}
.admin-nav a {
  display: inline-block; padding: 5px 10px; border-radius: 999px;
  font-size: 15px; line-height: 1.2; text-decoration: none;
  color: rgba(244, 246, 250, .88); border: 1px solid rgba(244, 246, 250, .22);
}
.admin-nav a:hover { background: rgba(244, 246, 250, .14); color: #fff; }
.admin-nav a.is-active {
  background: var(--primary-foreground, #f4f6fa); color: var(--primary, #1f3357);
  border-color: transparent; font-weight: 600;
}
.admin-body { font-size: 15.5px; }
.admin-main { font-size: 15.5px; }
.admin-main .lbl, .admin-main .small, .admin-main .muted.small { font-size: 13.5px; }
.admin-main table { font-size: 14.5px; }

@media (max-width: 780px) {
  .admin-header { position: static; }
  .admin-nav-block { text-align: left; }
  .admin-nav ul { justify-content: flex-start; }
}

/* ---- Établissements : nombre d'offres actives ---- */
.inst-jobs {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  text-decoration: none; color: var(--primary); background: rgba(47, 156, 154, .16);
  border: 1px solid rgba(47, 156, 154, .35);
}
.inst-jobs:hover { background: rgba(47, 156, 154, .28); }
.inst-jobs-empty {
  color: var(--muted-foreground, #64708a); background: transparent;
  border-color: var(--border); font-weight: 500;
}

/* Pages d'erreur (404, 403, 500…) — ton léger, même charte que le site */
.error-main { padding-top: 40px; padding-bottom: 56px; display: grid; place-items: center; }
.error-card { max-width: 620px; width: 100%; padding: 40px 36px; text-align: center; }
.error-emoji { margin: 0; font-size: 64px; line-height: 1; }
.error-code { margin: 10px 0 0; font-family: "Libre Franklin", system-ui, sans-serif; font-size: 13px; font-weight: 700; letter-spacing: .22em; color: var(--muted-foreground); }
.error-title { font-size: 28px; margin: 6px 0 10px; }
.error-lead { margin: 0 auto; max-width: 44ch; font-size: 15.5px; line-height: 1.6; color: var(--foreground); }
.error-detail { margin-top: 10px; }
.error-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 24px 0 0; }
.error-actions .btn { display: inline-flex; align-items: center; text-decoration: none; }
.error-wink { margin: 22px 0 0; font-size: 13px; color: var(--muted-foreground); font-style: italic; }
@media (max-width: 560px) {
  .error-card { padding: 28px 20px; }
  .error-emoji { font-size: 52px; }
  .error-title { font-size: 23px; }
}


/* Liste des offres sans JavaScript (accessibilité et indexation) */
.job-list-static { list-style: none; margin: 0; padding: 0; }
.job-list-static li { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.job-list-static a { font-weight: 500; }
.job-list-static .muted { display: block; margin-top: 4px; }

/* Compteurs globaux de l'espace de gestion */
.admin-stats { padding: 14px 16px; }
.admin-stats-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 0; }
.admin-stats-grid dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-foreground); }
.admin-stats-grid dd { margin: 4px 0 0; font-family: "Libre Franklin", sans-serif; font-size: 26px; font-weight: 600; color: var(--primary); }

/* Respect des préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---- Page Statistiques publique ---- */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0 0 30px;
}
.stat-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}
.stat-card-label {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted-foreground);
}
.stat-card-value {
  margin: 0;
  font-family: "Libre Franklin", system-ui, sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--foreground);
}
.stat-card-value-sm { font-size: 18px; }
.stat-card-unit {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted-foreground);
}

.scope-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  margin: 0 0 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.scope-btn {
  display: inline-flex;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted-foreground);
}
.scope-btn:hover { background: var(--secondary); color: var(--foreground); }
.scope-btn.is-active { background: var(--primary); color: var(--primary-foreground); }

.stats-table { margin-top: 16px; }
.stats-table td,
.stats-table th { vertical-align: middle; }
.stats-table .dot { display: inline-block; width: 10px; height: 10px; border-radius: 999px; margin-right: 8px; }

/* Graphiques SVG */
.chart { margin: 0; }
.chart-caption {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}
.chart-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.chart-bar {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.chart-bar-label { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-bar-label a { color: inherit; text-decoration: none; }
.chart-bar-label a:hover { text-decoration: underline; }
.chart-bar-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}
.chart-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width .35s ease;
}
.chart-bar-value { font-weight: 600; white-space: nowrap; }

.chart-pie-wrap { max-width: 520px; }
.chart-pie-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
}
.chart-pie {
  flex: 0 0 auto;
  width: 180px;
  height: 180px;
}
.chart-pie-total { font-family: "Libre Franklin", system-ui, sans-serif; font-size: 22px; font-weight: 700; fill: var(--foreground); }
.chart-pie-sub { font-size: 11px; fill: var(--muted-foreground); }
.chart-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 13px;
  flex: 1 1 180px;
}
.chart-legend li { display: flex; align-items: center; gap: 8px; }
.chart-legend-name { flex: 1; }
.chart-legend-value { font-weight: 600; white-space: nowrap; }

.chart-columns {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 180px;
}
.chart-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.chart-column-fill {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: var(--primary);
  transition: height .35s ease;
}
.chart-column-value { font-size: 10px; font-weight: 600; }
.chart-column-label { font-size: 10px; color: var(--muted-foreground); transform: rotate(-35deg); transform-origin: top left; }
.chart-column-label.is-hidden { visibility: hidden; }

@media (max-width: 720px) {
  .chart-bar { grid-template-columns: 1fr; gap: 5px; }
  .chart-bar-label { text-align: left; }
  .chart-pie { width: 140px; height: 140px; }
  .chart-columns { height: 140px; }
}


/* ---- Pages d'atterrissage (/emplois, /emplois/cegep/…, /emplois/categorie/…) ---- */
.landing { display: block; padding-top: 26px; padding-bottom: 56px; }
.crumbs { font-size: 13px; color: var(--muted-foreground); margin-bottom: 14px; }
.crumbs a { color: var(--muted-foreground); }
.landing-title { font-size: 30px; margin: 0 0 8px; }
.landing-lead { margin: 0 0 22px; max-width: 70ch; font-size: 15.5px; line-height: 1.6; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 26px; }
.landing-actions .btn { display: inline-flex; align-items: center; }
.landing-section { margin: 0 0 34px; }
.landing-section h2 { font-size: 19px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.landing-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.landing-card { padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.landing-card a { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.landing-card .muted { display: block; margin-top: 4px; }
.landing-inline { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
.landing .job-list-static { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.landing .job-list-static li:last-child { border-bottom: 0; }
.landing .job-list-static a { overflow-wrap: break-word; }
@media (max-width: 560px) { .landing-title { font-size: 24px; } }


/* Index « Emplois par établissement » : carte avec logo local. */
.landing-grid-logos { gap: 10px; }
.landing-card-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.landing-card-logo .inst-logo { flex: 0 0 auto; }
.landing-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.landing-card-text a { overflow-wrap: break-word; }

/* Logo des campus et collèges constituants (liste des cégeps) */
.inst-child-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
  vertical-align: -4px;
  background: #fff;
}

/* --- Sous-menus du menu principal (survol au bureau, accordéon au mobile) --- */
.nav-toggle { display: none; }
.nav-group { position: relative; display: inline-flex; align-items: center; }
.nav-group-toggle { display: inline-flex; align-items: center; gap: 4px; padding-right: 4px; }
.nav-group-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; min-height: 34px; padding: 0 6px; margin-left: -2px;
  border: 0; border-radius: 6px; background: none; color: inherit; cursor: pointer;
}
.nav-group-btn:hover { background: rgba(244, 246, 250, .12); }
.nav-caret { font-size: 11px; line-height: 1; opacity: .85; transition: transform .15s ease; }
.nav-sub {
  position: absolute; top: 100%; left: 0; z-index: 1001;
  display: none; min-width: 260px; margin: 0; padding: 8px;
  list-style: none; border-radius: 10px;
  background: var(--primary, #12233d);
  border: 1px solid rgba(244, 246, 250, .18);
  box-shadow: 0 12px 28px rgba(9, 16, 28, .35);
}
/* Zone tampon invisible : le pointeur peut descendre du parent vers le sous-menu
   sans que celui-ci se referme. */
.nav-sub::before {
  content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px;
}
.nav-group.is-open > .nav-sub { display: block; }
.nav-sub a {
  display: block; padding: 11px 12px; font-size: 14px; line-height: 1.3;
  border-radius: 6px; white-space: nowrap;
}
.nav-group.is-active > .nav-group-toggle { background: rgba(244, 246, 250, .16); color: var(--primary-foreground); }

/* Le survol n'ouvre le sous-menu que sur un vrai pointeur (souris). */
@media (hover: hover) and (pointer: fine) {
  .nav-group:hover > .nav-sub,
  .nav-group:focus-within > .nav-sub { display: block; }
}

/* ---- Mobile et tablette : menu escamotable avec sous-menus en accordéon ---- */
@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 0 14px;
    border: 1px solid rgba(244, 246, 250, .35); border-radius: 8px;
    background: rgba(244, 246, 250, .08); color: var(--primary-foreground);
    font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  }
  .nav-toggle .nav-toggle-bars {
    display: grid; gap: 3px; width: 16px;
  }
  .nav-toggle .nav-toggle-bars span {
    display: block; height: 2px; border-radius: 2px; background: currentColor;
  }
  .site-nav.site-nav-collapsible {
    display: none; flex: 1 1 100%; width: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    margin: 10px 0 4px; padding-top: 8px;
    border-top: 1px solid rgba(244, 246, 250, .18);
  }
  .site-nav.site-nav-collapsible.is-visible { display: flex; }
  .site-nav > a { padding: 12px 10px; font-size: 15px; }

  .nav-group { position: static; display: flex; flex-wrap: wrap; align-items: center; width: 100%; gap: 4px; }
  .nav-group-toggle { flex: 1 1 auto; padding: 12px 10px; font-size: 15px; }
  .nav-group-btn {
    flex: none; min-width: 48px; min-height: 48px; margin: 0;
    border: 1px solid rgba(244, 246, 250, .22);
  }
  .nav-caret { display: inline-flex; font-size: 13px; }
  .nav-group.is-open .nav-caret { transform: rotate(180deg); }

  .nav-sub {
    position: static; flex: 1 1 100%; width: 100%;
    min-width: 0; margin: 0 0 6px; padding: 2px 0 2px 12px;
    border: 0; border-left: 2px solid rgba(244, 246, 250, .25);
    border-radius: 0; background: none; box-shadow: none;
  }
  .nav-sub::before { display: none; }
  .nav-group.is-open > .nav-sub { display: block; }
  .nav-sub a { padding: 12px 10px; font-size: 14px; white-space: normal; }
  .nav-sub a::before { content: "› "; opacity: .7; }
}


/* --- Régions administratives --- */
.region-grid .region-card { display: flex; align-items: flex-start; gap: 10px; }
.region-number {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--muted, #eef1f6); color: var(--muted-foreground, #56617a);
  font-size: 12px; font-weight: 600;
}
.landing-card-text { display: block; min-width: 0; }
.region-cegep-title { margin: 22px 0 8px; font-size: 16px; }
.region-cegep-title .muted { font-weight: 400; }

/* Section « Méthodologie » de la page Statistiques (contenu éditable). */
.stats-metho { max-width: none; padding: 24px 26px; }
.stats-metho > :first-child { margin-top: 0; }
.stats-metho h2 { font-size: 16px; }
@media (max-width: 640px) { .stats-metho { padding: 18px 16px; } }
