/* Palette portee depuis le dashboard ProspectOS d'origine.
   Bleus profonds + accents typiques (Tailwind palette). */
:root {
  --bg:        #070d14;
  --rail-bg:   #060a10;
  --surface:   #0f1923;
  --surface-2: #0a1218;
  --sidebar:   #0a1218;
  --text:      #e2e8f0;
  --text-dim:  #94a3b8;
  --text-mute: #475569;
  --text-dead: #334155;
  --border:    #1e3a5f;
  --accent:    #3b82f6;  /* blue */
  --critical:  #ef4444;  /* red */
  --warning:   #f59e0b;  /* amber */
  --ok:        #22c55e;  /* green */
  --purple:    #a78bfa;
  --orange:    #f97316;
  --cyan:      #06b6d4;
  --gray:      #64748b;
  --font: "Outfit", -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; width: 100%; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

.loading { padding: 32px; color: var(--text-dim); text-align: center; }

/* Alignement sur crea404.com :
   Le header couvre la pleine largeur (background continu), mais son
   wrapper interne + main partagent la meme max-width 1200 + padding
   horizontal 40px (desktop) / 24px (mobile).
   Regle appliquee au main et a .topbar-inner (inline dans app.jsx). */
main {
  padding: 24px 40px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  word-break: break-word;
}
@media (max-width: 900px) {
  main {
    padding: 16px;
  }
  body {
    overflow-x: hidden;
  }
  .topbar-inner {
    gap: 8px !important;
  }
  .journal-entry {
    flex-wrap: wrap;
  }
  .topbar-inner {
    padding: 0 24px !important;
  }
  .topbar-inner > div:last-child {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .topbar-inner > div:last-child::-webkit-scrollbar {
    display: none;
  }
}

.alert-banner {
  background: var(--critical); color: white;
  padding: 12px 16px; border-radius: 8px; margin-bottom: 16px;
  font-weight: 500;
}

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

.project-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px;
  cursor: pointer; transition: border-color .15s;
}
.project-card:hover { border-color: var(--accent); }
.project-card h3 { font-size: 16px; margin-bottom: 8px; }
.project-card .meta { font-size: 12px; color: var(--text-dim); }
.project-card .agents-line { margin-top: 8px; font-size: 13px; }
.project-card .pin-btn { float: right; background: none; border: 0; color: var(--text-dim); cursor: pointer; }

.section { margin-top: 24px; }
.section h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); margin-bottom: 12px; }

.journal-entry {
  background: var(--surface); border: 1px solid var(--border);
  padding: 12px 16px; border-radius: 8px; margin-bottom: 8px;
  display: flex; gap: 12px; align-items: flex-start;
}
.journal-entry .badge {
  font-size: 10px; padding: 3px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .04em;
  flex-shrink: 0;
}
.badge.deploy { background: #1e3a8a; color: #93c5fd; }
.badge.decision { background: #5b21b6; color: #c4b5fd; }
.badge.fix { background: #14532d; color: #86efac; }
.badge.milestone { background: #b45309; color: #fde68a; }
.badge.config { background: #374151; color: #d1d5db; }
.badge.incident { background: #7f1d1d; color: #fca5a5; }
.badge.system { background: #1f2937; color: #9ca3af; }
.journal-entry .body { flex: 1; }
.journal-entry .body { min-width: 0; }
.journal-entry .body .titre { font-weight: 500; word-break: break-word; overflow-wrap: anywhere; }
.journal-entry .body .detail { font-size: 13px; color: var(--text-dim); margin-top: 2px; word-break: break-word; overflow-wrap: anywhere; }
.journal-entry .body .ts { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

.section * { max-width: 100%; }

.tab-bar {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border);
  margin-bottom: 16px; overflow-x: auto;
}
.tab-bar button {
  background: none; border: 0; color: var(--text-dim);
  padding: 12px 16px; font-family: inherit; font-size: 14px; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab-bar button.active { color: var(--text); border-bottom-color: var(--accent); }

.fresh-indicator {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); margin-right: 6px;
}
.fresh-indicator.stale { background: var(--warning); }
.fresh-indicator.offline { background: var(--critical); }

@keyframes wd-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* Roadmap Kanban — Bloc 3 + responsive mobile (Bloc 5) */
.roadmap-kanban-main {
  padding: 20px 40px;
  max-width: 1200px;
  margin: 0 auto;
}
.roadmap-kanban-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 767px) {
  .roadmap-kanban-main { padding: 20px 16px; }
  .roadmap-kanban-grid {
    grid-template-columns: repeat(4, 280px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  .roadmap-kanban-grid > * { scroll-snap-align: start; }
}
