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

:root {
  --cream: #f7f3eb;
  --bg: #ede8dc;
  --terra: #b85c2a;
  --terra-dark: #9e4e22;
  --text: #1e1a14;
  --text-light: #5a4f3c;
  --text-muted: #b0a08a;
  --border: #ddd5c0;
  --border-light: #cfc5b0;
  --surface: #fdfaf5;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
.app {
  display: none;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar { width: 210px; background: var(--cream); border-right: 0.5px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 18px 16px 16px; border-bottom: 1px solid var(--border); }
.logo { font-family: 'Playfair Display', serif; font-size: 22px; color: var(--text); letter-spacing: -0.3px; display: flex; align-items: center; gap: 9px; }
.logo-mark { width: 9px; height: 9px; border-radius: 50%; background: var(--terra); flex-shrink: 0; }
.nav { flex: 1; padding: 10px 8px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 9px; cursor: pointer;
  font-size: 12.5px; color: var(--text-light); user-select: none;
  transition: background 0.2s, color 0.2s;
}
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--terra); color: var(--cream); }
.nav-icon { display: flex; align-items: center; flex-shrink: 0; opacity: 0.55; transition: opacity 0.2s; }
.nav-icon svg { width: 14px; height: 14px; stroke-width: 1.75; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-divider { height: 1px; background: var(--border); margin: 6px 10px; }
.nav-section-label { padding: 8px 10px 3px; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 500; }

/* ── Main layout ── */
.main { flex: 1; display: flex; overflow: hidden; }

/* ── Chat panel ── */
.chat-panel { display: flex; flex-direction: column; background: var(--surface); flex: 1; }
.chat-panel.side { width: 320px; flex: none; border-left: 0.5px solid var(--border); }
.chat-header { padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--cream); display: flex; align-items: center; }
.chat-title { font-family: 'Playfair Display', serif; font-size: 17px; color: var(--text); }

.messages { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }

/* Message rows avec avatar */
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 88%; }
.msg.user { align-self: flex-end; justify-content: flex-end; flex-direction: row-reverse; }
.msg.assistant { align-self: flex-start; }

.msg-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--terra); color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; flex-shrink: 0;
  margin-bottom: 18px;
}

.bubble {
  padding: 10px 14px; border-radius: 16px;
  font-size: 13px; line-height: 1.65;
  word-break: break-word;
}
/* Markdown dans les bulles assistant */
.bubble p { margin: 0 0 6px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { padding-left: 18px; margin: 4px 0; }
.bubble li { margin: 2px 0; }
.bubble strong { font-weight: 600; }
.bubble code { background: rgba(0,0,0,0.07); padding: 1px 5px; border-radius: 4px; font-size: 12px; font-family: 'Courier New', monospace; }
.bubble pre { background: rgba(0,0,0,0.07); padding: 8px 10px; border-radius: 8px; overflow-x: auto; margin: 6px 0; }
.bubble pre code { background: none; padding: 0; }

.msg.assistant .bubble {
  background: var(--bg); color: var(--text);
  border-bottom-left-radius: 4px;
  border: 0.5px solid var(--border);
  max-width: 520px;
}
.msg.user .bubble { background: var(--terra); color: var(--cream); border-bottom-right-radius: 4px; }
.msg-time { font-size: 10px; color: var(--text-muted); margin-top: 3px; font-family: 'Courier New', monospace; }
.msg.user .msg-time { text-align: right; }

/* ── Input area ── */
.input-area { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; align-items: flex-end; gap: 10px; background: var(--cream); }
.input-wrap {
  flex: 1; background: var(--bg); border-radius: 18px;
  display: flex; align-items: flex-end; padding: 9px 16px;
  border: 0.5px solid var(--border-light);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-wrap:focus-within {
  border-color: var(--terra);
  box-shadow: 0 0 0 2px rgba(184,92,42,0.12);
}
.chat-input {
  flex: 1; font-size: 13px; color: var(--text);
  background: transparent; border: none; outline: none;
  font-family: 'Inter', sans-serif;
  resize: none; overflow-y: hidden;
  line-height: 1.5; max-height: 120px;
  padding: 0;
}
.chat-input::placeholder { color: var(--text-muted); font-style: italic; }
.send-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--terra); display: flex; align-items: center;
  justify-content: center; color: var(--cream); cursor: pointer;
  border: none; font-size: 15px; flex-shrink: 0;
  transition: background 0.2s, transform 0.1s;
  margin-bottom: 1px;
}
.send-btn:hover { background: var(--terra-dark); transform: scale(1.05); }
.send-btn:active { transform: scale(0.95); }
.send-btn:disabled { opacity: 0.5; cursor: default; transform: none; }

/* ── Module panel ── */
.module-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border-right: 0.5px solid var(--border); }
.module-header { padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--cream); display: flex; align-items: center; gap: 10px; }
.module-title { font-family: 'Playfair Display', serif; font-size: 17px; color: var(--text); }
.module-content {
  flex: 1; padding: 24px; overflow-y: auto; color: var(--text-light); font-size: 13px;
  animation: fadeIn 0.22s ease;
}

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

/* ── Tables ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 8px 12px; color: var(--text-muted); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 9px 12px; color: var(--text); border-bottom: 0.5px solid var(--bg); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.data-table .cell-muted { color: var(--text-muted); }

/* ── Action buttons ── */
.action-btn {
  background: none; border: none; cursor: pointer;
  padding: 2px 5px; border-radius: 4px; font-size: 12px;
  opacity: 0; transition: opacity 0.15s, color 0.15s;
}
tr:hover .action-btn { opacity: 1; }
.delete-btn { color: var(--text-muted); }
.delete-btn:hover { color: #c0392b; }
.edit-btn { color: var(--text-muted); }
.edit-btn:hover { color: var(--terra); }

/* ── Empty state ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px;
  padding: 60px 20px; color: var(--text-muted);
  font-size: 13px; text-align: center;
}
.empty-state svg { opacity: 0.35; }
.empty-state p { line-height: 1.6; max-width: 260px; }

/* ── Loading dots ── */
.loading-dots { display: inline-flex; align-items: center; gap: 5px; padding: 2px 0; }
.loading-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--terra); opacity: 0.3; animation: dot-pulse 1.2s ease-in-out infinite; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ── Boutons génériques ── */
button { transition: opacity 0.2s, background 0.2s, transform 0.1s; }
button:active:not(:disabled) { transform: scale(0.97); }

/* ══════════════════════════════════════════════════════
   RESPONSIVE MOBILE  (< 768px)
   ══════════════════════════════════════════════════════ */

/* ── Hamburger ── */
.hamburger-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text-light); padding: 4px; margin-right: 8px;
  border-radius: 6px; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ── Sidebar mobile overlay ── */
.mobile-sidebar-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,0);
  transition: background 0.28s ease;
  pointer-events: none;
}
.mobile-sidebar-overlay.open {
  background: rgba(0,0,0,0.4);
  pointer-events: all;
}
.mobile-sidebar {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 260px; background: var(--cream);
  border-right: 0.5px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 4px 0 24px rgba(0,0,0,0.08);
}
.mobile-sidebar-overlay.open .mobile-sidebar {
  transform: translateX(0);
}
.mobile-sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 16px; border-bottom: 0.5px solid var(--border);
}
.mobile-sidebar-nav {
  flex: 1; padding: 10px 8px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 1px;
}

.chat-bubble {
  display: none;
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  right: 16px;
  z-index: 150;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--terra); border: none; cursor: pointer;
  box-shadow: 0 4px 16px rgba(184,92,42,0.4);
  align-items: center; justify-content: center;
  transition: transform 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.chat-bubble:active { transform: scale(0.92); }

.chat-drawer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  border-top: 0.5px solid var(--border);
  display: flex; flex-direction: column;
  height: 82vh;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.12);
  padding-bottom: env(safe-area-inset-bottom);
}
.chat-drawer.open { transform: translateY(0); }
.chat-drawer-handle {
  display: flex; justify-content: center;
  padding: 12px 0 6px; cursor: pointer;
}
.chat-drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 16px 12px; border-bottom: 0.5px solid var(--border);
}

@media (max-width: 767px) {
  /* Sidebar desktop cachée */
  .sidebar { display: none !important; }

  /* Hamburger visible */
  .hamburger-btn { display: flex; }

  /* Layout colonne */
  .app { flex-direction: column; }
  .main { flex-direction: column; }

  /* Module pleine largeur */
  .module-panel { width: 100%; border-right: none; overflow-y: auto; }
  .module-content {
    padding: 16px;
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
    overflow-y: visible;
  }

  /* Chat panel latéral caché */
  .chat-panel.side { display: none; }

  /* Chat général pleine hauteur */
  .chat-panel:not(.side) {
    height: 100dvh;
  }

  /* Bulle et drawer visibles */
  .chat-bubble { display: flex; }

  /* Tableaux scrollables */
  .module-content { overflow-x: hidden; }
  .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Bulles messages */
  .msg { max-width: 92%; }
  .msg.assistant .bubble { max-width: 100%; }

  /* Header avec safe-area pour Dynamic Island */
  .module-header {
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
  }
  .chat-header {
    gap: 0;
    padding-top: calc(14px + env(safe-area-inset-top));
  }
  .module-title { font-size: 15px; }
}

/* ── Mode analyse jobs ── */
.main.jobs-analyse-mode .chat-panel.side {
  width: 500px;
  flex: none;
  transition: width 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.main.jobs-analyse-mode .module-panel {
  transition: flex 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.jobs-analyse-panel {
  width: 500px; flex: none;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-left: 0.5px solid var(--border);
  overflow: hidden;
  animation: fadeIn 0.22s ease;
  transition: width 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.jobs-analyse-panel .analyse-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
  display: flex; align-items: center; justify-content: space-between;
}
.jobs-analyse-panel .analyse-content {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}

/* Verdict badges */
.verdict-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 10px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.verdict-a_voir    { background: rgba(39,174,96,0.12);  color: #27ae60; border: 0.5px solid rgba(39,174,96,0.3); }
.verdict-hors_scope { background: rgba(192,57,43,0.10); color: #c0392b; border: 0.5px solid rgba(192,57,43,0.25); }
.verdict-deja_vu   { background: rgba(176,160,138,0.15); color: var(--text-muted); border: 0.5px solid var(--border); }

/* Cards candidatures */
.job-card {
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background: var(--cream);
  overflow: hidden;
  transition: box-shadow 0.2s;
  position: relative;
}
.job-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.job-card .relance-banner {
  background: rgba(184,92,42,0.1);
  border-bottom: 0.5px solid rgba(184,92,42,0.2);
  padding: 5px 16px;
  font-size: 11px; font-weight: 500;
  color: var(--terra);
  display: flex; align-items: center; gap: 6px;
}
.job-card .card-body { padding: 14px 16px; }
.job-card .card-footer {
  padding: 8px 16px;
  border-top: 0.5px solid var(--border);
  background: var(--bg);
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}

/* Statut candidature colors */
.statut-badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 10px; font-size: 11px; font-weight: 500;
}

/* Tabs jobs */
.jobs-tabs {
  display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap;
}
.jobs-tab {
  padding: 7px 16px; border-radius: 8px;
  border: 0.5px solid var(--border);
  font-size: 12px; cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.2s, color 0.2s;
}
.jobs-tab.active { background: var(--terra); color: var(--cream); border-color: var(--terra); }
.jobs-tab:not(.active) { background: var(--cream); color: var(--text-muted); }

/* ── Login screen ── */
.login-screen {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--cream); border-radius: 16px;
  padding: 40px 36px; width: 360px; max-width: 90vw;
  display: flex; flex-direction: column; gap: 24px;
  border: 0.5px solid var(--border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
}
.login-logo {
  display: flex; align-items: center; gap: 10px;
  justify-content: center;
}
.login-input {
  padding: 11px 14px; border: 0.5px solid var(--border);
  border-radius: 10px; background: var(--bg); color: var(--text);
  font-family: 'Inter', sans-serif; font-size: 14px;
  outline: none; width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-input:focus {
  border-color: var(--terra);
  box-shadow: 0 0 0 2px rgba(184,92,42,0.12);
}
.login-btn {
  padding: 11px 14px; background: var(--terra); color: var(--cream);
  border: none; border-radius: 10px; font-family: 'Inter', sans-serif;
  font-size: 14px; cursor: pointer; width: 100%;
  transition: background 0.2s;
}
.login-btn:hover { background: var(--terra-dark); }
/* ─── BDC — Base de Connaissances ─────────────────────────────────────────── */

/* Layout principal */
.bdc-layout {
  display: flex;
  height: 100%;
  gap: 0;
  overflow: hidden;
}

.bdc-sidebar {
  width: 220px;
  min-width: 220px;
  border-right: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg);
}

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

/* Sidebar catégories */
.bdc-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 8px;
  border-bottom: 0.5px solid var(--border);
}

.bdc-category-tree {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.bdc-cat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.15s;
  font-size: 12.5px;
  color: var(--text);
}

.bdc-cat-item:hover { background: var(--border); }
.bdc-cat-item.active { background: rgba(139, 115, 85, 0.1); color: var(--terra); }

.bdc-cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.bdc-cat-actions {
  display: none;
  gap: 2px;
  flex-shrink: 0;
}

.bdc-cat-item:hover .bdc-cat-actions { display: flex; }

/* Main — header */
.bdc-main-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}

.bdc-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  flex: 1;
}

/* Liste des articles */
.bdc-entries-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bdc-entry-card {
  background: var(--cream);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.bdc-entry-card:hover {
  border-color: var(--terra);
  box-shadow: 0 2px 8px rgba(139, 115, 85, 0.1);
}

.bdc-entry-card.bdc-obsolete {
  opacity: 0.55;
  background: var(--bg);
}

.bdc-entry-card.bdc-pinned {
  border-left: 2.5px solid var(--terra);
}

.bdc-entry-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.bdc-entry-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.bdc-entry-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.bdc-entry-date { color: var(--text-muted); }

.bdc-entry-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Vue consultation */
.bdc-view-meta {
  padding: 16px 24px 12px;
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bdc-view-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.bdc-view-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
}

.bdc-view-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 18px;
  border-top: 0.5px solid var(--border);
  flex-shrink: 0;
}

/* Éditeur split */
.bdc-editor-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.bdc-back-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.bdc-back-btn:hover { background: var(--border); color: var(--text); }

.bdc-breadcrumb {
  font-size: 11px;
  color: var(--terra);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bdc-editor-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}

.bdc-title-input {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  color: var(--text);
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  padding: 2px 0;
}
.bdc-title-input::placeholder { color: var(--text-muted); }

.bdc-select-sm {
  padding: 5px 8px;
  border: 0.5px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  max-width: 220px;
}

.bdc-tags-input {
  padding: 5px 10px;
  border: 0.5px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  flex: 1;
}

.bdc-entry-dates {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Split éditeur */
.bdc-split-editor {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 0;
}

.bdc-split-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.bdc-editor-pane {
  border-right: 0.5px solid var(--border);
}

.bdc-pane-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 6px 12px;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.bdc-content-textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  padding: 14px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--cream);
  overflow-y: auto;
}

.bdc-preview-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
}

.bdc-preview-content h1,
.bdc-preview-content h2,
.bdc-preview-content h3 {
  font-family: 'Playfair Display', serif;
  color: var(--text);
  margin-top: 1.2em;
  margin-bottom: 0.5em;
}

.bdc-preview-content h2 { font-size: 15px; }
.bdc-preview-content h3 { font-size: 13.5px; }

.bdc-preview-content code {
  background: var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
}

.bdc-preview-content pre {
  background: var(--border);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
}

.bdc-preview-content ul, .bdc-preview-content ol {
  padding-left: 20px;
}

.bdc-preview-content blockquote {
  border-left: 3px solid var(--terra);
  margin-left: 0;
  padding-left: 12px;
  color: var(--text-light);
}

/* Footer éditeur */
.bdc-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 0.5px solid var(--border);
  flex-shrink: 0;
  gap: 10px;
  flex-wrap: wrap;
}

.bdc-links-section {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.bdc-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(139, 115, 85, 0.1);
  border: 0.5px solid var(--terra);
  border-radius: 20px;
  font-size: 11px;
  color: var(--terra);
  cursor: pointer;
  transition: background 0.15s;
}
.bdc-link-pill:hover { background: rgba(139, 115, 85, 0.2); }

/* Badges */
.bdc-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 500;
  flex-shrink: 0;
}

.bdc-badge-obsolete {
  background: #fdf0f0;
  color: #c0392b;
  border: 0.5px solid #f5c6c6;
}

.bdc-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  background: var(--bg);
  border: 0.5px solid var(--border);
  border-radius: 20px;
  font-size: 10.5px;
  color: var(--text-muted);
}

.bdc-source-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  border: 0.5px solid var(--border);
}
.bdc-source-manual { background: var(--bg); color: var(--text-muted); }
.bdc-source-chat   { background: rgba(139, 115, 85, 0.08); color: var(--terra); border-color: var(--terra); }
.bdc-source-import { background: #f0f4ff; color: #3b5bdb; border-color: #aec1fa; }

.bdc-author-badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--bg);
  border: 0.5px solid var(--border);
  color: var(--text-muted);
}

/* Boutons */
.bdc-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
}
.bdc-icon-btn:hover { background: var(--border); color: var(--text); }
.bdc-icon-btn.danger:hover { color: #c0392b; background: #fdf0f0; }

.bdc-icon-btn-sm {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
}
.bdc-icon-btn-sm:hover { background: var(--border); color: var(--text); }

.btn-primary-sm {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  background: var(--terra);
  color: var(--cream);
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-primary-sm:hover { opacity: 0.88; }

.btn-secondary-sm {
  padding: 6px 13px;
  background: var(--bg);
  color: var(--text-light);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary-sm:hover { background: var(--border); }

/* Empty state */
.bdc-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* Panneau Suggest (élargi à droite) */
.bdc-suggest-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.bdc-suggest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}

.bdc-suggest-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}

.bdc-suggest-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 0.5px solid var(--border);
  flex-shrink: 0;
}

/* Mobile */
.bdc-mobile {
  flex-direction: column;
}

.bdc-mobile .bdc-sidebar {
  width: 100%;
  min-width: 100%;
  max-height: 180px;
  border-right: none;
  border-bottom: 0.5px solid var(--border);
}

.bdc-mobile .bdc-category-tree {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 4px;
  padding: 6px 8px;
}

.bdc-mobile .bdc-cat-item {
  white-space: nowrap;
  border-radius: 8px;
  padding: 6px 10px;
}

/* Mobile split -> tabs */
@media (max-width: 768px) {
  .bdc-split-editor {
    flex-direction: column;
  }
  .bdc-editor-pane {
    border-right: none;
    border-bottom: 0.5px solid var(--border);
    flex: 0 0 40%;
  }
}

/* ══════════════════════════════════════════════════════════════
   MODULE VEILLE — à ajouter à la fin de styles.css
   ══════════════════════════════════════════════════════════════ */

/* ── Container & toolbar ── */
.veille-container { padding: 0; display: flex; flex-direction: column; gap: 20px; animation: fadeIn 0.2s ease; }

.veille-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.veille-toolbar-left { display: flex; align-items: center; gap: 8px; }

.veille-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 12.5px;
  cursor: pointer; border: 0.5px solid var(--border); background: var(--cream);
  color: var(--text-light); transition: background 0.15s, color 0.15s;
}
.veille-btn:hover { background: var(--bg); }
.veille-btn-primary { background: var(--terra); color: var(--cream); border-color: var(--terra); }
.veille-btn-primary:hover { background: var(--terra-dark); }
.veille-btn-sm { padding: 5px 9px; font-size: 12px; }
.veille-btn-danger { color: #c0392b; border-color: #f5c6c6; }
.veille-btn-danger:hover { background: #fdf0f0; }
.veille-btn.loading { opacity: 0.7; cursor: not-allowed; }

/* ── Bandeau global ── */
.veille-bandeau {
  background: var(--cream); border: 0.5px solid var(--border); border-radius: 12px;
  padding: 14px 18px; display: flex; flex-direction: column; gap: 8px;
}
.veille-bandeau-inner { display: flex; align-items: flex-start; gap: 12px; }
.veille-bandeau-icon {
  width: 30px; height: 30px; background: var(--terra); color: var(--cream);
  border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.veille-bandeau-text { display: flex; flex-direction: column; gap: 3px; }
.veille-bandeau-date { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }
.veille-bandeau-summary { font-size: 13.5px; color: var(--text); line-height: 1.5; font-style: italic; }
.veille-bandeau-empty .veille-bandeau-icon { background: var(--border); color: var(--text-muted); }
.veille-empty-subjects {
  font-size: 12px; color: var(--text-muted); padding: 6px 10px;
  background: var(--bg); border-radius: 6px; border-left: 3px solid var(--border);
}

.veille-no-news-banner {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-muted);
  background: var(--bg); border-radius: 8px; padding: 10px 14px;
  border: 0.5px solid var(--border);
}

/* ── Filtres ── */
.veille-filters { display: flex; gap: 6px; }
.veille-filter-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 20px; font-family: 'Inter', sans-serif; font-size: 12px;
  cursor: pointer; border: 0.5px solid var(--border); background: var(--cream); color: var(--text-light);
  transition: all 0.15s;
}
.veille-filter-btn:hover { background: var(--bg); }
.veille-filter-btn.active { background: var(--terra); color: var(--cream); border-color: var(--terra); }
.veille-filter-count {
  background: rgba(0,0,0,0.1); border-radius: 10px; padding: 1px 6px; font-size: 11px;
}
.veille-filter-btn.active .veille-filter-count { background: rgba(255,255,255,0.25); }

/* ── Cards grille ── */
.veille-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
}

.veille-card {
  background: var(--cream); border: 0.5px solid var(--border); border-radius: 12px;
  padding: 16px; cursor: pointer; transition: box-shadow 0.15s, transform 0.15s;
  display: flex; flex-direction: column; gap: 10px;
}
.veille-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-1px); }
.veille-card-read { opacity: 0.65; }
.veille-card-read:hover { opacity: 1; }

.veille-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 10px; }
.veille-card-subject { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; }

.veille-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px; font-size: 10.5px; font-weight: 500; flex-shrink: 0;
}
.veille-badge-unread { background: var(--terra); color: var(--cream); }
.veille-badge-read { background: var(--bg); color: var(--text-muted); border: 0.5px solid var(--border); }

.veille-card-title { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.4; }
.veille-card-summary { font-size: 12.5px; color: var(--text-light); line-height: 1.55; flex: 1; }
.veille-card-meta { display: flex; align-items: center; gap: 10px; }
.veille-card-meta-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); }

/* ── Empty states veille ── */
.veille-empty-filter {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 48px 24px; color: var(--text-muted); font-size: 13px; text-align: center;
}
.veille-onboarding {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 60px 24px; text-align: center;
}
.veille-onboarding p { font-size: 13px; color: var(--text-muted); }

/* ── Vue rapport ── */
.veille-report-view {
  display: flex; flex-direction: column; gap: 0; height: 100%; overflow-y: auto;
  animation: fadeIn 0.2s ease;
}

.veille-report-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 0.5px solid var(--border);
  background: var(--cream); position: sticky; top: 0; z-index: 10; flex-shrink: 0;
}
.veille-report-topbar-right { display: flex; align-items: center; gap: 10px; }
.veille-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 8px; border: 0.5px solid var(--border);
  background: none; color: var(--text-light); font-family: 'Inter', sans-serif; font-size: 12.5px; cursor: pointer;
  transition: background 0.15s;
}
.veille-back-btn:hover { background: var(--bg); }

.veille-read-indicator {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: #27ae60; font-weight: 500;
}

.veille-report-header { padding: 28px 24px 20px; border-bottom: 0.5px solid var(--border); }
.veille-report-subject {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.veille-report-title {
  font-family: 'Playfair Display', serif; font-size: 22px; color: var(--text);
  line-height: 1.35; margin-bottom: 8px;
}
.veille-report-date { font-size: 12px; color: var(--text-muted); text-transform: capitalize; }

.veille-report-content {
  padding: 24px; font-size: 13.5px; line-height: 1.75; color: var(--text);
}
.veille-report-content h2 { font-family: 'Playfair Display', serif; font-size: 17px; margin: 20px 0 10px; color: var(--text); }
.veille-report-content h3 { font-size: 14px; font-weight: 600; margin: 14px 0 6px; color: var(--text); }
.veille-report-content p { margin-bottom: 12px; }
.veille-report-content ul, .veille-report-content ol { padding-left: 20px; margin-bottom: 12px; }
.veille-report-content li { margin-bottom: 4px; }
.veille-report-content strong { font-weight: 600; }
.veille-report-content a { color: var(--terra); text-decoration: none; }
.veille-report-content a:hover { text-decoration: underline; }
.veille-report-content code { background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; font-family: 'Courier New', monospace; }

/* ── Sources ── */
.veille-sources {
  margin: 0 24px 24px; padding: 18px; background: var(--bg); border-radius: 10px;
  border: 0.5px solid var(--border);
}
.veille-sources-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); margin-bottom: 12px;
}
.veille-sources-list { display: flex; flex-direction: column; gap: 8px; }

.veille-source-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--cream); border-radius: 8px;
  border: 0.5px solid var(--border); text-decoration: none; color: var(--text);
  transition: background 0.15s; cursor: pointer;
}
.veille-source-item:hover { background: var(--surface); }
.veille-source-reliability { font-size: 14px; flex-shrink: 0; }
.veille-source-info { flex: 1; min-width: 0; }
.veille-source-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.veille-source-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.veille-source-date { font-size: 11px; color: var(--text-muted); }
.veille-source-rel-label { font-size: 11px; color: var(--text-muted); }

.veille-reliability-confirmed { border-left: 3px solid #27ae60; }
.veille-reliability-probable  { border-left: 3px solid #f39c12; }
.veille-reliability-warning   { border-left: 3px solid #e74c3c; }

/* ── Vue historique ── */
.veille-history { display: flex; flex-direction: column; gap: 24px; }
.veille-history-group { display: flex; flex-direction: column; gap: 8px; }
.veille-history-date {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600;
  color: var(--text-muted); padding-bottom: 4px; border-bottom: 0.5px solid var(--border);
}
.veille-history-reports { display: flex; flex-direction: column; gap: 6px; }
.veille-history-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--cream); border-radius: 8px;
  border: 0.5px solid var(--border); cursor: pointer; transition: background 0.15s;
}
.veille-history-item:hover { background: var(--bg); }
.veille-history-subject { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; flex-shrink: 0; min-width: 120px; }
.veille-history-title { flex: 1; font-size: 13px; color: var(--text); }

/* ── Vue config ── */
.veille-config-section { display: flex; flex-direction: column; gap: 12px; }
.veille-config-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; color: var(--text-muted); }
.veille-config-subjects { display: flex; flex-direction: column; gap: 8px; }

.veille-config-subject {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 16px; background: var(--cream); border-radius: 10px; border: 0.5px solid var(--border);
}
.veille-config-subject-left { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; }
.veille-config-subject-icon {
  width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0;
}
.veille-config-subject-info { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.veille-config-subject-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.veille-config-subject-desc { font-size: 12px; color: var(--text-muted); }
.veille-config-subject-queries { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.veille-query-tag {
  padding: 2px 8px; background: var(--bg); border-radius: 10px;
  font-size: 11px; color: var(--text-muted); border: 0.5px solid var(--border);
}
.veille-config-subject-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.veille-toggle-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; border: 0.5px solid var(--border);
  background: var(--bg); cursor: pointer; color: var(--text-muted); transition: all 0.15s;
}
.veille-toggle-btn.active { background: #e8f5e9; color: #27ae60; border-color: #c8e6c9; }
.veille-toggle-btn:hover { background: var(--border); }

/* ── Presets ── */
.veille-presets-grid { display: flex; flex-direction: column; gap: 6px; }
.veille-preset-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--cream); border-radius: 10px;
  border: 0.5px solid var(--border); cursor: pointer; text-align: left;
  transition: background 0.15s, border-color 0.15s; width: 100%;
}
.veille-preset-btn:hover { background: var(--bg); border-color: var(--terra); }
.veille-preset-icon { width: 32px; height: 32px; border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.veille-preset-info { flex: 1; }
.veille-preset-name { font-size: 13px; font-weight: 600; color: var(--text); }
.veille-preset-desc { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

/* ── Modal label ── */
.veille-modal-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 500; }

/* ── Animation spin pour le bouton générer ── */
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ── Responsive mobile ── */
@media (max-width: 768px) {
  .veille-container { padding: 16px; gap: 14px; }
  .veille-cards-grid { grid-template-columns: 1fr; }
  .veille-report-header { padding: 20px 16px 16px; }
  .veille-report-title { font-size: 18px; }
  .veille-report-content { padding: 16px; }
  .veille-sources { margin: 0 16px 16px; }
  .veille-history-item { flex-wrap: wrap; }
  .veille-history-subject { min-width: unset; }
  .veille-config-subject { flex-direction: column; }
  .veille-config-subject-actions { align-self: flex-end; }
}

/* ══════════════════════════════════════════════════════════════
   MODULE BUDGET — à ajouter à la fin de styles.css
   ══════════════════════════════════════════════════════════════ */

/* ── Container ── */
.budget-container { padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; animation: fadeIn 0.2s ease; }

/* ── Couleurs sémantiques ── */
.budget-gain  { color: #27ae60; }
.budget-perte { color: #e74c3c; }

/* ── Bandeau ── */
.budget-bandeau {
  display: flex; align-items: stretch; gap: 0;
  background: var(--cream); border: 0.5px solid var(--border); border-radius: 12px;
  overflow: hidden; position: relative;
}
.budget-bandeau-alerte { border-color: #f5c6c6; }
.budget-bandeau-bloc {
  flex: 1; padding: 14px 18px; display: flex; flex-direction: column; gap: 4px;
}
.budget-bloc-alerte { background: #fff8f8; }
.budget-bandeau-sep { width: 0.5px; background: var(--border); flex-shrink: 0; }
.budget-bandeau-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 500;
}
.budget-bandeau-value { font-size: 19px; font-weight: 600; color: var(--text); font-family: 'Inter', sans-serif; letter-spacing: -0.5px; }
.budget-bandeau-sub { font-size: 11px; color: var(--text-muted); }
.budget-patrimoine { color: var(--terra); }
.budget-paie-badge { font-size: 10.5px; color: var(--terra); font-weight: 500; background: var(--terra)15; padding: 1px 7px; border-radius: 10px; width: fit-content; }
.budget-config-btn {
  position: absolute; top: 10px; right: 10px;
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 4px; border-radius: 6px; transition: background 0.15s;
}
.budget-config-btn:hover { background: var(--bg); }

/* ── Boutons ── */
.budget-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 12px; border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 12.5px;
  cursor: pointer; border: 0.5px solid var(--border); background: var(--cream); color: var(--text-light);
  transition: background 0.15s;
}
.budget-btn:hover { background: var(--bg); }
.budget-btn-sm { padding: 5px 10px; font-size: 12px; }
.budget-btn-primary { background: var(--terra); color: var(--cream); border-color: var(--terra); }
.budget-btn-primary:hover { background: var(--terra-dark); }
.budget-btn-green { background: #27ae60; color: white; border-color: #27ae60; }
.budget-btn-green:hover { background: #219a52; }

/* ── Toolbar ── */
.budget-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.budget-toolbar-center { display: flex; align-items: center; gap: 10px; }
.budget-mois-label { font-size: 13px; font-weight: 500; color: var(--text); text-transform: capitalize; min-width: 130px; text-align: center; }

/* ── Panels (vue principale) ── */
.budget-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.budget-panel {
  background: var(--cream); border: 0.5px solid var(--border); border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.budget-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.budget-panel-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.budget-panel-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.budget-panel-section-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 500; margin-top: 4px; }
.budget-panel-stats { display: flex; gap: 0; border-top: 0.5px solid var(--border); padding-top: 10px; margin-top: 4px; }
.budget-stat-mini { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.budget-stat-label { font-size: 10.5px; color: var(--text-muted); }
.budget-stat-value { font-size: 13px; font-weight: 600; }

/* ── Transactions mini ── */
.budget-transactions-mini { display: flex; flex-direction: column; gap: 4px; }
.budget-transaction-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 0.5px solid var(--border);
}
.budget-transaction-row:last-child { border-bottom: none; }
.budget-tx-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.budget-tx-info { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.budget-tx-note { font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.budget-tx-cat { font-size: 10.5px; color: var(--text-muted); }
.budget-tx-date { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.budget-tx-montant { font-size: 13px; font-weight: 600; flex-shrink: 0; }

/* ── Catégories mini ── */
.budget-cats-mini { display: flex; flex-direction: column; gap: 5px; }
.budget-cat-row { display: flex; align-items: center; gap: 7px; }
.budget-cat-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.budget-cat-name { flex: 1; font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.budget-cat-bar-wrap { flex: 1; height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.budget-cat-bar { height: 100%; border-radius: 2px; transition: width 0.3s; }
.budget-cat-montant { font-size: 12px; font-weight: 500; color: var(--text); flex-shrink: 0; }

/* ── Tirelires mini ── */
.budget-tirelire-mini { display: flex; flex-direction: column; gap: 4px; }
.budget-tirelire-mini-header { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); }
.budget-tirelire-mini-montant { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--text-light); }
.budget-progress-bar { height: 5px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.budget-progress-fill { height: 100%; border-radius: 3px; transition: width 0.4s; }

/* ── Investissements mini ── */
.budget-invest-mini { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; }
.budget-invest-mini-left { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.budget-invest-mini-right { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.budget-invest-nom { font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.budget-invest-valeur { font-size: 12.5px; font-weight: 600; color: var(--text); }
.budget-invest-gain { font-size: 11px; font-weight: 500; }
.budget-invest-type {
  padding: 1px 6px; border-radius: 4px; font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.3px; flex-shrink: 0;
}
.budget-invest-type-action { background: #dbeafe; color: #1d4ed8; }
.budget-invest-type-etf    { background: #ede9fe; color: #6d28d9; }
.budget-invest-type-crypto { background: #fef3c7; color: #b45309; }
.budget-invest-type-autre  { background: var(--bg); color: var(--text-muted); }

/* ── Vue complète — stats row ── */
.budget-stats-row { display: flex; gap: 12px; }
.budget-stat-card {
  flex: 1; background: var(--cream); border: 0.5px solid var(--border); border-radius: 10px;
  padding: 12px 16px; display: flex; flex-direction: column; gap: 4px;
}
.budget-stat-card-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.budget-stat-card-value { font-size: 18px; font-weight: 600; color: var(--text); }

/* ── Section title ── */
.budget-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; color: var(--text-muted); padding-bottom: 4px; border-bottom: 0.5px solid var(--border); }

/* ── Catégories full ── */
.budget-cats-full { display: flex; flex-direction: column; gap: 8px; }
.budget-cat-full-row { display: flex; flex-direction: column; gap: 4px; }
.budget-cat-full-left { display: flex; align-items: center; gap: 8px; }
.budget-cat-budget-label { margin-left: auto; font-size: 12px; font-weight: 500; }
.budget-cat-bar-wrap-full { height: 5px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.budget-cat-bar-full { height: 100%; border-radius: 3px; transition: width 0.3s; }

/* ── Récurrents ── */
.budget-recurrents-list { display: flex; flex-direction: column; gap: 5px; }
.budget-recurrent-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--cream); border-radius: 8px; border: 0.5px solid var(--border);
}
.budget-recurrent-label { flex: 1; font-size: 13px; color: var(--text); }
.budget-recurrent-jour { font-size: 11px; color: var(--text-muted); background: var(--bg); padding: 1px 7px; border-radius: 10px; }
.budget-recurrent-montant { font-size: 13px; font-weight: 600; }

/* ── Catégories chips ── */
.budget-categories-list { display: flex; flex-wrap: wrap; gap: 8px; }
.budget-categorie-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 20px; border: 0.5px solid; font-size: 12px; cursor: default;
}
.budget-cat-budget { font-size: 10.5px; color: var(--text-muted); margin-left: 2px; }

/* ── Transactions list ── */
.budget-transactions-list { display: flex; flex-direction: column; gap: 2px; }

/* ── Action buttons ── */
.budget-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px; border: 0.5px solid var(--border);
  background: none; cursor: pointer; color: var(--text-muted); transition: all 0.15s; flex-shrink: 0;
}
.budget-action-btn:hover { background: var(--bg); color: var(--text); }
.budget-action-danger:hover { background: #fdf0f0; color: #c0392b; border-color: #f5c6c6; }

/* ── Répartition portefeuille ── */
.budget-repartition { display: flex; flex-direction: column; gap: 10px; }
.budget-repartition-item { display: flex; flex-direction: column; gap: 4px; }
.budget-repartition-bar { height: 8px; border-radius: 4px; transition: width 0.4s; }
.budget-repartition-label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-light); }

/* ── Tirelires grid ── */
.budget-tirelires-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.budget-tirelire-card {
  background: var(--cream); border: 0.5px solid var(--border); border-radius: 10px; padding: 14px;
}
.budget-tirelire-card-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.budget-tirelire-card-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.budget-tirelire-card-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.budget-tirelire-card-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.budget-tirelire-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 20px; background: var(--bg); border: 1.5px dashed var(--border); border-radius: 10px;
  cursor: pointer; color: var(--text-muted); font-size: 12.5px; transition: all 0.15s;
}
.budget-tirelire-add:hover { border-color: var(--terra); color: var(--terra); }

/* ── Investissements list ── */
.budget-invests-list { display: flex; flex-direction: column; gap: 8px; }
.budget-invest-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 14px; background: var(--cream); border: 0.5px solid var(--border); border-radius: 10px;
}
.budget-invest-row-left { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; }
.budget-invest-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }

/* ── Analyse Atlas ── */
.budget-analyse-result {
  background: var(--cream); border: 0.5px solid var(--border); border-radius: 10px;
  padding: 16px; min-height: 60px;
}
.budget-analyse-content { font-size: 13px; line-height: 1.7; color: var(--text); }
.budget-analyse-content h2 { font-family: 'Playfair Display', serif; font-size: 16px; margin: 14px 0 8px; }
.budget-analyse-content h3 { font-size: 13.5px; font-weight: 600; margin: 10px 0 5px; }
.budget-analyse-content p { margin-bottom: 10px; }
.budget-analyse-content ul { padding-left: 18px; margin-bottom: 10px; }
.budget-analyse-content li { margin-bottom: 3px; }
.budget-analyse-content strong { font-weight: 600; }

/* ── Empty states ── */
.budget-empty-mini { font-size: 12px; color: var(--text-muted); padding: 8px 0; font-style: italic; }

/* ── Modal label ── */
.budget-modal-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 500; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .budget-container { padding: 14px 16px; gap: 14px; }
  .budget-panels { grid-template-columns: 1fr; }
  .budget-bandeau { flex-direction: column; }
  .budget-bandeau-sep { width: 100%; height: 0.5px; }
  .budget-stats-row { flex-wrap: wrap; }
  .budget-stat-card { min-width: calc(50% - 6px); }
  .budget-tirelires-grid { grid-template-columns: 1fr; }
}
