/* ============================================================
   CVMaker CI v4.3 — Styles complets (MISE À JOUR MOBILE)
   Ajouts v4.3 :
   ✅ Page auth (login/register)
   ✅ Section candidatures (tableau suivi)
   ✅ Modal WhatsApp candidature
   ✅ Badge date offres (vert/jaune/rouge/gris)
   ✅ Badge score entreprises (vert/jaune/rouge)
   ✅ Tableau emails copiables
   ✅ Barres progression compétences
   ✅ Compteur mots/lignes temps réel
   ✅ Filtres date offres + période rapide
   ✅ Indicateur online/offline
   ✅ Badge pays site scraping
   ✅ Canaux contact détail offre
   ✅ Alerte aucun canal disponible
   ✅ Pagination offres
   ✅ CORRECTIONS MODALS MOBILE (header/footer visibles)
   ============================================================ */

/* ── Variables ────────────────────────────────────────────── */
:root {
  --accent:     #0891b2;
  --accent-d:   #0777a0;
  --accent-g:   rgba(8,145,178,.15);
  --blue:       #3b82f6;
  --purple:     #8b5cf6;
  --amber:      #f59e0b;
  --red:        #ef4444;
  --green:      #10b981;
  --whatsapp:   #25D366;
  --whatsapp-d: #1da851;

  --bg:       #0f1117;
  --card-bg:  #161b27;
  --sidebar:  #0d1019;
  --input-bg: #1a2033;
  --hover:    #1e2740;
  --border:   rgba(255,255,255,.07);
  --border2:  rgba(255,255,255,.12);
  --text:     #e8eaf0;
  --muted:    #6b7280;
  --sub:      #4b5563;

  --sidebar-w: 220px;
  --topbar-h:  52px;
  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
}

body.light {
  --bg:       #f0f2f9;
  --card-bg:  #ffffff;
  --sidebar:  #ffffff;
  --input-bg: #f4f6fb;
  --hover:    #eef1f8;
  --border:   rgba(0,0,0,.08);
  --border2:  rgba(0,0,0,.14);
  --text:     #1a1a2e;
  --muted:    #6b7280;
  --sub:      #9ca3af;
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, textarea, select {
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .2s, box-shadow .2s, background .2s;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8,145,178,.12), 0 2px 8px rgba(0,0,0,.15);
  background: rgba(8,145,178,.04);
}

input::placeholder, textarea::placeholder {
  color: rgba(107,114,128,.6);
  font-size: 12px;
}

textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  display: block;
  margin-bottom: 5px;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ============================================================
   AUTH
   ============================================================ */
.auth-page {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 16px;
}

.auth-page.hidden {
  display: none;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  animation: slideUp .25s ease;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.auth-tagline {
  font-size: 12px;
  color: var(--sub);
  margin-bottom: 24px;
}

.auth-form h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 20px;
}

.auth-form .form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.auth-form input {
  width: 100%;
}

.auth-error {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--red);
  margin-bottom: 14px;
}

.auth-error.hidden {
  display: none;
}

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 16px;
}

.auth-switch a {
  color: var(--accent);
  font-weight: 600;
}

/* Online/offline */
.online-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 600;
}

.online-indicator.online {
  background: rgba(16,185,129,.15);
  color: var(--green);
}

.online-indicator.offline {
  background: rgba(239,68,68,.15);
  color: var(--red);
}

.online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.online-indicator.online .online-dot {
  background: var(--green);
}

.online-indicator.offline .online-dot {
  background: var(--red);
}

/* User pill */
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--hover);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #0f1117;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  flex-shrink: 0;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-wrapper {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  transition: transform .25s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 10px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--sidebar);
  flex-shrink: 0;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #22d3ee, #0891b2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 900;
  font-size: 13px;
  color: #0f1117;
  flex-shrink: 0;
  box-shadow: 0 0 16px var(--accent-g);
}

.logo-text {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 18px;
}

.logo-text span {
  color: var(--accent);
}

.sidebar-tagline {
  font-size: 11px;
  color: var(--sub);
  padding: 4px 16px 10px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all .15s;
  cursor: pointer;
  margin-bottom: 2px;
}

/* Sous-item sidebar (ex: Mes Portfolios sous Portfolio PPTX) */
.nav-sub {
  padding-left: 32px;
  font-size: 12px;
  color: var(--muted);
  opacity: .85;
  position: relative;
}

.nav-sub::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0 0 0 3px;
}

.nav-sub:hover,
.nav-sub.active {
  color: var(--accent);
  background: var(--accent-g);
  opacity: 1;
}

.nav-item:hover {
  background: var(--hover);
  color: var(--text);
  text-decoration: none;
}

.nav-item.active {
  background: var(--accent-g);
  color: var(--accent);
}

.nav-icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid var(--border);
}

.save-indicator {
  font-size: 11px;
  color: var(--sub);
  padding: 4px 8px;
  margin-bottom: 4px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
}

.sidebar-overlay.active {
  display: block;
}

.sidebar.collapsed {
  width: 54px;
  overflow: hidden;
}
.sidebar.collapsed .logo-text,
.sidebar.collapsed .sidebar-tagline,
.sidebar.collapsed .sidebar-user,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .save-indicator,
.sidebar.collapsed #btn-theme span {
  display: none;
}
.sidebar.collapsed .sidebar-logo { justify-content: center; padding: 14px 8px; }
.sidebar.collapsed .logo-mark    { margin: 0; }
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px 8px;
  border-radius: 8px;
  margin: 2px 6px;
}
.sidebar.collapsed .nav-item i { margin: 0; font-size: 18px; }
.sidebar.collapsed .sidebar-footer { padding: 8px; }
.sidebar.collapsed #btn-theme { padding: 8px; min-width: 0; }

/* Transition main-content quand sidebar se réduit */
.sidebar { transition: width .25s ease; }
.main-content { transition: margin-left .25s ease; }

/* Éditeur s'élargit quand sidebar réduite */
/* ── Panels éditeur — expansion au collapse sidebar ──────── */
.sidebar.collapsed ~ .main-content .editor-panel,
.sidebar.collapsed ~ .main-content .lettre-panel {
  width: 536px;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 15px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.hamburger {
  background: none;
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 16px;
  display: none;
}

/* Sections */
.section {
  display: none;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 24px;
}

.section.active {
  display: block;
}

/* #section-editeur hérite display:block de .section.active */
/* editor-layout gère le flex ROW interne (panel + preview) */

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-header h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 22px;
}

.section-desc {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border2);
  background: var(--input-bg);
  color: var(--text);
  transition: all .15s;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  background: var(--hover);
}

.btn:active {
  transform: scale(.97);
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: #0f1117;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-d);
  border-color: var(--accent-d);
}

.btn-secondary {
  background: rgba(59,130,246,.15);
  color: var(--blue);
  border-color: rgba(59,130,246,.3);
}

.btn-secondary:hover {
  background: rgba(59,130,246,.25);
}

.btn-danger {
  background: rgba(239,68,68,.15);
  color: var(--red);
  border-color: rgba(239,68,68,.3);
}

.btn-whatsapp {
  background: rgba(37,211,102,.15);
  color: var(--whatsapp);
  border-color: rgba(37,211,102,.3);
}

.btn-whatsapp:hover {
  background: rgba(37,211,102,.25);
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--hover);
}

.btn-danger-icon {
  background: transparent;
  border: none;
  color: var(--red);
  padding: 4px 8px;
}

.btn-danger-icon:hover {
  background: rgba(239,68,68,.1);
}

.btn-copy {
  background: rgba(139,92,246,.15);
  color: var(--purple);
  border: 1px solid rgba(139,92,246,.3);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}

.btn-copy:hover {
  background: rgba(139,92,246,.3);
}

.btn-copy.copied {
  background: rgba(16,185,129,.15);
  color: var(--green);
  border-color: rgba(16,185,129,.3);
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 14px;
}

.card-icon {
  font-size: 18px;
}

/* ── Dashboard ────────────────────────────────────────────── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 6px;
}

.stat-value {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 28px;
  color: var(--accent);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quick-btn {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--hover);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}

.quick-btn:hover {
  background: var(--border2);
  color: var(--accent);
}

.conseil-du-jour {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  padding: 12px;
  background: var(--hover);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.relances-alert {
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--amber);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Éditeur ──────────────────────────────────────────────── */
.editor-layout {
  display: flex;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

#section-editeur {
  padding: 0;
  overflow: hidden;
}

.editor-panel {
  width: 370px;
  flex-shrink: 0;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .25s ease;
}

.editor-panel-header {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;    /* Fixe — ne rétrécit jamais */
}

.editor-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.editor-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  min-height: 0;
}

.editor-preview {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.preview-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.zoom-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.preview-scroll {
  flex: 1;
  overflow: auto;
  padding: 20px;
  -webkit-overflow-scrolling: touch;
}

.preview-wrapper {
  transform-origin: top center;
  display: block;
}

/* ATS */
.ats-panel {
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 8px;
  overflow: hidden;
  max-height: 0;
  flex-shrink: 0;    /* Fixe — ne pousse pas editor-scroll */
  transition: max-height .3s ease;
}

.ats-panel.open {
  max-height: 420px;
  overflow-y: auto;
}

.ats-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
}

#ats-result {
  padding: 0 12px 12px;
  font-size: 12px;
}

.ats-score {
  text-align: center;
  padding: 10px 0;
}

.ats-score-value {
  font-size: 32px;
  font-weight: 800;
  font-family: 'Syne', sans-serif;
}

.ats-section {
  margin-top: 10px;
}

.ats-section-title {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 5px;
}

.ats-list {
  list-style: none;
}

.ats-list li {
  font-size: 12px;
  color: var(--muted);
  padding: 3px 0 3px 14px;
  position: relative;
}

.ats-list li::before {
  content: '•';
  position: absolute;
  left: 4px;
}

.keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.kw-badge {
  background: rgba(239,68,68,.15);
  color: var(--red);
  border: 1px solid rgba(239,68,68,.3);
  border-radius: 20px;
  font-size: 11px;
  padding: 2px 8px;
}

/* Complétion */
.completion-section {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.completion-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.completion-bar-track {
  height: 4px;
  background: var(--border2);
  border-radius: 4px;
  overflow: hidden;
}

.completion-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width .4s ease;
}

/* Forms */
.form-section {
  margin-bottom: 20px;
}

.form-section-body.hidden {
  display: none !important;
}

.btn-section-collapse {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 11px;
  flex-shrink: 0;
  border-radius: 4px;
  transition: color .15s, background .15s;
  font-family: inherit;
}

.btn-section-collapse:hover {
  color: var(--accent);
  background: var(--accent-g);
}

.form-section-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group {
  margin-bottom: 10px;
}

.form-group label {
  margin-bottom: 4px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.form-hint {
  font-size: 11px;
  color: var(--sub);
  margin-top: 4px;
  display: block;
}

/* Compteur mots */
.word-counter {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--sub);
}

.word-counter span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.word-counter .wc-ok {
  color: var(--green);
}

.word-counter .wc-warn {
  color: var(--amber);
}

.word-counter .wc-over {
  color: var(--red);
}

/* Align */
.align-btns {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.align-btn {
  padding: 4px 10px;
  border: 1px solid var(--border2);
  background: var(--input-bg);
  color: var(--muted);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}

.align-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0f1117;
}

/* Photo */
.photo-section {
  margin-bottom: 14px;
  text-align: center;
}

.photo-zone {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px dashed var(--border2);
  background: var(--hover);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0 auto 8px;
  transition: border-color .15s;
  overflow: hidden;
  position: relative;
}

.photo-zone:hover {
  border-color: var(--accent);
}

.photo-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-g);
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 22px;
}

.photo-placeholder small {
  font-size: 10px;
  color: var(--muted);
}

.photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-info {
  font-size: 11px;
  color: var(--sub);
}

/* Sub-blocks */
.sub-block {
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
  position: relative;
}

.sub-block-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.sub-block-row input {
  width: 100%;
}

.sub-block .e_missions,
.sub-block .cs_contenu {
  width: 100%;
}
/* ── Exp block ──────────────────────────────────────────── */
.exp-block {
  background: linear-gradient(135deg, rgba(30,39,64,.8), rgba(22,27,39,.9));
  border: 1px solid rgba(8,145,178,.18);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
  transition: border-color .2s, box-shadow .2s;
}

.exp-block:hover {
  border-color: rgba(8,145,178,.35);
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}

.exp-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
  cursor: pointer;
}

.exp-block-summary {
  flex: 1;
  min-width: 0;
}

.exp-block-poste-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.exp-block-body {
  display: block;
}

.exp-block-body.collapsed {
  display: none;
}

.exp-collapse-btn {
  flex-shrink: 0;
}

/* ── Btn AI inline ──────────────────────────────────────── */
.btn-ai-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent-g);
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  font-family: inherit;
}
.btn-ai-inline:hover {
  background: var(--accent);
  color: #0f1117;
}

/* ── Mission actions ────────────────────────────────────── */
.mission-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

/* ── Form-block ─────────────────────────────────────────── */
.form-block {
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
  position: relative;
}

/* ── Custom section block ───────────────────────────────── */
.custom-section-block {
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
  position: relative;
}


.sub-block-mission-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.sub-block-mission-row textarea {
  flex: 1;
}

.mission-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-ai-inline {
  background: rgba(139,92,246,.2);
  color: #a78bfa;
  border: 1px solid rgba(139,92,246,.3);
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}

.btn-ai-inline:hover {
  background: rgba(139,92,246,.35);
}

.mission-toggle {
  background: var(--input-bg);
  border: 1px solid var(--border2);
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}

.mission-toggle.active {
  background: var(--accent-g);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-remove-block {
  position: absolute;
  top: 6px;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--sub);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
}

.btn-remove-block:hover {
  background: rgba(239,68,68,.15);
  color: var(--red);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

/* Compétences scores */
.competence-score-block {
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  position: relative;
}

.competence-score-row {
  display: grid;
  grid-template-columns: 1fr 140px 80px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.competence-score-row input,
.competence-score-row select {
  width: 100%;
}

.competence-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.competence-bar-label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 28px;
  text-align: right;
}

.competence-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border2);
  border-radius: 4px;
  overflow: hidden;
}

.competence-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .3s ease;
}

.niveau-debutant .competence-bar-fill {
  background: #ef4444;
}

.niveau-intermediaire .competence-bar-fill {
  background: #f59e0b;
}

.niveau-avance .competence-bar-fill {
  background: #3b82f6;
}

.niveau-expert .competence-bar-fill {
  background: #10b981;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.score-pill.expert {
  background: rgba(16,185,129,.15);
  color: var(--green);
}

.score-pill.avance {
  background: rgba(59,130,246,.15);
  color: var(--blue);
}

.score-pill.intermediaire {
  background: rgba(245,158,11,.15);
  color: var(--amber);
}

.score-pill.debutant {
  background: rgba(239,68,68,.15);
  color: var(--red);
}

/* Templates */
.template-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.template-filter-btn {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border2);
  background: var(--input-bg);
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}

.template-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0f1117;
}

.template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.template-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: all .15s;
  background: var(--hover);
}

.template-card:hover {
  border-color: var(--accent);
}

.template-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-g);
}

.template-thumb {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-info {
  padding: 6px 8px;
}

.template-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}

.template-type {
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
}

.template-desc {
  font-size: 10px;
  color: var(--sub);
  margin-top: 2px;
}

.font-size-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

#font-size-val {
  font-family: monospace;
  font-size: 13px;
  min-width: 36px;
}

.famille-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* Liste CV */
.search-bar {
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  max-width: 400px;
  padding: 9px 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.cvs-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.cv-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s;
}

.cv-card:hover {
  border-color: var(--border2);
}

.cv-card-thumb {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-card-info {
  padding: 10px 12px;
}

.cv-card-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 3px;
}

.cv-card-meta {
  font-size: 11px;
  color: var(--muted);
}

.cv-card-actions {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}

.cv-card-actions button {
  flex: 1;
  padding: 5px;
  font-size: 14px;
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}

.cv-card-actions button:hover {
  background: var(--border2);
}

.cv-replace-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all .15s;
}

.cv-replace-item:hover {
  background: var(--hover);
  border-color: var(--accent);
}

.cv-date {
  font-size: 11px;
  color: var(--muted);
}

.modal-divider {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 14px 0;
  position: relative;
}

.modal-divider::before,
.modal-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}

.modal-divider::before {
  left: 0;
}

.modal-divider::after {
  right: 0;
}

/* Lettre */
.lettre-layout {
  display: flex;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

#section-lettre {
  padding: 0;
  overflow: hidden;
}

.lettre-panel {
  width: 370px;
  flex-shrink: 0;
  background: var(--card-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 12px;
  transition: width .25s ease;
}

.lettre-panel-header {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.lettre-preview-panel {
  flex: 1;
  min-width: 0;        /* Empêche le débordement flex */
  min-height: 400px;   /* Hauteur minimale garantie */
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;  /* Contexte de positionnement */
}


/* ── Scale du preview lettre A4 ──────────────────────────── */
#lettre-preview-scaler {
  transform: scale(0.72);
  transform-origin: top center;
}
/* Sur tablette */
@media(max-width: 1100px) {
  #lettre-preview-scaler { transform: scale(0.60); }
}

.lettre-modele-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.lettre-modele-btn {
  padding: 8px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}

.lettre-modele-btn.active {
  background: var(--accent-g);
  color: var(--accent);
  border-color: var(--accent);
}

.lettre-type-btns {
  display: flex;
  gap: 8px;
}

.lettre-type-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}

.lettre-type-btn.active {
  background: var(--accent-g);
  color: var(--accent);
  border-color: var(--accent);
}

.hidden {
  display: none !important;
}

.lettre-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.lettre-card-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.lettre-card-info {
  flex: 1;
  min-width: 0;
}

.lettre-card-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lettre-card-meta {
  font-size: 11px;
  color: var(--sub);
}

.lettre-card-actions {
  display: flex;
  gap: 4px;
}

/* ── Offres ───────────────────────────────────────────────── */
.offres-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.offres-filters-row2 {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  min-width: 160px;
}

.periode-btns {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.periode-btn {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border2);
  background: var(--input-bg);
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}

.periode-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.periode-btn:hover:not(.active) {
  background: var(--hover);
  color: var(--text);
}

.offres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

.offre-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s;
}

.offre-card:hover {
  border-color: var(--border2);
}

.offre-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.offre-card-titre {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.4;
  flex: 1;
}

.offre-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  flex-shrink: 0;
  white-space: nowrap;
}

.offre-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

/* Badge date */
.badge-date {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-date.recent {
  background: rgba(16,185,129,.15);
  color: var(--green);
}

.badge-date.normal {
  background: rgba(245,158,11,.15);
  color: var(--amber);
}

.badge-date.ancien {
  background: rgba(239,68,68,.12);
  color: var(--red);
}

.badge-date.expire {
  background: rgba(107,114,128,.15);
  color: var(--muted);
}

.badge-site {
  font-size: 10px;
  color: var(--sub);
  background: var(--hover);
  border-radius: 20px;
  padding: 2px 7px;
  white-space: nowrap;
}

.offre-competences {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.competence-tag {
  background: var(--hover);
  border: 1px solid var(--border2);
  border-radius: 20px;
  font-size: 11px;
  padding: 2px 8px;
  color: var(--muted);
}

.offre-description {
  font-size: 12px;
  color: var(--sub);
  line-height: 1.6;
}

.offre-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--border2);
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.btn-small:hover {
  background: var(--hover);
}

.btn-small.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0f1117;
}

.btn-small.btn-secondary {
  background: rgba(59,130,246,.15);
  border-color: rgba(59,130,246,.3);
  color: var(--blue);
}

.btn-small.btn-whatsapp {
  background: rgba(37,211,102,.15);
  border-color: rgba(37,211,102,.3);
  color: var(--whatsapp);
}

/* Alerte aucun canal */
.alerte-aucun-canal {
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--amber);
  margin-top: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* Offre detail */
.offre-detail-header {
  margin-bottom: 14px;
}

.offre-detail-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}

.offre-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.offre-detail-description {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  background: var(--hover);
  border-radius: var(--radius-sm);
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.canaux-contact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.canal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--hover);
  border: 1px solid var(--border);
}

.canal-item-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.canal-item-info {
  flex: 1;
  min-width: 0;
}

.canal-item-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
}

.canal-item-value {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Entreprises ──────────────────────────────────────────── */
.entreprises-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.entreprise-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entreprise-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.entreprise-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-g);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

.entreprise-card-nom {
  font-weight: 700;
  font-size: 14px;
}

.entreprise-card-secteur {
  font-size: 12px;
  color: var(--muted);
}

.entreprise-badge {
  margin-left: auto;
  background: var(--accent-g);
  color: var(--accent);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  white-space: nowrap;
}

.entreprise-card-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.entreprise-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.score-badge.complet {
  background: rgba(16,185,129,.15);
  color: var(--green);
  border: 1px solid rgba(16,185,129,.3);
}

.score-badge.partiel {
  background: rgba(245,158,11,.15);
  color: var(--amber);
  border: 1px solid rgba(245,158,11,.3);
}

.score-badge.incomplet {
  background: rgba(239,68,68,.12);
  color: var(--red);
  border: 1px solid rgba(239,68,68,.3);
}

/* Tableau emails */
.emails-list-section {
  margin-top: 20px;
}

.emails-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.emails-list-header h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
}

.emails-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.emails-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  border-bottom: 1px solid var(--border);
  background: var(--hover);
}

.emails-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.emails-table tr:hover td {
  background: var(--hover);
}

.email-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--hover);
  border: 1px solid var(--border2);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  margin: 2px;
}

.copy-all-emails-btn {
  background: var(--accent);
  color: #0f1117;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.copy-all-emails-btn:hover {
  background: var(--accent-d);
}

/* ── Candidatures ─────────────────────────────────────────── */
.cand-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

/* 5 stats : Actives / Postulées / Relances dues / Taux réponse / Délai moyen */
.cand-stats-5 {
  grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 600px) {
  .modal-box {
    max-height: 95vh !important;
    margin: 8px;
    width: calc(100% - 16px) !important;
  }
  #cv-wizard-body,
  #modal-rh-body {
    padding: 14px !important;
  }
  .modal-footer {
    padding: 10px 14px !important;
    flex-wrap: wrap;
    gap: 6px;
  }
  .modal-footer .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .cand-stats-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-mini {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.stat-mini span {
  display: block;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 24px;
  color: var(--accent);
}

.stat-mini small {
  font-size: 11px;
  color: var(--muted);
}

.cand-table-wrapper {
  overflow-x: auto;
}

.cand-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
}

.cand-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  background: var(--hover);
  border-bottom: 1px solid var(--border);
}

.cand-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.cand-table tr:last-child td {
  border-bottom: none;
}

.cand-table tr:hover td {
  background: var(--hover);
}

.cand-table tr.relance-due td {
  background: rgba(245,158,11,.05);
}

/* Niveaux urgence date relance */
.relance-critique td { background: rgba(239,68,68,.06); }
.relance-urgent td   { background: rgba(245,158,11,.08); }
.relance-proche td   { background: rgba(245,158,11,.04); }

.cand-table tr.relance-due:hover td {
  background: rgba(245,158,11,.1);
}

.statut-select {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
}

.statut-en_cours {
  background: rgba(245,158,11,.15);
  color: var(--amber);
}

.statut-pret {
  background: rgba(59,130,246,.15);
  color: var(--blue);
}

.statut-postule {
  background: rgba(139,92,246,.15);
  color: var(--purple);
}

.statut-relance {
  background: rgba(245,158,11,.15);
  color: var(--amber);
}

.statut-reponse {
  background: rgba(16,185,129,.15);
  color: var(--green);
}

.statut-refus {
  background: rgba(239,68,68,.15);
  color: var(--red);
}

.canal-icon {
  font-size: 16px;
  cursor: default;
}

/* Modal email */
.email-offre-info {
  background: var(--hover);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  margin-bottom: 4px;
}

.email-corps-container {
  background: var(--input-bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-height: 200px;
  max-height: 350px;
  overflow-y: auto;
}

.email-generating {
  color: var(--muted);
  font-style: italic;
  padding: 20px;
  text-align: center;
}

#email-corps-editable {
  min-height: 180px;
  outline: none;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.7;
}

#email-corps-editable:focus {
  outline: none;
}

.email-note {
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--amber);
  margin-top: 10px;
}

/* Modal WhatsApp */
.whatsapp-modal-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(37,211,102,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.whatsapp-message-container {
  background: var(--input-bg);
  border: 1px solid rgba(37,211,102,.3);
  border-radius: var(--radius-sm);
  padding: 14px;
  min-height: 140px;
  max-height: 300px;
  overflow-y: auto;
}

.whatsapp-generating {
  color: var(--muted);
  font-style: italic;
  padding: 20px;
  text-align: center;
}

#whatsapp-corps-editable {
  min-height: 120px;
  outline: none;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.8;
}

#whatsapp-corps-editable:focus {
  outline: none;
}

.whatsapp-note {
  background: rgba(37,211,102,.08);
  border: 1px solid rgba(37,211,102,.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--whatsapp);
  margin-top: 10px;
}

.btn-open-whatsapp {
  background: var(--whatsapp);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-open-whatsapp:hover {
  background: var(--whatsapp-d);
}

/* Config */
.config-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.add-site-form {
  background: var(--hover);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 14px;
}

.add-site-form .form-row {
  margin-bottom: 10px;
}

.add-site-form .form-row input {
  width: 100%;
}

.sites-suggestions {
  margin-bottom: 14px;
}

.site-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.suggestion-tag {
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(59,130,246,.15);
  border: 1px solid rgba(59,130,246,.3);
  color: var(--blue);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}

.suggestion-tag:hover {
  background: rgba(59,130,246,.3);
}

.site-card {
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.site-card.site-inactif {
  opacity: .6;
}

.site-card-info {
  flex: 1;
  min-width: 0;
}

.site-card-nom {
  font-weight: 700;
  font-size: 13px;
}

.site-card-url {
  font-size: 11px;
  color: var(--sub);
  word-break: break-all;
  margin: 3px 0;
}

.site-card-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}

.site-card-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.site-pays-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.site-pays-CI {
  background: rgba(8,145,178,.15);
  color: var(--accent);
}

.site-pays-MULTI {
  background: rgba(59,130,246,.15);
  color: var(--blue);
}

.site-pays-INTL {
  background: rgba(139,92,246,.15);
  color: var(--purple);
}

.badge-active {
  color: var(--green);
  font-weight: 600;
}

.badge-inactive {
  color: var(--red);
  font-weight: 600;
}

.input-with-btn {
  display: flex;
  gap: 8px;
}

.input-with-btn input {
  flex: 1;
}

.empty-state-small {
  text-align: center;
  color: var(--sub);
  font-size: 13px;
  padding: 20px;
}

/* ── Éditeur CV — Sections & titres ── */
.editor-section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(8,145,178,.2);
}

.editor-panel-body input,
.editor-panel-body textarea,
.editor-panel-body select {
  width: 100%;
  box-sizing: border-box;
}

/* Champ obligatoire */
.form-group.required label::after {
  content: ' *';
  color: var(--accent);
  font-weight: 900;
}

/* Input invalide */
.form-group input:invalid:not(:placeholder-shown) {
  border-color: rgba(239,68,68,.5);
}

/* Compteur mots — style discret */
.word-count {
  font-size: 10px;
  color: var(--sub);
  text-align: right;
  margin-top: 3px;
}


/* Profil */
.profil-form {
  max-width: 700px;
}

/* Familles */
.famille-secteurs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.secteur-btn {
  padding: 14px 10px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--hover);
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.secteur-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.secteur-icon {
  font-size: 24px;
}

.famille-familles-grid {
  display: grid;
  gap: 6px;
}

.famille-btn {
  padding: 10px 14px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--hover);
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.famille-btn:hover {
  border-color: var(--accent);
}

.famille-btn.selected {
  border-color: var(--accent);
  background: var(--accent-g);
}

.famille-btn strong {
  font-size: 13px;
}

.famille-btn small {
  font-size: 11px;
  color: var(--muted);
}

.famille-suggest {
  transition: all .15s;
}

.famille-suggest:hover {
  opacity: .8;
}

/* ============================================================
   MODALS (CORRECTIONS MOBILE)
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
  animation: fadeIn .15s ease;
  overflow-y: auto;
}

.modal.open {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0 }
  to { opacity: 1 }
}

.modal-box {
  background: var(--card-bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  animation: slideUp .2s ease;
  margin: auto;
}

.modal-box.modal-lg {
  max-width: 700px;
}

.modal-box.modal-full {
  max-width: 900px;
  max-height: 95vh;
}

/* Modal PDF preview — presque plein écran */
.modal-box.modal-pdf {
  max-width: 92vw;
  width: 92vw;
  max-height: 94vh;
  height: 94vh;
  display: flex;
  flex-direction: column;
}
.modal-box.modal-pdf .modal-body {
  flex: 1;
  padding: 0;
  overflow: hidden;
}
.modal-box.modal-pdf #pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px) }
  to { opacity: 1; transform: translateY(0) }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 10;
}

.modal-header h3 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 15px;
  flex: 1;
  min-width: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  margin-left: 8px;
}

.modal-close:hover {
  background: var(--hover);
  color: var(--text);
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
  flex-wrap: wrap;
  position: sticky;
  bottom: 0;
  background: var(--card-bg);
  z-index: 10;
}

.modal-hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.6;
}

.modal-body textarea {
  width: 100%;
}

/* Toasts */
.toast {
  background: var(--card-bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: all .25s ease;
  max-width: 360px;
  word-break: break-word;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-left: 3px solid var(--green);
}

.toast-error {
  border-left: 3px solid var(--red);
}

.toast-info {
  border-left: 3px solid var(--blue);
}

#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 6px;
}

.empty-sub {
  font-size: 12px;
  color: var(--sub);
  margin-bottom: 16px;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
  margin-top: 8px;
}

.pagination-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}

.pagination-btn:hover {
  background: var(--hover);
}

.pagination-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0f1117;
}

.pagination-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 12px;
  color: var(--muted);
}


/* ── Panneau options résumé ───────────────────────────────── */
.resume-options-panel {
  animation: fadeIn .2s ease;
}
.resume-options-panel.hidden { display: none !important; }
/* ── Responsive ───────────────────────────────────────────── */
@media(max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 200;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .hamburger {
    display: flex !important;
  }

  /* ── Éditeur CV mobile — scroll vertical ── */
  .editor-layout {
    flex-direction: column;
  }
  .editor-panel {
    height: auto !important;
    min-height: 60vh;
    max-height: 70vh;
    overflow-y: auto;
  }
  .editor-preview { min-height: 50vh; }

  /* ── Lettre de motivation mobile ── */
  .lettre-layout {
    flex-direction: column;
    height: auto;         /* Scroll vertical sur mobile */
    min-height: 100vh;
    overflow: visible;
  }
  #section-lettre {
    overflow-y: auto;
    height: calc(100vh - var(--topbar-h));
  }
  .lettre-panel {
    width: 100%;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-y: auto;
    max-height: 60vh;     /* Panel formulaire limité en hauteur */
  }
  .lettre-preview-panel {
    flex: 1;              /* Conserver flex:1 même sur mobile */
    min-height: 500px;
    height: 500px;
    overflow: hidden;
  }

  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .config-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .famille-secteurs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cand-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .emails-table {
    font-size: 12px;
  }

  .competence-score-row {
    grid-template-columns: 1fr 100px 60px;
  }

  /* Modals adaptés tablette */
  .modal {
    padding: 12px;
  }

  .modal-box {
    max-height: 92vh;
  }

  .modal-header,
  .modal-footer {
    padding: 14px 16px;
  }

  .modal-body {
    padding: 14px 16px;
  }

  /* ───────────────────────────────────────────────────────
     CORRECTIONS SCROLL MOBILE — ajoutées ciblées
     Desktop inchangé, overrides uniquement ici
  ─────────────────────────────────────────────────────── */

  /* 🔴 FIX 1 — Permettre le scroll au doigt sur mobile */
  html, body {
    overflow: visible;
  }

  /* 🔴 FIX 2 — App wrapper : scroll vertical autorisé */
  .app-wrapper {
    overflow-x: hidden;
    overflow-y: visible;
  }

  /* 🔴 FIX 3 — Main content : scroll vertical */
  .main-content {
    overflow-x: hidden;
    overflow-y: auto;
  }

  /* 🔴 FIX 4 — Sections : hauteur auto (plus de hauteur fixe) */
  .section {
    height: auto;
    min-height: calc(100vh - var(--topbar-h));
    overflow-y: visible;
  }

  /* 🟠 FIX 5 — Editor panel : supprimer la limite de hauteur */
  .editor-panel {
    max-height: none;
    height: auto;
    overflow-y: auto;
  }

  /* 🟠 FIX 6 — Boutons éditeur : retour à la ligne */
  .editor-btns {
    flex-wrap: wrap;
    gap: 4px;
  }

  /* 🟡 FIX 7 — Section lettre : scroll libre */
  #section-lettre {
    height: auto;
    min-height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
  }

  /* 🟡 FIX 8 — Wizard portfolio : navigation scrollable */
  .wizard-nav {
    flex-wrap: wrap;
    gap: 6px;
  }

  .wizard-steps {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    flex-wrap: nowrap;
  }

  .wizard-content {
    overflow-y: auto;
  }

  /* Sections profil, candidatures, offres : scroll libre */
  #section-profil,
  #section-offres,
  #section-candidatures,
  #section-mes-cvs,
  #section-portfolio,
  #section-dashboard,
  #section-config {
    overflow-y: auto;
  }

  /* Editor preview scrollable sur mobile */
  .editor-preview {
    overflow-y: auto;
  }

  /* Panel lettre de motivation : pas de hauteur max */
  .lettre-panel {
    max-height: none;
    height: auto;
    overflow-y: visible;
  }

  /* Boutons section header : wrap sur petits écrans */
  .section-header {
    flex-wrap: wrap;
    gap: 8px;
  }


  /* ══════════════════════════════════════════════════════════
     CORRECTIONS SCROLL MOBILE COMPLÉMENTAIRES
     Ces règles corrigent les zones figées identifiées
     Desktop : INCHANGÉ — overrides uniquement dans ce bloc
  ════════════════════════════════════════════════════════════ */

  /* 1. Éditeur CV — lever le verrouillage de hauteur */
  #section-editeur {
    overflow: visible !important;
  }

  .editor-layout {
    height: auto !important;
    overflow: visible !important;
  }

  /* editor-scroll ne peut pas être flex:1 quand parent est height:auto */
  .editor-scroll {
    flex: none !important;
    overflow-y: visible !important;
    min-height: 50vh;
    height: auto !important;
  }

  .editor-preview {
    overflow-y: visible !important;
    height: auto !important;
    min-height: 40vh;
  }

  /* 2. Lettre de motivation — lever le verrouillage de hauteur */
  #section-lettre {
    height: auto !important;
    min-height: calc(100vh - var(--topbar-h));
    overflow-y: visible !important;
  }

  .lettre-preview-panel {
    height: auto !important;
    min-height: 300px;
    overflow: visible !important;
  }

  /* 3. Portfolio / Wizard — scroll libre */
  .wizard-content {
    overflow-y: visible !important;
    height: auto !important;
  }

  #section-portfolio {
    overflow-y: visible;
  }

  .slides-preview-grid {
    max-height: none !important;
    overflow-y: visible !important;
  }

  /* 4. iOS : scroll fluide avec inertie sur les éléments scrollables */
  .main-content,
  .modal-body,
  .editor-panel,
  .lettre-panel {
    -webkit-overflow-scrolling: touch;
  }

  /* 5. Toutes les sections avec conteneurs à hauteur fixe */
  .profil-photo-col,
  .profil-infos-layout {
    height: auto !important;
    overflow: visible;
  }

  /* 6. Cards et grilles — pas de dépassement latéral */
  .offres-grid,
  .cv-list,
  .entreprises-grid,
  .portfolios-grid {
    overflow-x: hidden;
  }

  /* 7. Tableaux : scroll horizontal sur mobile */
  .emails-table,
  .cand-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 8. Section header : empiler boutons sur très petits écrans */
  .section-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .section-header > div,
  .section-header > button {
    flex-shrink: 0;
  }

  /* 9. ATS panel sur mobile */
  .ats-panel {
    height: auto !important;
    overflow: visible !important;
  }

}

@media(max-width: 600px) {
  .section {
    padding: 14px;
  }

  .dash-stats,
  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dash-grid {
    grid-template-columns: 1fr;
  }

  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr;
  }

  .offres-grid,
  .entreprises-grid,
  .cvs-container {
    grid-template-columns: 1fr;
  }

  .template-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cand-stats {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .auth-container {
    padding: 24px 18px;
  }

  .competence-score-row {
    grid-template-columns: 1fr;
  }

  /* Modals optimisés mobile */
  .modal {
    padding: 8px;
    align-items: flex-start;
  }

  .modal-box {
    max-height: 96vh;
    max-width: 100%;
    border-radius: var(--radius);
    margin-top: 8px;
    margin-bottom: 8px;
  }

  .modal-header {
    padding: 12px 14px;
    position: sticky;
    top: 0;
  }

  .modal-header h3 {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .modal-close {
    font-size: 20px;
    padding: 6px 10px;
  }

  .modal-body {
    padding: 12px 14px;
  }

  .modal-footer {
    padding: 10px 14px;
    position: sticky;
    bottom: 0;
    gap: 6px;
  }

  .modal-footer .btn {
    flex: 1;
    justify-content: center;
  }

  .modal-box.modal-full,
  .modal-box.modal-lg {
    max-width: 100%;
    max-height: 98vh;
    margin: 4px;
  }

  /* ── Scroll mobile petits écrans ── */

  /* Sections : scroll libre */
  .section {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Editor panel : scroll complet */
  .editor-panel {
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Editor preview en dessous */
  .editor-preview {
    min-height: 400px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Wizard étapes : scroll horizontal */
  .wizard-steps {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .wizard-step .step-label {
    display: none;
  }

  /* Boutons wizard : taille réduite */
  .wizard-nav .btn {
    font-size: 12px;
    padding: 7px 10px;
  }

  /* Slides type grid : 2 colonnes */
  .slides-types-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Portfolio wizard header */
  .section-header h1 {
    font-size: 18px;
  }

  /* Portfolio sections list */
  #portfolios-container {
    overflow-y: auto;
  }
}


/* ============================================================
   MOBILE ÉDITEUR — Onglets Formulaire / Aperçu
   Visible uniquement sur mobile (≤900px)
   Desktop : inchangé
   ============================================================ */

/* Barre d'onglets — cachée par défaut (desktop) */
.mobile-editor-tabs {
  display: none;
}

@media(max-width: 900px) {

  /* ── Barre d'onglets ── */
  .mobile-editor-tabs {
    display: flex;
    background: var(--card-bg);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: var(--topbar-h);
    z-index: 100;
    flex-shrink: 0;
  }

  .mobile-tab-btn {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: color .15s, border-color .15s;
  }

  .mobile-tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
  }

  .mobile-tab-btn i {
    font-size: 14px;
  }

  /* ── Éditeur CV : show-form / show-preview ── */
  .editor-layout.show-form .editor-panel {
    display: flex !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .editor-layout.show-form .editor-preview {
    display: none !important;
  }

  .editor-layout.show-preview .editor-panel {
    display: none !important;
  }

  .editor-layout.show-preview .editor-preview {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    min-height: 60vh;
    overflow: visible !important;
  }

  /* ── Éditeur LM : show-form / show-preview ── */
  .lettre-layout.show-form .lettre-panel {
    display: flex !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    border-bottom: none !important;
  }

  .lettre-layout.show-form .lettre-preview-panel {
    display: none !important;
  }

  .lettre-layout.show-preview .lettre-panel {
    display: none !important;
  }

  .lettre-layout.show-preview .lettre-preview-panel {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important;
    min-height: 60vh;
    overflow: visible !important;
  }

  /* ── Boutons action compact sur mobile ── */
  .editor-btns {
    flex-wrap: wrap;
    gap: 4px;
  }

  .editor-btns .btn {
    font-size: 11px;
    padding: 5px 8px;
  }

  /* ── Layout éditeur mobile ── */
  .editor-layout {
    flex-direction: column;
    height: auto;
    min-height: 0;
  }

  .lettre-layout {
    flex-direction: column;
    height: auto;
    min-height: 0;
  }
}


/* ============================================================
   BOUTONS FLOTTANTS NAVIGATION MOBILE — Éditeur CV + LM
   Visibles uniquement sur mobile dans les sections d'édition
   ============================================================ */
#mobile-float-nav {
  position: fixed;
  right: 14px;
  bottom: 80px;
  z-index: 300;
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

#mobile-float-nav.visible {
  pointer-events: all;
}

#float-btn-up,
#float-btn-down {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(8, 145, 178, 0.55);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateX(60px);
  transition: opacity .25s ease, transform .25s ease, background .15s;
  pointer-events: none;
}

#mobile-float-nav.visible #float-btn-up,
#mobile-float-nav.visible #float-btn-down {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

#float-btn-down {
  transition-delay: .05s;
}

#float-btn-up:active,
#float-btn-down:active {
  background: rgba(8, 145, 178, 0.9);
  transform: scale(.92);
}

/* Caché sur desktop */
@media(min-width: 901px) {
  #mobile-float-nav {
    display: none !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .editor-panel,
  .lettre-panel,
  .modal {
    display: none !important;
  }

  .editor-preview,
  .lettre-preview-panel {
    height: auto;
    overflow: visible;
  }
}
/* ============================================================
   PORTFOLIO PPTX — Styles v4.3
   ============================================================ */

/* Layout profil avec photo */
.profil-infos-layout {
  display: flex; gap: 20px; align-items: flex-start;
}
.profil-photo-col {
  flex-shrink: 0; width: 100px; text-align: center;
}
.profil-infos-col { flex: 1; min-width: 0; }

/* Cards portfolio liste */
.portfolio-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: border-color .15s;
}
.portfolio-card:hover { border-color: var(--border2); }
.portfolio-card-thumb {
  height: 80px; display: flex; align-items: center;
  justify-content: center;
}
.portfolio-card-info { padding: 10px 12px; flex: 1; }
.portfolio-card-titre { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.portfolio-card-meta  { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.portfolio-card-statut { font-size: 11px; font-weight: 600; }
.statut-exporte { color: var(--green); }
.statut-genere  { color: var(--blue); }
.statut-brouillon { color: var(--muted); }
.portfolio-card-actions {
  display: flex; gap: 4px; padding: 8px 12px;
  border-top: 1px solid var(--border);
}
#portfolios-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

/* Wizard */
.wizard-steps {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 24px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 20px; overflow-x: auto;
}
.wizard-step {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--muted);
  cursor: default; white-space: nowrap; transition: all .15s;
}
.wizard-step.active    { background: var(--accent-g); color: var(--accent); }
.wizard-step.completed { color: var(--green); }
.step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--border2); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.wizard-step.active .step-num    { background: var(--accent); color: #0f1117; }
.wizard-step.completed .step-num { background: var(--green);  color: #fff; }
.wizard-title {
  font-family: 'Syne', sans-serif; font-weight: 700;
  font-size: 16px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.wizard-hint { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.wizard-nav {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 20px; padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: 0 -4px 16px rgba(0,0,0,.12);
  border-radius: 0 0 var(--radius) var(--radius);
}
.wizard-content { animation: fadeIn .2s ease; }
.portfolio-config-grid { display: grid; gap: 14px; max-width: 600px; }
.ai-recommandation-box {
  background: rgba(139,92,246,.1); border: 1px solid rgba(139,92,246,.3);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px;
}
.ai-recommandation { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; }

/* Styles grid */
.style-categorie { margin-bottom: 20px; }
.style-categorie-label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 10px;
}
.style-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.style-card {
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer; transition: all .15s;
  background: var(--hover);
}
.style-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.style-card.selected { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-g); }
.style-preview {
  height: 60px; display: flex; align-items: center;
  justify-content: center; font-size: 20px;
}
.style-info { padding: 8px 10px; }
.style-label { font-size: 12px; font-weight: 700; color: var(--text); }
.style-desc  { font-size: 10px; color: var(--sub); margin-top: 2px; }

/* Types slides */
.slides-types-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px; margin-bottom: 16px;
}
.slide-type-card {
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  padding: 10px; cursor: pointer; transition: all .15s;
  background: var(--hover); text-align: center; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.slide-type-card:hover { border-color: var(--accent); }
.slide-type-card.obligatoire { border-color: var(--accent); background: var(--accent-g); }
.slide-type-card input[type=checkbox] { display: none; }
.slide-type-card:has(input:checked):not(.obligatoire) {
  border-color: var(--blue); background: rgba(59,130,246,.1);
}
.slide-type-icon  { font-size: 22px; }
.slide-type-label { font-size: 11px; font-weight: 600; color: var(--text); }
.obligatoire-badge {
  font-size: 9px; background: var(--accent); color: #0f1117;
  border-radius: 20px; padding: 1px 6px; font-weight: 700;
}

/* Génération overlay */
.generating-overlay {
  text-align: center; padding: 40px 20px;
  background: var(--card-bg); border-radius: var(--radius);
  margin-bottom: 16px;
}
.generating-spinner {
  width: 48px; height: 48px; border-radius: 50%;
  border: 4px solid var(--border2); border-top-color: var(--accent);
  animation: spin 1s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.generating-progress {
  height: 6px; background: var(--border2); border-radius: 4px;
  overflow: hidden; margin-top: 16px; max-width: 400px; margin-left: auto; margin-right: auto;
}
.generating-bar {
  height: 100%; background: var(--accent); border-radius: 4px;
  width: 0%; transition: width .5s ease; animation: genProgress 3s ease-in-out infinite;
}
@keyframes genProgress { 0%{width:5%} 50%{width:85%} 100%{width:95%} }

/* Aperçu slides */
.slides-preview-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; padding: 4px;
  max-height: 500px; overflow-y: auto;
}
.slide-preview-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.slide-preview-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px var(--accent-g);
}
.slide-preview-header {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.slide-preview-num  {
  background: var(--border2); border-radius: 50%;
  width: 20px; height: 20px; display: flex; align-items: center;
  justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.slide-preview-type   { font-size: 10px; color: var(--muted); flex: 1; }
.slide-preview-delete {
  background: none; border: none; color: var(--sub);
  cursor: pointer; font-size: 14px; padding: 0 4px;
}
.slide-preview-delete:hover { color: var(--red); }
.slide-preview-titre  { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.slide-preview-contenu{ font-size: 10px; color: var(--sub); line-height: 1.5; }

/* Compteur mots */
.word-counter { font-size: 11px; color: var(--sub); margin-top: 4px; display: flex; gap: 12px; }
.word-counter .wc-ok   { color: var(--green); }
.word-counter .wc-warn { color: var(--amber); }
.word-counter .wc-over { color: var(--red); }

/* Compétences row dans profil */
.competence-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 130px 100px 44px 24px;
  gap: 8px; align-items: center; margin-bottom: 8px;
  background: var(--hover); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.competence-row .comp-nom {
  min-width: 120px;
  width: 100%;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: var(--input-bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
}
.competence-row .comp-nom:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-g);
  outline: none;
}
.comp-score { width: 100%; min-width: 60px; cursor: pointer; }
.comp-score-val {
  font-size: 12px; color: var(--accent); text-align: center;
  min-width: 36px; font-weight: 700; background: var(--accent-g);
  border-radius: 20px; padding: 2px 6px;
}
.competence-row input[type=text],
.softskill-row input[type=text],
.langue-row input[type=text],
.competence-row select,
.softskill-row select { width: 100%; }

.softskill-row {
  display: grid;
  grid-template-columns: 1fr 130px 100px 44px 24px;
  gap: 8px; align-items: center; margin-bottom: 8px;
  background: var(--hover); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.comp-score-val { font-size: 12px; color: var(--muted); text-align: center; min-width: 36px; }

/* Responsive portfolio */
@media(max-width:768px) {
  .profil-infos-layout  { flex-direction: column; }
  .profil-photo-col     { width: 100%; display: flex; flex-direction: column; align-items: center; }
  .style-cards          { grid-template-columns: 1fr 1fr; }
  .slides-types-grid    { grid-template-columns: repeat(3, 1fr); }
  .competence-row       { grid-template-columns: 1fr 100px 60px 36px 20px; }
}


/* ── Profil preview dans wizard portfolio ───────────────── */
.profil-preview-card {
  background: var(--hover);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow: hidden;
}

.profil-preview-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.profil-preview-avatar {
  width: 52px !important;
  height: 52px !important;
  max-width: 52px !important;
  max-height: 52px !important;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  flex-shrink: 0;
  display: block;
}

.profil-preview-avatar-init {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-g);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
  border: 2px solid var(--accent);
}

.profil-preview-nom {
  font-weight: 700;
  font-size: 15px;
}

.profil-preview-poste {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

.profil-preview-ville {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.profil-preview-resume {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 8px;
  font-style: italic;
}

.profil-preview-meta {
  font-size: 12px;
  color: var(--sub);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profil-preview-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
  padding: 8px 12px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Saisie badge sur les slide type cards ──────────────── */
.saisie-badge {
  font-size: 9px;
  background: rgba(59,130,246,.2);
  color: var(--blue);
  border: 1px solid rgba(59,130,246,.4);
  border-radius: 20px;
  padding: 2px 7px;
  margin-top: 3px;
  display: inline-block;
}

/* ── Slide saisie form confirmée ────────────────────────── */
.slide-saisie-form.confirmed {
  border-color: var(--green);
}

.slide-saisie-form.confirmed .slide-saisie-header strong {
  color: var(--green);
}

/* ── Indicateur style sélectionné dans étape 2 ──────────── */
#portfolio-style-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--accent-g);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

/* ══ AJOUTS v4.4 — Boutons éditeur CV ══════════════════════ */

/* Animation shake pour blocs en limite */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-4px); }
  75%       { transform: translateX(4px); }
}

/* Bouton Condenser missions */
.btn-condenser {
  background: rgba(239,68,68,.12) !important;
  color: var(--red) !important;
  border-color: rgba(239,68,68,.3) !important;
}
.btn-condenser:hover { background: rgba(239,68,68,.22) !important; }

/* Bouton Allonger missions */
.btn-allonger {
  background: rgba(59,130,246,.12) !important;
  color: #3b82f6 !important;
  border-color: rgba(59,130,246,.3) !important;
}
.btn-allonger:hover { background: rgba(59,130,246,.22) !important; }

/* Boutons ↑↓ déplacer blocs */
.btn-move-up, .btn-move-down {
  opacity: 0.6;
  transition: opacity .15s, transform .15s;
}
.btn-move-up:hover, .btn-move-down:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* Bouton IA section custom */
.btn-cs-improve { font-size: 10px !important; padding: 3px 8px !important; }

/* Modal sections préformatées */
#sections-preformatees-grid .btn {
  justify-content: flex-start;
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all .15s;
}
#sections-preformatees-grid .btn:hover {
  border-color: var(--accent);
  background: var(--accent-g);
  color: var(--accent);
}

/* Grille modèles LM — 4 colonnes */
.lettre-modele-grid {
  grid-template-columns: repeat(4, 1fr);
}
@media(max-width: 700px) {
  .lettre-modele-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Admin stats */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.admin-stat-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 8px; transition: all .15s;
}
.admin-stat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.admin-stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.admin-stat-val { font-size: 28px; font-weight: 900; color: var(--text); line-height: 1; }
.admin-stat-label { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.admin-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.admin-card-title { font-size: 13px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; background: var(--hover); border-bottom: 1px solid var(--border); }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--hover); }
.admin-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.admin-badge-ok  { background: rgba(8,145,178,.15); color: var(--accent); }
.admin-badge-off { background: rgba(239,68,68,.15);  color: var(--red);   }
.admin-badge-pro { background: rgba(245,158,11,.15); color: var(--amber); }
.admin-badge-free { background: var(--hover); color: var(--muted); }
.admin-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.admin-filters input, .admin-filters select { font-size: 13px; padding: 7px 10px; background: var(--input-bg); border: 1px solid var(--border2); color: var(--text); border-radius: 7px; }
.admin-pagination { display: flex; gap: 4px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.admin-log-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.admin-log-row:last-child { border-bottom: none; }
.admin-log-icon { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.admin-bar-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.admin-bar-row:last-child { border-bottom: none; }
.admin-bar-label { font-size: 12px; min-width: 120px; color: var(--text); }
.admin-bar-track { flex: 1; height: 6px; background: var(--hover); border-radius: 3px; overflow: hidden; }
.admin-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s ease; }
.admin-bar-val { font-size: 12px; color: var(--muted); min-width: 36px; text-align: right; }
@media(max-width: 768px) {
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-table th, .admin-table td { padding: 7px 8px; font-size: 11px; }
}

/* ── Portfolio style cards ──────────────────────────────── */
.portfolio-styles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.portfolio-style-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.portfolio-style-card:hover { border-color: var(--accent); }
.portfolio-style-card.selected {
  border-color: var(--accent);
  background: var(--accent-g);
}

/* ── Candidatures kanban ────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  min-height: 300px;
}

.kanban-col {
  min-width: 220px;
  flex: 1;
  background: var(--hover);
  border-radius: var(--radius);
  padding: 12px;
}

.kanban-col-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kanban-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s;
}
.kanban-card:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ── Admin tabs ─────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.admin-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px 8px 0 0;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--muted);
  background: none;
  transition: all .15s;
  font-family: inherit;
}
.admin-tab:hover { color: var(--text); background: var(--hover); }
.admin-tab.active {
  color: var(--accent);
  background: var(--accent-g);
  border-color: var(--accent);
}

.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }

/* ── Touch devices ──────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .btn:active { transform: scale(.97); }
  .quick-btn:active { transform: scale(.97); }
  .template-card:active { transform: scale(.98); }
  .nav-item:active { background: var(--hover); }
}

@media(max-width: 768px) {
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-tabs { width: 100%; }
  .admin-tab  { flex: 1; justify-content: center; font-size: 11px; padding: 6px 8px; }
  .kanban-board { flex-direction: column; }
  .kanban-col { min-width: unset; }
  .portfolio-styles-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Portfolio : saisie slide améliorée ─────────────────── */
.slide-saisie-form {
  background: var(--hover);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  position: relative;
  animation: fadeIn .2s ease;
}

.slide-saisie-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.slide-saisie-header strong {
  font-size: 13px;
  color: var(--accent);
}

/* Type card — toutes cliquables maintenant */
.slide-type-card {
  cursor: pointer;
  transition: all .15s;
}

.slide-type-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Bouton IA inline dans les formulaires saisie */
.btn-ia-champ {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: var(--accent-g);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 5px;
  font-size: 10px;
  padding: 2px 7px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all .15s;
}
.btn-ia-champ:hover {
  background: var(--accent);
  color: #0f1117;
}

/* Aperçu couleurs portfolio */
#portfolio-color-preview {
  transition: all .2s ease;
}

/* Grille slides preview — éviter overflow */
.slides-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  padding: 4px;
  max-height: 520px;
  overflow-y: auto;
}

@media(max-width: 768px) {
  .slides-preview-grid {
    grid-template-columns: repeat(2, 1fr);
    max-height: none;
  }
}

/* ══════════════════════════════════════════════════════
   TÉLÉPHONES — Ajustements pour petits écrans (≤ 480px)
════════════════════════════════════════════════════════ */
@media(max-width: 480px) {
  /* Réduire les paddings */
  .section {
    padding: 14px 12px;
  }

  /* Topbar compact */
  .topbar {
    padding: 0 10px;
  }

  /* Font-size réduits */
  .section-header h1 {
    font-size: 18px;
  }

  .btn-small {
    font-size: 10px;
    padding: 4px 8px;
  }

  /* Éditeur : boutons sur plusieurs lignes */
  .editor-btns {
    flex-wrap: wrap;
    gap: 3px;
  }

  .editor-panel-header {
    padding: 6px 8px;
  }

  /* Statistiques : 1 colonne */
  .dash-stats,
  .config-stats,
  .cand-stats {
    grid-template-columns: 1fr 1fr;
  }

  /* Modals plein écran sur téléphone */
  .modal-box {
    max-height: 95vh;
    margin: 6px;
    width: calc(100% - 12px);
  }

  /* Wizard : étapes en petit */
  .step-label {
    display: none;
  }

  .wizard-step {
    min-width: 36px;
  }

  /* Slide type grid : 2 colonnes */
  #slides-types-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Slides preview : 1 colonne */
  .slides-preview-grid {
    grid-template-columns: 1fr !important;
  }

  /* CV list card */
  .cv-card-actions {
    flex-wrap: wrap;
    gap: 4px;
  }

  /* Portfolio cards */
  .portfolios-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── Gestion Forfaits Admin ─────────────────────────────── */
.forfait-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--card-bg);
  transition: border-color .15s;
}

.forfait-card:hover {
  border-color: var(--accent);
}

/* Bannière expiration — mobile friendly */
#forfait-expiration-banner {
  font-family: var(--font-main, 'Inter', sans-serif);
}

@media(max-width: 900px) {
  #forfait-expiration-banner {
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* ── Section Mon Plan ───────────────────────────────────────── */
#mon-plan-container .admin-card {
  margin-bottom: 0;
}

#mon-plan-container .admin-card + .admin-card {
  margin-top: 0;
}

/* Responsive Mon Plan */
@media(max-width: 600px) {
  #mon-plan-container > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── LM — Sections collapsibles ─────────────────────────── */
.form-section-title {
  cursor: pointer;
  user-select: none;
}
.form-section-title .btn-collapse-icon {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  transition: transform .2s ease;
  display: inline-block;
}
.form-section.collapsed .btn-collapse-icon {
  transform: rotate(-90deg);
}
.form-section.collapsed > *:not(.form-section-title) {
  display: none !important;
}

/* ── LM — Méthodes de création ──────────────────────────── */
.lm-methode-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.lm-methode-btn {
  flex: 1;
  min-width: 80px;
  padding: 8px 6px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  line-height: 1.4;
}
.lm-methode-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.lm-methode-btn.active {
  border-color: var(--accent);
  background: var(--accent)22;
  color: var(--accent);
}
.lm-methode-btn i { display: block; font-size: 16px; margin-bottom: 3px; }

/* ── LM — Browser offres ────────────────────────────────── */
#lm-offres-browser {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg2);
  padding: 10px;
  margin-top: 8px;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}
#lm-offres-browser.visible { display: block; }
.lm-offre-item {
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.lm-offre-item:hover {
  border-color: var(--accent);
  background: var(--accent)11;
}
.lm-offre-item.selected {
  border-color: var(--accent);
  background: var(--accent)22;
}
.lm-offre-titre { font-weight: 700; font-size: 12px; margin-bottom: 2px; }
.lm-offre-meta  { font-size: 11px; color: var(--muted); }

/* ── LM — Source données candidat ──────────────────────── */
.lm-source-card {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color .15s;
  background: var(--bg2);
}
.lm-source-card.selected {
  border-color: var(--accent);
  background: var(--accent)11;
}
.lm-source-card i { color: var(--accent); }