/*
 * JobPaw — pages « Statistiques et opportunités » (données publiques agrégées).
 * Tout est préfixé .sp- pour ne pas interférer avec le thème hiredots.
 */
.sp {
  --sp-primary: #0b2f81;
  --sp-accent: #00cde5;
  --sp-ink: #0b182a;
  --sp-muted: #5b6b82;
  --sp-line: #e3e8f2;
  --sp-bg: #f5f7fb;
  --sp-card: #fff;
  --sp-good: #16a34a;
  --sp-warn: #d97706;
  --sp-bad: #dc2626;
  font-family: "Manrope", sans-serif;
  color: var(--sp-ink);
  background: var(--sp-bg);
  padding: 28px 0 56px;
}

.sp *, .sp *::before, .sp *::after { box-sizing: border-box; }

/* ---------- En-tête de page ---------- */
.sp-hero {
  background: linear-gradient(120deg, var(--sp-primary) 0%, #123f9e 60%, #0f6fb8 100%);
  color: #fff;
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.sp-hero::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 205, 229, .35), transparent 70%);
}
.sp-hero h1 { color: #fff; font-size: 28px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.3px; }
.sp-hero p { margin: 0; color: rgba(255, 255, 255, .85); max-width: 860px; font-size: 15px; line-height: 1.55; }
.sp-hero .sp-crumbs { font-size: 13px; margin-bottom: 10px; color: rgba(255, 255, 255, .7); }
.sp-hero .sp-crumbs a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.sp-asof {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 14px; padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); font-size: 12.5px; font-weight: 600;
}

/* ---------- Navigation entre pages de données ---------- */
.sp-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.sp-tabs a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 700;
  background: #fff; color: var(--sp-primary); border: 1px solid var(--sp-line); text-decoration: none;
  transition: .15s;
}
.sp-tabs a:hover { border-color: var(--sp-primary); }
.sp-tabs a.active { background: var(--sp-primary); border-color: var(--sp-primary); color: #fff; }

/* ---------- Filtres ---------- */
.sp-filters {
  background: var(--sp-card); border: 1px solid var(--sp-line); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 20px;
}
.sp-filters label { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--sp-muted); margin-bottom: 4px; display: block; }
.sp-filters select, .sp-filters input[type=search] {
  width: 100%; height: 42px; border: 1px solid var(--sp-line); border-radius: 10px; padding: 0 12px;
  font-size: 14px; background: #fff; color: var(--sp-ink);
}
.sp-filters select:focus, .sp-filters input:focus { outline: 2px solid rgba(11, 47, 129, .25); border-color: var(--sp-primary); }
.sp-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; margin: 4px 6px 0 0;
  border-radius: 999px; background: #eaf1ff; color: var(--sp-primary); font-size: 12.5px; font-weight: 700;
}
.sp-chip a { color: inherit; text-decoration: none; opacity: .7; }
.sp-chip a:hover { opacity: 1; }

/* ---------- KPI ---------- */
.sp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); gap: 14px; margin-bottom: 20px; }
.sp-kpi {
  background: var(--sp-card); border: 1px solid var(--sp-line); border-radius: 14px; padding: 16px 18px;
  position: relative; overflow: hidden;
}
.sp-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--k, var(--sp-primary)); }
.sp-kpi .sp-kpi-label { font-size: 12px; font-weight: 700; color: var(--sp-muted); text-transform: uppercase; letter-spacing: .5px; }
.sp-kpi .sp-kpi-value { font-size: 28px; font-weight: 800; line-height: 1.15; margin: 4px 0 2px; color: var(--sp-ink); font-variant-numeric: tabular-nums; }
.sp-kpi .sp-kpi-sub { font-size: 12.5px; color: var(--sp-muted); }

/* ---------- Cartes ---------- */
.sp-card { background: var(--sp-card); border: 1px solid var(--sp-line); border-radius: 14px; margin-bottom: 20px; }
.sp-card-head { padding: 16px 20px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.sp-card-head h2 { font-size: 17px; font-weight: 800; margin: 0; color: var(--sp-ink); }
.sp-card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--sp-muted); }
.sp-card-body { padding: 14px 20px 18px; }
.sp-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--sp-line); background: #fff; color: var(--sp-primary);
  font-size: 12.5px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.sp-btn:hover { border-color: var(--sp-primary); }
.sp-btn.on { background: var(--sp-primary); color: #fff; border-color: var(--sp-primary); }
.sp-toggle { display: inline-flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }

/* ---------- Lecture rapide ---------- */
.sp-insights {
  background: #fff; border: 1px solid var(--sp-line); border-left: 4px solid var(--sp-accent);
  border-radius: 14px; padding: 16px 22px; margin-bottom: 20px;
}
.sp-insights h2 { font-size: 16px; font-weight: 800; margin: 0 0 8px; }
.sp-insights ul { margin: 0; padding-left: 20px; }
.sp-insights li { margin: 5px 0; line-height: 1.5; font-size: 14.5px; }

/* ---------- Tableaux ---------- */
.sp-table-tools { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sp-table-tools input[type=search] { width: 280px; max-width: 100%; height: 38px; border: 1px solid var(--sp-line); border-radius: 10px; padding: 0 12px; font-size: 14px; }
.sp-table-wrap { overflow-x: auto; border: 1px solid var(--sp-line); border-radius: 10px; }
.sp-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.sp-table th { background: #f1f4fa; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--sp-muted); padding: 10px 12px; text-align: left; white-space: nowrap; cursor: pointer; user-select: none; }
.sp-table th.num, .sp-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sp-table th[data-dir="asc"]::after { content: " ▲"; font-size: 9px; }
.sp-table th[data-dir="desc"]::after { content: " ▼"; font-size: 9px; }
.sp-table td { padding: 9px 12px; border-top: 1px solid var(--sp-line); vertical-align: top; }
.sp-table tbody tr:hover td { background: #f8faff; }
.sp-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--sp-muted); flex-wrap: wrap; }
.sp-pager select { height: 34px; border: 1px solid var(--sp-line); border-radius: 8px; padding: 0 8px; }
.sp-bar-cell { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.sp-bar-cell .b { flex: none; height: 8px; border-radius: 4px; background: var(--sp-primary); min-width: 2px; }
.sp-bar-cell span { font-size: 12.5px; color: var(--sp-muted); white-space: nowrap; }

/* ---------- Heatmap (tableau croisé) ---------- */
.sp-heat-wrap { overflow-x: auto; }
.sp-heat { border-collapse: separate; border-spacing: 2px; font-size: 12.5px; }
.sp-heat th { font-weight: 700; padding: 6px 8px; white-space: nowrap; text-align: left; color: var(--sp-ink); }
.sp-heat th.col { writing-mode: vertical-rl; transform: rotate(180deg); text-align: right; max-height: 210px; }
.sp-heat td { min-width: 46px; height: 34px; text-align: center; border-radius: 6px; font-variant-numeric: tabular-nums; font-weight: 600; }
.sp-legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--sp-muted); margin-top: 10px; }
.sp-legend i { display: inline-block; width: 160px; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #eef3ff, #0b2f81); }

/* ---------- Divers ---------- */
.sp-note { font-size: 12.5px; color: var(--sp-muted); line-height: 1.55; }
.sp-method {
  background: #fff; border: 1px dashed #c9d3e6; border-radius: 12px; padding: 14px 18px;
  font-size: 13px; color: var(--sp-muted); line-height: 1.6; margin-bottom: 20px;
}
.sp-method b { color: var(--sp-ink); }
.sp-empty { text-align: center; padding: 36px 12px; color: var(--sp-muted); font-size: 14px; }
.sp-badge { white-space: nowrap; display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; }
.sp-badge.good { background: #dcfce7; color: #166534; }
.sp-badge.warn { background: #fef3c7; color: #92400e; }
.sp-badge.bad { background: #fee2e2; color: #991b1b; }
.sp-badge.neutral { background: #e8eefb; color: var(--sp-primary); }
.sp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.sp-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.sp-grid-2 > .sp-card, .sp-grid-3 > .sp-card { margin-bottom: 0; }
.sp-grid-2, .sp-grid-3 { margin-bottom: 20px; }
@media (max-width: 991px) {
  .sp-grid-2, .sp-grid-3 { grid-template-columns: 1fr; }
  .sp-hero { padding: 22px 20px; }
  .sp-hero h1 { font-size: 22px; }
}
.sp-source { font-size: 12px; color: var(--sp-muted); margin-top: 8px; }

/* ---------- Carte du pays (page d'accueil des statistiques) ---------- */
.sp-map-wrap { position: relative; }
.sp-map-wrap svg { width: 100%; height: auto; }
.sp-bubble { fill: rgba(11, 47, 129, .55); stroke: #fff; stroke-width: 2; transition: r .35s, fill .2s; cursor: pointer; }
.sp-bubble:hover { fill: rgba(0, 205, 229, .85); }
.sp-pop {
  position: absolute; z-index: 20; background: #fff; border: 1px solid var(--sp-line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(11, 24, 42, .18); padding: 14px 16px; width: 280px; display: none; font-size: 13.5px;
}
.sp-pop h3 { margin: 0 0 8px; font-size: 16px; font-weight: 800; }
.sp-pop dl { margin: 0 0 10px; display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; }
.sp-pop dt { color: var(--sp-muted); font-weight: 600; }
.sp-pop dd { margin: 0; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.sp-pop a { display: block; padding: 6px 0; font-weight: 700; color: var(--sp-primary); text-decoration: none; border-top: 1px solid var(--sp-line); }

/* ---------- Bibliothèque de documents ---------- */
.sp-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.sp-doc { background: #fff; border: 1px solid var(--sp-line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.sp-doc h3 { font-size: 15px; font-weight: 800; margin: 0; line-height: 1.35; }
.sp-doc .meta { font-size: 12px; color: var(--sp-muted); display: flex; flex-wrap: wrap; gap: 6px 12px; }
.sp-doc .resume { font-size: 13px; color: #324058; line-height: 1.5; max-height: 4.5em; overflow: hidden; }
.sp-doc.open .resume { max-height: none; }
.sp-doc .actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.sp-ext { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; background: #e8eefb; color: var(--sp-primary); text-transform: uppercase; }

@media print {
  .sp-filters, .sp-tabs, .sp-btn, .sp-table-tools, .sp-pager { display: none !important; }
  .sp { background: #fff; }
}
