/* =========================================
   منصة الوظائف بالمغرب — Style global
   Style clair, vert, cards pastel
   ========================================= */

:root {
  --bg: #f8fafc;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #94a3b8;
  --primary: #16a34a;
  --primary-2: #15803d;
  --primary-dark: #166534;
  --accent: #059669;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 3px rgba(15,23,42,.08);
  --shadow: 0 4px 16px -4px rgba(15,23,42,.1);
  --shadow-lg: 0 10px 40px -10px rgba(15,23,42,.18);
}

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

html, body {
  font-family: 'Tajawal', 'Cairo', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  direction: rtl;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Background neutre — pas de gradient global */
.bg-gradient { display: none; }

/* =========================
   HEADER
   ========================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(15,23,42,.04);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white; border-radius: 12px;
  font-weight: 800; font-size: 22px;
  font-family: 'Cairo', sans-serif;
  box-shadow: 0 6px 20px -6px rgba(22,163,74,.5);
}
.brand-title { font-weight: 800; font-size: 18px; font-family: 'Cairo', sans-serif; color: var(--text); }
.brand-sub { font-size: 12px; color: var(--text-2); }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  padding: 10px 16px; border-radius: 10px;
  color: var(--text-2); font-weight: 600; font-size: 14px;
  transition: all .2s ease;
}
.main-nav a:hover { color: var(--primary); background: rgba(22,163,74,.08); }
.main-nav a.active {
  color: var(--primary);
  background: rgba(22,163,74,.1);
}

.mobile-toggle {
  display: none;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); padding: 8px 12px;
  border-radius: 10px; font-size: 18px; cursor: pointer;
}

/* =========================
   BUTTONS
   ========================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 22px;
  border-radius: 10px; font-weight: 700; font-size: 14px;
  border: 1px solid transparent; cursor: pointer;
  transition: all .2s ease; font-family: inherit;
  white-space: nowrap;
}
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px -4px rgba(22,163,74,.5);
}
.btn-primary:hover { background: var(--primary-2); transform: translateY(-1px); box-shadow: 0 8px 20px -6px rgba(22,163,74,.6); }
.btn-ghost {
  background: white; color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: white; }
.btn-block { width: 100%; }

/* =========================
   HERO (homepage) — bannière verte
   ========================= */
.hero {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 60%, #166534 100%);
  color: white;
  padding: 80px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(255,255,255,.08) 0%, transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(255,255,255,.06) 0%, transparent 50%);
  pointer-events: none;
}
.hero > .container { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
  padding: 8px 18px; border-radius: 999px;
  font-size: 13px; color: white; font-weight: 600;
  margin-bottom: 22px; backdrop-filter: blur(10px);
}
.hero-badge .dot { width: 8px; height: 8px; background: #4ade80; border-radius: 50%; box-shadow: 0 0 0 4px rgba(74,222,128,.3); }
.hero h1 {
  font-family: 'Cairo', sans-serif;
  font-size: clamp(38px, 5.5vw, 64px);
  font-weight: 800; line-height: 1.15;
  color: white;
  margin-bottom: 22px;
  letter-spacing: -0.02em;
}
.hero p { color: rgba(255,255,255,.9); font-size: 18px; max-width: 720px; margin: 0 auto 36px; line-height: 1.6; }
.hero-actions {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.btn-hero-primary {
  background: white; color: var(--primary-dark);
  padding: 14px 26px; font-size: 15px;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.3);
}
.btn-hero-primary:hover { background: #f8fafc; transform: translateY(-2px); }
.btn-hero-ghost {
  background: rgba(255,255,255,.12); color: white;
  border: 1px solid rgba(255,255,255,.3);
  padding: 14px 26px; font-size: 15px;
  backdrop-filter: blur(10px);
}
.btn-hero-ghost:hover { background: rgba(255,255,255,.2); }

/* Stats — cartes pastel */
.hero-stats-wrap {
  margin-top: -60px; position: relative; z-index: 2;
  padding: 0 24px;
}
.hero-stats {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 16px; max-width: 1280px; margin: 0 auto;
}
.stat {
  background: white;
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
  transition: all .2s ease;
  position: relative;
  overflow: hidden;
}
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 18px;
  margin-bottom: 4px;
}
.stat-num {
  font-family: 'Cairo', sans-serif; font-weight: 800;
  font-size: 32px;
  color: var(--text);
  line-height: 1;
}
.stat-label { font-size: 13px; color: var(--text-2); font-weight: 600; }

.stat.c-emerald { background: linear-gradient(135deg, #ecfdf5, #ffffff); }
.stat.c-emerald .stat-icon { background: #d1fae5; color: #059669; }
.stat.c-blue { background: linear-gradient(135deg, #eff6ff, #ffffff); }
.stat.c-blue .stat-icon { background: #dbeafe; color: #2563eb; }
.stat.c-amber { background: linear-gradient(135deg, #fffbeb, #ffffff); }
.stat.c-amber .stat-icon { background: #fef3c7; color: #d97706; }
.stat.c-purple { background: linear-gradient(135deg, #faf5ff, #ffffff); }
.stat.c-purple .stat-icon { background: #ede9fe; color: #7c3aed; }
.stat.c-pink { background: linear-gradient(135deg, #fdf2f8, #ffffff); }
.stat.c-pink .stat-icon { background: #fce7f3; color: #db2777; }
.stat.c-rose { background: linear-gradient(135deg, #fff1f2, #ffffff); }
.stat.c-rose .stat-icon { background: #ffe4e6; color: #e11d48; }

/* =========================
   SECTION HEADERS
   ========================= */
.section { padding: 70px 0; }
.section.section-tight { padding: 40px 0; }
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 32px; flex-wrap: wrap; gap: 12px;
}
.section-title {
  font-family: 'Cairo', sans-serif;
  font-size: 28px; font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.section-sub { color: var(--text-2); font-size: 15px; margin-top: 4px; }
.section-link {
  color: var(--primary); font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: gap .2s;
}
.section-link:hover { gap: 10px; }

.badge-cat {
  display: inline-block;
  font-size: 13px; font-weight: 700;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(22,163,74,.1); color: var(--primary);
}

/* =========================
   GRID OFFRES (cards style référence)
   ========================= */
.offres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 24px;
}

.offre-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all .25s ease;
  display: flex; flex-direction: column;
  position: relative;
}
.offre-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(22,163,74,.3);
}

.offre-photo {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}
.offre-photo img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.offre-card:hover .offre-photo img { transform: scale(1.06); }
.offre-photo-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--primary); font-size: 70px;
  font-family: 'Cairo', sans-serif; opacity: .4;
}
.offre-cat-badge {
  position: absolute; top: 14px; right: 14px;
  background: white;
  padding: 6px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.offre-logo {
  position: absolute; bottom: -22px; left: 16px;
  width: 56px; height: 56px;
  background: white; border: 2px solid white;
  border-radius: 14px; padding: 6px;
  display: grid; place-items: center; overflow: hidden;
  box-shadow: var(--shadow);
}
.offre-logo img { width: 100%; height: 100%; object-fit: contain; }

.offre-body {
  padding: 30px 18px 18px; flex: 1;
  display: flex; flex-direction: column;
}
.offre-title {
  font-family: 'Cairo', sans-serif;
  font-size: 17px; font-weight: 700; line-height: 1.4;
  margin-bottom: 8px; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.offre-etablissement {
  color: var(--text-2); font-size: 14px;
  margin-bottom: 14px; font-weight: 500;
}
.offre-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px;
}
.meta-item {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-2);
  padding: 5px 10px; border-radius: 8px;
  font-size: 12px; color: var(--text-2);
  font-weight: 600;
}
.meta-item.salaire { color: #047857; background: #d1fae5; }
.meta-item.delai { color: #b45309; background: #fef3c7; }

.offre-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.offre-stats { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); }
.offre-stat { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.offre-link {
  color: var(--primary); font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; gap: 4px;
  transition: gap .2s;
}
.offre-link:hover { gap: 8px; }

/* Couleurs badges par catégorie */
.cat-public { background: #dbeafe !important; color: #1e40af !important; }
.cat-prive { background: #d1fae5 !important; color: #065f46 !important; }
.cat-collectivite { background: #fef3c7 !important; color: #92400e !important; }
.cat-etranger { background: #ede9fe !important; color: #5b21b6 !important; }

/* =========================
   OFFRE DETAIL PAGE
   ========================= */
.offre-detail {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; margin-bottom: 30px;
  box-shadow: var(--shadow);
}
.detail-photo {
  position: relative; height: 360px; overflow: hidden;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.detail-body { padding: 36px; }
.detail-header {
  display: flex; align-items: center; gap: 20px; margin-bottom: 24px;
  padding-bottom: 24px; border-bottom: 1px solid var(--border);
}
.detail-logo {
  width: 84px; height: 84px; flex-shrink: 0;
  background: white; border: 1px solid var(--border);
  border-radius: 16px; padding: 8px;
  display: grid; place-items: center; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.detail-logo img { width: 100%; height: 100%; object-fit: contain; }
.detail-title {
  font-family: 'Cairo', sans-serif;
  font-size: 30px; font-weight: 800; line-height: 1.3;
  margin-bottom: 8px; color: var(--text);
}
.detail-etablissement { color: var(--text-2); font-size: 16px; font-weight: 500; }

.detail-info-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 28px;
}
.info-item {
  background: var(--surface-2);
  padding: 14px 16px; border-radius: var(--radius-sm);
}
.info-label { font-size: 12px; color: var(--text-2); margin-bottom: 4px; font-weight: 600; }
.info-value { font-size: 14px; font-weight: 700; color: var(--text); }

.detail-section { margin-bottom: 28px; }
.detail-section h3 {
  font-family: 'Cairo', sans-serif;
  font-size: 20px; font-weight: 800;
  margin-bottom: 14px; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.detail-section h3::before {
  content: ''; width: 5px; height: 24px;
  background: var(--primary);
  border-radius: 3px;
}
.detail-content {
  background: var(--surface-2);
  padding: 22px; border-radius: var(--radius-sm);
  color: var(--text); line-height: 1.85;
}
.detail-content p { margin-bottom: 10px; }
.detail-content ul, .detail-content ol { padding-right: 24px; margin-bottom: 10px; }

.detail-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 28px; padding-top: 24px;
  border-top: 1px solid var(--border);
}

.like-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px;
  background: white; border: 1px solid var(--border);
  color: var(--text); cursor: pointer; font-size: 14px; font-weight: 700;
  transition: all .2s ease; font-family: inherit;
}
.like-btn:hover { border-color: #fca5a5; color: #dc2626; background: #fef2f2; }
.like-btn.liked {
  background: #fef2f2; border-color: #fca5a5;
  color: #dc2626;
}
.like-btn .heart { font-size: 18px; }

/* =========================
   COMMENTAIRES
   ========================= */
.comments-section {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  box-shadow: var(--shadow-sm);
}
.comments-section h3 {
  font-family: 'Cairo', sans-serif;
  font-size: 22px; margin-bottom: 22px; font-weight: 800;
}
.comment-form {
  background: var(--surface-2);
  padding: 22px; border-radius: var(--radius-sm);
  margin-bottom: 26px;
}
.comment-form .row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 12px;
}
.comment-list { display: flex; flex-direction: column; gap: 14px; }
.comment {
  background: var(--surface-2);
  padding: 18px; border-radius: var(--radius-sm);
}
.comment-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.comment-author {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700;
}
.comment-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  display: grid; place-items: center; color: white; font-weight: 800;
}
.comment-time { font-size: 12px; color: var(--text-2); }
.comment-body { color: var(--text); line-height: 1.7; }

/* =========================
   FORMS
   ========================= */
form label {
  display: block; margin-bottom: 6px; margin-top: 16px;
  font-weight: 700; font-size: 14px; color: var(--text);
}
form input[type=text], form input[type=email], form input[type=tel],
form input[type=date], form input[type=password], form input[type=url],
form input[type=number], form select, form textarea {
  width: 100%; padding: 12px 14px;
  background: white; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit;
  transition: all .2s;
}
form input:focus, form select:focus, form textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,163,74,.15);
}
form textarea { min-height: 120px; resize: vertical; }
form input[type=file] { padding: 8px; cursor: pointer; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* =========================
   ALERTS
   ========================= */
.alert {
  padding: 14px 18px; border-radius: 10px;
  margin: 14px 0; font-weight: 600; font-size: 14px;
  border: 1px solid;
}
.alert-success { background: #ecfdf5; border-color: #6ee7b7; color: #065f46; }
.alert-error { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.alert-info { background: #eff6ff; border-color: #93c5fd; color: #1e40af; }

/* =========================
   ADMIN
   ========================= */
.admin-layout {
  display: grid; grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: var(--bg);
}
.admin-sidebar {
  background: white; border-left: 1px solid var(--border);
  padding: 24px 18px;
}
.admin-sidebar .brand { margin-bottom: 30px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  color: var(--text-2); font-weight: 600; font-size: 14px;
  margin-bottom: 4px; transition: all .2s;
}
.admin-nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-nav a.active {
  background: rgba(22,163,74,.1);
  color: var(--primary);
}
.admin-main { padding: 32px; }
.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px;
}
.admin-header h1 { font-family: 'Cairo', sans-serif; font-size: 28px; font-weight: 800; }

/* Admin login */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 30px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
}
.login-card {
  background: white; border: 1px solid var(--border);
  padding: 40px; border-radius: var(--radius);
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-card .brand { justify-content: center; margin-bottom: 24px; }
.login-card h2 { text-align: center; margin-bottom: 20px; font-family: 'Cairo', sans-serif; font-weight: 800; }

/* Admin table */
.admin-table-wrap {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 14px 16px; text-align: right;
  border-bottom: 1px solid var(--border);
}
.admin-table th {
  background: var(--surface-2); font-weight: 700;
  font-size: 13px; color: var(--text-2);
}
.admin-table tr:hover td { background: #f8fafc; }
.admin-table .row-img { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; }
.admin-table .actions { display: flex; gap: 8px; }
.admin-table .badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}

.admin-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.admin-stat {
  background: white; border: 1px solid var(--border);
  padding: 22px; border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.admin-stat-label { color: var(--text-2); font-size: 13px; margin-bottom: 6px; font-weight: 600; }
.admin-stat-value {
  font-family: 'Cairo', sans-serif; font-size: 32px; font-weight: 800;
  color: var(--primary);
}

.form-card {
  background: white; border: 1px solid var(--border);
  padding: 32px; border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* TinyMCE */
.tox-tinymce { border-radius: 10px !important; border-color: var(--border) !important; }

/* =========================
   FOOTER
   ========================= */
.site-footer {
  margin-top: 80px;
  background: white; border-top: 1px solid var(--border);
  padding: 50px 0 0;
}
.footer-inner {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}
.site-footer h4 { font-family: 'Cairo', sans-serif; margin-bottom: 14px; font-size: 16px; font-weight: 800; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a, .footer-links li { color: var(--text-2); font-size: 14px; transition: color .2s; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom {
  margin-top: 40px; padding: 22px 0;
  border-top: 1px solid var(--border);
  text-align: center; color: var(--text-2); font-size: 13px;
  background: var(--surface-2);
}

/* =========================
   SETUP PAGE
   ========================= */
.setup-body {
  display: grid; place-items: center; min-height: 100vh; padding: 30px;
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
}
.setup-card {
  background: white; border: 1px solid var(--border);
  padding: 36px; border-radius: var(--radius); max-width: 500px;
  box-shadow: var(--shadow-lg);
}
.setup-card h1 { font-family: 'Cairo', sans-serif; margin-bottom: 8px; font-weight: 800; }
.setup-links { display: flex; gap: 10px; margin-top: 18px; }
.setup-card code {
  background: var(--surface-2); padding: 2px 8px; border-radius: 6px;
  font-family: monospace; color: #dc2626;
}

/* =========================
   UTILITIES
   ========================= */
.muted { color: var(--text-2); }
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-2);
  background: white; border-radius: var(--radius);
  border: 1px solid var(--border);
}
.empty-state .icon { font-size: 60px; margin-bottom: 14px; opacity: .4; }
.empty-state h3 { color: var(--text); margin-bottom: 8px; font-family: 'Cairo', sans-serif; }

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 1100px) {
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: white; flex-direction: column; padding: 14px;
    border-bottom: 1px solid var(--border); }
  .main-nav.open { display: flex; }
  .mobile-toggle { display: block; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { padding: 16px; }
  .admin-nav { display: flex; gap: 6px; overflow-x: auto; }
  .admin-nav a { white-space: nowrap; margin-bottom: 0; }
  .admin-main { padding: 18px; }
  .detail-header { flex-direction: column; text-align: center; }
  .comment-form .row { grid-template-columns: 1fr; }
  .hero { padding: 60px 0 80px; }
  .hero-stats-wrap { margin-top: -50px; }
}

/* =========================
   OFFRE PAGE — Hero & Layout responsive
   ========================= */
.offre-hero {
  position: relative;
  min-height: 320px;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: white;
  overflow: hidden;
  padding: 30px 0 36px;
}
.offre-hero.cat-public-bg { background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%); }
.offre-hero.cat-prive-bg { background: linear-gradient(135deg, #16a34a 0%, #15803d 100%); }
.offre-hero.cat-collectivite-bg { background: linear-gradient(135deg, #d97706 0%, #92400e 100%); }
.offre-hero.cat-etranger-bg { background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%); }

.offre-hero-photo {
  position: absolute; inset: 0;
  z-index: 0;
}
.offre-hero-photo img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0.35;
}
.offre-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.2) 0%, rgba(0,0,0,.55) 100%);
}
.offre-hero-inner {
  position: relative; z-index: 2;
}
.back-btn {
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,.18);
  color: white; padding: 8px 16px;
  border-radius: 999px; font-size: 13px; font-weight: 600;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.25);
  transition: all .2s;
}
.back-btn:hover { background: rgba(255,255,255,.28); }
.offre-hero-cat { margin: 18px 0 16px; }
.offre-hero-cat .offre-cat-badge {
  position: static;
  background: rgba(255,255,255,.95);
  font-size: 13px; padding: 7px 16px;
}
.offre-hero-head {
  display: flex; gap: 18px; align-items: center;
  margin-bottom: 22px;
}
.offre-hero-logo {
  width: 80px; height: 80px; flex-shrink: 0;
  background: white; border: 3px solid white;
  border-radius: 18px; padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  display: grid; place-items: center; overflow: hidden;
}
.offre-hero-logo img { width: 100%; height: 100%; object-fit: contain; }
.offre-hero-text { flex: 1; min-width: 0; }
.offre-hero-title {
  font-family: 'Cairo', sans-serif;
  font-size: clamp(22px, 4.2vw, 36px);
  font-weight: 800; line-height: 1.25;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,.2);
  word-wrap: break-word;
}
.offre-hero-etab {
  font-size: 16px; color: rgba(255,255,255,.92);
  font-weight: 500;
}
.offre-hero-stats {
  display: flex; gap: 18px; flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.2);
}
.hstat {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: rgba(255,255,255,.95);
}
.hstat strong { font-weight: 800; font-size: 16px; }

/* Quick info grid : pleine largeur sur mobile */
.quick-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.quick-info {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: all .2s;
}
.quick-info:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.qi-icon {
  width: 42px; height: 42px; flex-shrink: 0;
  background: var(--surface-2);
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 20px;
}
.qi-label { font-size: 12px; color: var(--text-2); font-weight: 600; margin-bottom: 2px; }
.qi-value { font-weight: 700; font-size: 14px; color: var(--text); word-break: break-word; }
.quick-info.qi-success { background: linear-gradient(135deg, #ecfdf5, white); border-color: #a7f3d0; }
.quick-info.qi-success .qi-icon { background: #d1fae5; }
.quick-info.qi-info { background: linear-gradient(135deg, #eff6ff, white); border-color: #bfdbfe; }
.quick-info.qi-info .qi-icon { background: #dbeafe; }
.quick-info.qi-warn { background: linear-gradient(135deg, #fffbeb, white); border-color: #fde68a; }
.quick-info.qi-warn .qi-icon { background: #fef3c7; }

/* Contenu */
.offre-content {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

/* Contact info */
.contact-info {
  display: flex; flex-direction: column; gap: 10px;
}
.contact-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all .2s;
}
a.contact-row:hover { background: #ecfdf5; }
.ci-icon {
  width: 42px; height: 42px;
  background: white;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 20px; flex-shrink: 0;
}
.ci-label { font-size: 12px; color: var(--text-2); font-weight: 600; margin-bottom: 2px; }
.ci-value { font-weight: 700; font-size: 14px; word-break: break-all; }

/* Action bar : sticky en bas sur mobile */
.action-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  align-items: center;
}
.btn-action { flex: 1; min-width: 120px; }

.like-btn.pulse { animation: pulse-anim .4s ease; }
@keyframes pulse-anim {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* =========================
   MOBILE : pleine largeur
   ========================= */
@media (max-width: 768px) {
  .container { padding: 0 14px; }
  .offre-hero { padding: 20px 0 28px; min-height: 280px; }
  .offre-hero-head { flex-direction: row; gap: 14px; }
  .offre-hero-logo { width: 64px; height: 64px; border-radius: 14px; }
  .offre-hero-stats { gap: 12px; }
  .hstat { font-size: 13px; }
  .hstat strong { font-size: 15px; }

  .quick-info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .quick-info {
    padding: 12px 14px;
    border-radius: 12px;
  }
  .qi-icon { width: 38px; height: 38px; font-size: 18px; }

  .offre-content {
    padding: 18px 16px;
    border-radius: 14px;
    margin: 0 -2px 20px;
  }
  .detail-section { margin-bottom: 22px; }
  .detail-section h3 { font-size: 17px; }
  .detail-content { padding: 16px 14px; font-size: 14px; line-height: 1.75; }

  .comments-section {
    padding: 18px 16px;
    border-radius: 14px;
  }
  .comments-section h3 { font-size: 18px; }

  /* Action bar : pas de fixation sur mobile */
  .action-bar {
    position: static;
    border-radius: 14px;
    padding: 10px;
  }
  .btn-action {
    padding: 11px 14px;
    font-size: 13px;
    min-width: 90px;
  }
  .like-btn { padding: 11px 14px; font-size: 13px; }

  .contact-row { padding: 12px 14px; }
  .ci-icon { width: 38px; height: 38px; font-size: 18px; }

  .section { padding: 30px 0; }
  .section.section-tight { padding: 24px 0; }
}

/* =========================
   JOB CARD — Style liste horizontale
   ========================= */
.offres-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 920px;
  margin: 0 auto;
}

.job-card {
  display: block;
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: all .2s ease;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.job-card:hover {
  border-color: rgba(22,163,74,.4);
  box-shadow: 0 8px 24px -8px rgba(22,163,74,.2);
  transform: translateY(-2px);
}

.job-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 14px;
}
.job-card-title-wrap { flex: 1; min-width: 0; }
.job-card-title {
  font-family: 'Cairo', sans-serif;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
  word-wrap: break-word;
}
.job-card:hover .job-card-title { color: var(--primary); }

.job-card-logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.job-card-logo img {
  width: 100%; height: 100%;
  object-fit: contain;
}
.job-card-logo.placeholder {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-color: #a7f3d0;
}
.job-card-logo.placeholder span {
  font-family: 'Cairo', sans-serif;
  font-weight: 800;
  font-size: 26px;
  color: var(--primary-2);
}

.job-card-desc {
  padding: 0 22px 16px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.85;
  background: #f8fafc;
  margin: 0 16px 16px;
  border-radius: 10px;
  padding: 14px 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.job-badge {
  display: inline-block;
  padding: 7px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid transparent;
}
.job-badge.cat-public { background: #dbeafe; color: #1e40af; }
.job-badge.cat-prive { background: #d1fae5; color: #065f46; }
.job-badge.cat-collectivite { background: #fef3c7; color: #92400e; }
.job-badge.cat-etranger { background: #ede9fe; color: #5b21b6; }

.job-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-2);
  font-size: 13px;
}
.job-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.job-meta-num { font-weight: 700; color: var(--text); }
.job-meta-icon { font-size: 14px; opacity: .75; }
.job-meta-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-right: 4px;
}

@media (max-width: 640px) {
  .offres-list { gap: 12px; }
  .job-card-head { padding: 14px 14px 10px; gap: 12px; }
  .job-card-title { font-size: 15px; line-height: 1.5; }
  .job-card-logo { width: 46px; height: 46px; border-radius: 9px; }
  .job-card-logo.placeholder span { font-size: 22px; }
  .job-card-desc {
    margin: 0 10px 12px;
    padding: 12px 14px;
    font-size: 13px;
    -webkit-line-clamp: 3;
  }
  .job-card-foot {
    padding: 0 12px 14px;
    gap: 10px;
  }
  .job-badge { padding: 6px 14px; font-size: 12px; }
  .job-card-meta { gap: 12px; font-size: 12px; }
  .job-meta-icon { font-size: 13px; }
  .job-meta-date { font-size: 12px; }
}

/* =========================
   ARTICLE IMAGE — Ratio 3:2 (1200×800)
   ========================= */
.article-image-wrap {
  margin-top: 24px;
  margin-bottom: 8px;
}
.article-image {
  max-width: 1200px;
  margin: 0 auto;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px -8px rgba(15,23,42,.15);
  aspect-ratio: 3 / 2;
}
.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 768px) {
  .article-image-wrap { margin-top: 16px; padding: 0; }
  .article-image {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-left: -14px;
    margin-right: -14px;
    max-width: none;
  }
}

/* =========================
   ARTICLE PAGE — Style magazine
   ========================= */
.article-page {
  padding: 30px 0 60px;
  background: var(--bg);
}

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-2);
  margin-bottom: 22px; flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--text-2); font-weight: 600;
  padding: 4px 8px; border-radius: 6px;
  transition: all .2s;
}
.breadcrumb a:hover { color: var(--primary); background: rgba(22,163,74,.08); }
.breadcrumb span { color: var(--muted); }
.breadcrumb .current { color: var(--text); font-weight: 700; }

/* En-tête article */
.article-header {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 30px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.article-cat { margin-bottom: 16px; }
.article-title {
  font-family: 'Cairo', sans-serif;
  font-size: clamp(22px, 3.5vw, 34px);
  font-weight: 800;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 22px;
  letter-spacing: -0.01em;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.article-logo {
  width: 64px; height: 64px;
  flex-shrink: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  display: grid; place-items: center;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.article-logo img { width: 100%; height: 100%; object-fit: contain; }
.article-meta-text { flex: 1; min-width: 0; }
.article-etab {
  font-size: 16px; font-weight: 700;
  color: var(--text); margin-bottom: 6px;
}
.article-info-bar {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-2);
}
.article-info-bar span { display: inline-flex; align-items: center; gap: 4px; }
.article-info-bar strong { color: var(--text); font-weight: 700; }

/* Image article 3:2 */
.article-image {
  max-width: 1200px;
  margin: 0 auto 28px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px -8px rgba(15,23,42,.15);
  aspect-ratio: 3 / 2;
}
.article-image img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* Boîte d'infos clés */
.key-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
  padding: 20px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}
.key-fact {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: 12px;
  border: 1px solid transparent;
}
.kf-icon {
  width: 40px; height: 40px;
  background: white;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 19px; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.kf-label { font-size: 12px; color: var(--text-2); font-weight: 600; margin-bottom: 2px; }
.kf-value { font-weight: 700; font-size: 14px; color: var(--text); word-break: break-word; }
.key-fact.kf-success { background: linear-gradient(135deg, #ecfdf5, white); border-color: #a7f3d0; }
.key-fact.kf-info { background: linear-gradient(135deg, #eff6ff, white); border-color: #bfdbfe; }
.key-fact.kf-warn { background: linear-gradient(135deg, #fffbeb, white); border-color: #fde68a; }

/* Corps article */
.article-body {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.article-section { margin-bottom: 36px; }
.article-section:last-child { margin-bottom: 0; }
.article-section h2 {
  font-family: 'Cairo', sans-serif;
  font-size: 22px; font-weight: 800;
  color: var(--text); margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--surface-2);
  display: flex; align-items: center; gap: 8px;
}

.prose {
  font-size: 16px;
  line-height: 1.95;
  color: var(--text);
}
.prose p { margin-bottom: 14px; }
.prose ul, .prose ol { padding-right: 26px; margin-bottom: 14px; }
.prose li { margin-bottom: 6px; }
.prose strong, .prose b { font-weight: 700; color: var(--text); }
.prose a { color: var(--primary); text-decoration: underline; }
.prose img { max-width: 100%; border-radius: 8px; margin: 12px 0; }
.prose blockquote {
  border-right: 4px solid var(--primary);
  padding: 8px 18px; margin: 16px 0;
  background: var(--surface-2);
  border-radius: 8px;
  color: var(--text-2);
  font-style: italic;
}
.prose h3 { font-family: 'Cairo', sans-serif; font-weight: 800; font-size: 18px; margin: 18px 0 10px; }

/* Cartes contact */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.contact-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: all .2s;
  border: 1px solid transparent;
}
a.contact-card:hover {
  background: #ecfdf5;
  border-color: #a7f3d0;
  transform: translateY(-2px);
}
.cc-icon {
  width: 44px; height: 44px;
  background: white; border-radius: 11px;
  display: grid; place-items: center;
  font-size: 20px; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.cc-label { font-size: 12px; color: var(--text-2); font-weight: 600; margin-bottom: 2px; }
.cc-value { font-weight: 700; font-size: 14px; word-break: break-all; }

/* Actions */
.article-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border: 1px solid #a7f3d0;
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 28px;
}
.btn-lg { padding: 14px 24px; font-size: 15px; flex: 1; min-width: 180px; }

/* Section commentaires */
.comments-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.comments-section h2 {
  font-family: 'Cairo', sans-serif;
  font-size: 22px; font-weight: 800;
  margin-bottom: 22px;
  color: var(--text);
}

/* Mobile: pleine largeur */
@media (max-width: 768px) {
  .article-page { padding: 18px 0 40px; overflow-x: hidden; }
  .container { padding: 0 14px; }
  .layout-with-sidebar, .layout-main { min-width: 0; max-width: 100%; }
  .article-header {
    padding: 20px 18px;
    border-radius: 14px;
    margin-bottom: 18px;
  }
  .article-title { font-size: 20px; line-height: 1.45; margin-bottom: 16px; word-wrap: break-word; }
  .article-meta { gap: 12px; padding-top: 14px; flex-wrap: wrap; }
  .article-logo { width: 52px; height: 52px; border-radius: 10px; }
  .article-info-bar { gap: 10px; font-size: 12px; }
  .article-etab { word-wrap: break-word; }

  /* Image : reste dans la colonne (pas de bleed plein écran) */
  .article-image {
    border-radius: 14px;
    margin-bottom: 18px;
    aspect-ratio: 16 / 10;
  }

  .key-facts {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 18px;
  }
  .key-fact { padding: 10px 12px; }

  .article-body {
    padding: 20px 18px;
    border-radius: 14px;
    margin-bottom: 18px;
  }
  .article-section { margin-bottom: 26px; }
  .article-section h2 { font-size: 18px; padding-bottom: 10px; margin-bottom: 14px; }
  .prose { font-size: 15px; line-height: 1.85; }

  .contact-cards { grid-template-columns: 1fr; }
  .contact-card { padding: 12px 14px; }
  .cc-icon { width: 40px; height: 40px; font-size: 18px; }

  .article-actions {
    flex-direction: column;
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 18px;
  }
  .btn-lg { width: 100%; padding: 13px 20px; font-size: 14px; }

  .comments-section {
    padding: 18px 16px;
    border-radius: 14px;
  }
  .comments-section h2 { font-size: 18px; margin-bottom: 16px; }
}

/* =========================
   LAYOUT AVEC SIDEBAR DROITE
   En RTL : col 1 = droite, col 2 = gauche
   ========================= */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
}
.layout-with-sidebar .sidebar { grid-column: 1; }
.layout-with-sidebar .layout-main { grid-column: 2; min-width: 0; }

@media (max-width: 900px) {
  .layout-with-sidebar {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .layout-with-sidebar .sidebar,
  .layout-with-sidebar .layout-main {
    grid-column: 1;
  }
  .layout-with-sidebar .sidebar { order: 2; }
  .layout-with-sidebar .layout-main { order: 1; }
}

/* Sidebar — défile normalement avec la page */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-left: 4px;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--text-2); }

@media (max-width: 900px) {
  .sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding-left: 0;
  }
}

.side-widget {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.side-title {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Cairo', sans-serif;
  font-size: 16px; font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--surface-2);
}
.side-icon { font-size: 18px; }
.side-empty { color: var(--muted); text-align: center; padding: 14px 0; font-size: 13px; }

/* Liste plus vues / nouvelles */
.side-list { list-style: none; padding: 0; margin: 0; }
.side-list li { margin-bottom: 8px; }
.side-list li:last-child { margin-bottom: 0; }

.side-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.side-item:hover { background: var(--surface-2); }

.side-rank {
  width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 13px;
  background: var(--surface-2);
  color: var(--text-2);
}
.side-rank.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: white; }
.side-rank.rank-2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: white; }
.side-rank.rank-3 { background: linear-gradient(135deg, #fdba74, #f97316); color: white; }

.side-thumb {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 10px; overflow: hidden;
  background: white;
  border: 1px solid var(--border);
  display: grid; place-items: center;
}
.side-thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-thumb.placeholder {
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  color: var(--primary);
  font-weight: 800; font-size: 18px;
  font-family: 'Cairo', sans-serif;
}

.side-item-body { flex: 1; min-width: 0; }
.side-item-title {
  font-size: 13px; font-weight: 700;
  line-height: 1.4; color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.side-item-meta {
  font-size: 11px;
  color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}

.side-cat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}
.side-cat-dot.cat-public { background: #3b82f6; }
.side-cat-dot.cat-prive { background: #10b981; }
.side-cat-dot.cat-collectivite { background: #f59e0b; }
.side-cat-dot.cat-etranger { background: #a855f7; }

/* Catégories */
.cat-list { list-style: none; padding: 0; margin: 0; }
.cat-list li { margin-bottom: 6px; }
.cat-list li:last-child { margin-bottom: 0; }

.cat-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: 11px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid transparent;
  font-weight: 700; font-size: 14px;
  transition: all .2s;
}
.cat-link:hover { transform: translateX(-3px); }
.cat-link-icon {
  width: 32px; height: 32px;
  background: white; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 16px; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.cat-link-label { flex: 1; }
.cat-link-count {
  background: white;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 800;
  min-width: 28px; text-align: center;
}

.cat-link.cat-public:hover { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.cat-link.cat-public:hover .cat-link-count { color: #1e40af; }
.cat-link.cat-prive:hover { background: #d1fae5; border-color: #86efac; color: #047857; }
.cat-link.cat-prive:hover .cat-link-count { color: #047857; }
.cat-link.cat-collectivite:hover { background: #fef3c7; border-color: #fcd34d; color: #b45309; }
.cat-link.cat-collectivite:hover .cat-link-count { color: #b45309; }
.cat-link.cat-etranger:hover { background: #f3e8ff; border-color: #d8b4fe; color: #6b21a8; }
.cat-link.cat-etranger:hover .cat-link-count { color: #6b21a8; }

@media (max-width: 768px) {
  .layout-with-sidebar { gap: 18px; }
  .side-widget { padding: 14px; border-radius: 14px; }
  .side-title { font-size: 15px; margin-bottom: 12px; padding-bottom: 10px; }
}

/* =========================
   FORMULAIRES ADMIN — Quill + champs dynamiques
   ========================= */
.quill-editor {
  background: white;
  border-radius: 0 0 12px 12px;
  min-height: 240px;
  font-family: 'Tajawal', sans-serif !important;
  font-size: 15px;
}
.ql-toolbar.ql-snow {
  border-radius: 12px 12px 0 0;
  border-color: var(--border);
  background: var(--surface-2);
}
.ql-container.ql-snow {
  border-color: var(--border);
  border-radius: 0 0 12px 12px;
}
.ql-editor {
  direction: rtl;
  text-align: right;
  min-height: 200px;
  font-family: 'Tajawal', sans-serif;
  font-size: 15px;
  line-height: 1.8;
}
.ql-editor.ql-blank::before {
  right: 15px; left: auto;
  font-style: normal;
  color: var(--muted);
}

/* Section bloc admin */
.form-section {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-top: 20px;
}
.form-section-head { margin-bottom: 14px; }
.form-section-head h3 {
  font-family: 'Cairo', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

/* Lignes dynamiques (PDF / liens) */
.dyn-list {
  display: flex; flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.dyn-row {
  display: grid;
  grid-template-columns: 1fr 2fr 40px;
  gap: 8px;
  align-items: center;
}
.dyn-row input {
  margin: 0 !important;
  padding: 10px 12px !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  background: white !important;
}
.dyn-remove {
  width: 40px; height: 40px;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: 20px; font-weight: 800;
  cursor: pointer;
  transition: all .15s;
}
.dyn-remove:hover { background: #dc2626; color: white; transform: scale(1.05); }

.btn-sm { padding: 8px 16px; font-size: 13px; }

.upload-helper {
  margin-top: 14px;
  background: white;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.upload-helper summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
}
.upload-helper input[type=file] { margin-top: 8px; }

@media (max-width: 600px) {
  .dyn-row {
    grid-template-columns: 1fr 40px;
    grid-template-rows: auto auto;
  }
  .dyn-row .dyn-input-titre { grid-column: 1 / 3; }
  .dyn-row .dyn-input-url { grid-column: 1; grid-row: 2; }
  .dyn-row .dyn-remove { grid-column: 2; grid-row: 2; }
}

/* =========================
   Téléchargements / liens (page offre)
   ========================= */
.downloads-section h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 12px;
}
.dl-title, .dl-sub { overflow-wrap: anywhere; word-break: break-word; }
.download-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border: 1px solid #a7f3d0;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: all .2s;
}
.download-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px -8px rgba(22,163,74,.35);
  border-color: var(--primary);
}
.download-card.link-card {
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border-color: #bfdbfe;
}
.download-card.link-card:hover {
  box-shadow: 0 8px 18px -8px rgba(37,99,235,.35);
  border-color: #3b82f6;
}
.dl-icon {
  width: 44px; height: 44px;
  background: white;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.dl-body { flex: 1; min-width: 0; }
.dl-title {
  font-weight: 700; font-size: 14px;
  color: var(--text);
  margin-bottom: 3px;
  word-break: break-word;
}
.dl-sub { font-size: 12px; color: var(--text-2); }
.dl-arrow {
  font-size: 22px; font-weight: 800;
  color: var(--primary); flex-shrink: 0;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.7);
  border-radius: 50%;
}
.link-card .dl-arrow { color: #3b82f6; }
