/* ============================================================
   AssoRH — Feuille de style globale
   ============================================================ */

:root {
  --primary:       #185FA5;
  --primary-light: #E6F1FB;
  --primary-dark:  #0C447C;
  --green:         #3B6D11;
  --green-light:   #EAF3DE;
  --amber:         #BA7517;
  --amber-light:   #FAEEDA;
  --red:           #A32D2D;
  --red-light:     #FCEBEB;
  --purple:        #3C3489;
  --purple-light:  #EEEDFE;
  --gray:          #5F5E5A;
  --gray-light:    #F1EFE8;

  --bg:            #F5F5F3;
  --surface:       #FFFFFF;
  --surface2:      #F7F7F5;
  --border:        rgba(0,0,0,0.1);
  --border2:       rgba(0,0,0,0.18);

  --text:          #1a1a18;
  --text2:         #5a5a56;
  --text3:         #9a9a95;

  --radius-sm:     6px;
  --radius:        8px;
  --radius-lg:     12px;
  --radius-xl:     16px;

  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow:        0 2px 8px rgba(0,0,0,.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ---- Typographie ---- */
h1 { font-size: 1.75rem; font-weight: 600; line-height: 1.25; }
h2 { font-size: 1.35rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.1rem;  font-weight: 600; line-height: 1.4; }
h4 { font-size: 0.95rem; font-weight: 600; }
p  { margin-bottom: 0.75rem; }
p:last-child { margin-bottom: 0; }

/* ---- Layout ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 700px; margin: 0 auto; padding: 0 1.5rem; }
.container-xs { max-width: 480px; margin: 0 auto; padding: 0 1.5rem; }

/* ---- Grilles ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 1rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 1rem; }

/* ---- Flex utilitaires ---- */
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ---- Cartes ---- */
.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.card-sm { padding: 0.875rem 1rem; }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-emploi   { background: var(--primary-light); color: var(--primary-dark); }
.badge-civique  { background: var(--green-light);   color: var(--green); }
.badge-urgente  { background: var(--amber-light);   color: var(--amber); }
.badge-interne  { background: var(--gray-light);    color: var(--gray); }
.badge-pourvue  { background: var(--green-light);   color: var(--green); }
.badge-active   { background: var(--primary-light); color: var(--primary-dark); }
.badge-draft    { background: var(--gray-light);    color: var(--gray); }
.badge-cloturee { background: var(--red-light);     color: var(--red); }

/* ---- Boutons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 500;
  cursor: pointer;
  border: 0.5px solid var(--border2);
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface2); text-decoration: none; }
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--primary); color: #fff; border-color: transparent; }
.btn-primary:hover { opacity: 0.88; background: var(--primary); }

.btn-success { background: var(--green-light); color: var(--green); border-color: transparent; font-weight: 600; }
.btn-success:hover { opacity: 0.85; background: var(--green-light); }

.btn-danger  { background: var(--red-light); color: var(--red); border-color: transparent; }

.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.78rem; }
.btn-full { width: 100%; }

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
}
.btn-outline-primary:hover { background: var(--primary-light); }

/* ---- Formulaires ---- */
.form-group { margin-bottom: 1rem; }
.form-group:last-child { margin-bottom: 0; }
label {
  display: block;
  font-size: 0.82rem; font-weight: 500;
  color: var(--text2);
  margin-bottom: 0.3rem;
}
label .req { color: var(--red); margin-left: 2px; }

input[type=text], input[type=email], input[type=tel],
input[type=password], input[type=date], input[type=url],
input[type=number], select, textarea {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 0.5px solid var(--border2);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24,95,165,0.12);
}
textarea { resize: vertical; min-height: 90px; }
select { cursor: pointer; }
.hint { font-size: 0.75rem; color: var(--text3); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.875rem; }

/* ---- Alertes ---- */
.alert {
  display: flex; gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem; line-height: 1.5;
  margin-bottom: 1rem;
}
.alert-info    { background: var(--primary-light); color: var(--primary-dark); }
.alert-success { background: var(--green-light);   color: var(--green); }
.alert-warning { background: var(--amber-light);   color: var(--amber); }
.alert-danger  { background: var(--red-light);     color: var(--red); }

/* ---- Tags / chips ---- */
.tag {
  display: inline-block;
  font-size: 0.72rem; font-weight: 500;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text2);
  border: 0.5px solid var(--border);
}
.tag-comp   { background: var(--primary-light); color: var(--primary-dark); border: none; }
.tag-dipl   { background: var(--green-light);   color: var(--green);        border: none; }
.tag-exp    { background: var(--purple-light);  color: var(--purple);       border: none; }
.tag-dispo  { background: var(--amber-light);   color: var(--amber);        border: none; }

/* ---- KPI cards ---- */
.kpi-card {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
}
.kpi-label { font-size: 0.78rem; color: var(--text3); margin-bottom: 4px; }
.kpi-value { font-size: 1.6rem; font-weight: 600; color: var(--text); }
.kpi-delta { font-size: 0.75rem; margin-top: 2px; }
.delta-up  { color: var(--green); }
.delta-dn  { color: var(--red); }
.delta-neu { color: var(--text3); }

/* ---- Navigation latérale ---- */
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface);
  border-right: 0.5px solid var(--border);
  display: flex; flex-direction: column;
  height: 100vh; position: sticky; top: 0;
}
.sidebar-logo {
  padding: 1.1rem 1rem;
  border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center; gap: 0.6rem;
}
.sidebar-logo-icon {
  width: 32px; height: 32px;
  background: var(--green-light);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--green);
}
.sidebar-logo-text { font-size: 0.9rem; font-weight: 600; }
.sidebar-logo-sub  { font-size: 0.7rem; color: var(--text3); }
.nav-section { padding: 0.75rem 0.5rem 0; }
.nav-section-label {
  font-size: 0.65rem; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text3);
  padding: 0 0.5rem 0.4rem;
}
.nav-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius);
  font-size: 0.82rem; color: var(--text2);
  cursor: pointer; transition: background 0.12s;
  text-decoration: none;
}
.nav-item:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }
.nav-badge {
  margin-left: auto;
  background: var(--red-light); color: var(--red);
  font-size: 0.65rem; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
}

/* ---- Topbar ---- */
.topbar {
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; height: 52px;
  flex-shrink: 0;
}
.topbar-title { font-size: 1rem; font-weight: 600; }

/* ---- Pipeline kanban ---- */
.pipeline { display: flex; gap: 0.75rem; overflow-x: auto; padding-bottom: 0.5rem; }
.pipeline-col { flex: 1; min-width: 155px; }
.pipeline-col-header {
  font-size: 0.75rem; font-weight: 600; color: var(--text2);
  padding-bottom: 0.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.pipeline-count {
  font-size: 0.65rem; padding: 1px 5px; border-radius: 8px;
  background: var(--surface2); color: var(--text3);
}
.pipeline-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.4rem;
  cursor: pointer;
}
.pipeline-card:hover { border-color: var(--border2); }
.pipeline-card-name  { font-size: 0.82rem; font-weight: 600; }
.pipeline-card-sub   { font-size: 0.72rem; color: var(--text2); }
.pipeline-card-date  { font-size: 0.68rem; color: var(--text3); margin-top: 4px; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th {
  padding: 0.6rem 0.875rem;
  text-align: left; font-size: 0.75rem; font-weight: 600;
  color: var(--text2);
  background: var(--surface2);
  border-bottom: 0.5px solid var(--border);
}
td {
  padding: 0.7rem 0.875rem;
  border-bottom: 0.5px solid var(--border);
  color: var(--text);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

/* ---- Upload zone ---- */
.upload-zone {
  border: 1.5px dashed var(--border2);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  background: var(--surface2);
  transition: background 0.15s;
}
.upload-zone:hover { background: var(--gray-light); }
.upload-zone-icon  { font-size: 1.5rem; color: var(--text3); margin-bottom: 6px; }
.upload-zone-label { font-size: 0.85rem; color: var(--text2); }
.upload-zone-hint  { font-size: 0.72rem; color: var(--text3); margin-top: 3px; }

/* ---- Toggle switch ---- */
.toggle-wrap { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0; }
.toggle-wrap:not(:last-child) { border-bottom: 0.5px solid var(--border); }
.toggle-info-label { font-size: 0.85rem; font-weight: 500; }
.toggle-info-sub   { font-size: 0.73rem; color: var(--text3); }
.toggle {
  width: 38px; height: 21px;
  border-radius: 11px;
  background: var(--surface2);
  border: 0.5px solid var(--border2);
  position: relative; cursor: pointer; flex-shrink: 0;
  transition: background 0.2s;
}
.toggle.on { background: var(--green-light); border-color: transparent; }
.toggle-knob {
  position: absolute; top: 3px; left: 3px;
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 0.5px var(--border2);
  transition: left 0.2s;
}
.toggle.on .toggle-knob { left: 20px; }

/* ---- Progress / match bar ---- */
.match-wrap { display: flex; align-items: center; gap: 0.5rem; }
.match-track { flex: 1; height: 5px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.match-fill  { height: 100%; border-radius: 3px; }
.match-pct   { font-size: 0.78rem; font-weight: 600; min-width: 32px; text-align: right; }

/* ---- Stepper ---- */
.stepper { display: flex; align-items: center; margin-bottom: 1.5rem; }
.step { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.step-circle {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  border: 0.5px solid var(--border2);
  color: var(--text3);
  flex-shrink: 0; transition: all 0.2s;
}
.step.active .step-circle { background: var(--primary-light); color: var(--primary-dark); border-color: transparent; }
.step.done   .step-circle { background: var(--green-light);   color: var(--green);        border-color: transparent; }
.step-label  { font-size: 0.78rem; color: var(--text3); }
.step.active .step-label { color: var(--text); font-weight: 600; }
.step-line   { flex: 1; height: 0.5px; background: var(--border); margin: 0 0.5rem; }

/* ---- Progress bar ---- */
.progress-bar { height: 3px; background: var(--surface2); border-radius: 2px; overflow: hidden; margin-bottom: 1.5rem; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width 0.3s; }

/* ---- Empty state ---- */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--text3); font-size: 0.875rem; }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container, .container-sm { padding: 0 1rem; }
  h1 { font-size: 1.4rem; }
}
