/* ===== InsightHub — App CSS ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0a;
  --bg-2: #131313;
  --bg-3: #1a1a1a;
  --line: rgba(255,255,255,0.08);
  --line-2: rgba(255,255,255,0.15);
  --text: #f5f5f5;
  --text-dim: rgba(255,255,255,0.65);
  --text-mute: rgba(255,255,255,0.4);
  --yellow: #F5C518;
  --yellow-light: #FFE066;
  --green: #00ff88;
  --red: #ef4444;
  --orange: #f59e0b;
}

html, body { min-height: 100vh; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ===== TOPNAV ===== */
.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: #000;
  border: 1px solid var(--line-2);
  object-fit: contain;
  padding: 3px;
}
.brand-text strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  display: block;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 10px;
  color: var(--text-mute);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.nav-actions { display: flex; align-items: center; gap: 24px; }
.nav-link {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 500;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--yellow); }
.user-menu {
  display: flex; align-items: center; gap: 12px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--yellow);
}
.logout-btn {
  font-size: 12px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  color: var(--text-dim);
  transition: all 0.2s;
}
.logout-btn:hover { background: var(--bg-3); color: var(--text); border-color: var(--text-mute); }

/* ===== MAIN ===== */
.main { flex: 1; padding: 40px 32px; }
.container { max-width: 1200px; margin: 0 auto; }

/* ===== PAGE HEAD ===== */
.page-head {
  margin-bottom: 40px;
}
.page-head h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.page-sub { color: var(--text-dim); font-size: 15px; }
.page-sub code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--bg-3);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

/* ===== CARDS GRID ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}
.card {
  display: block;
  padding: 32px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.card:hover {
  border-color: var(--yellow);
  transform: translateY(-2px);
  background: var(--bg-3);
  box-shadow: 0 8px 32px rgba(245,197,24,0.15);
}
.card-icon { font-size: 32px; margin-bottom: 16px; }
.card h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}
.card p { color: var(--text-dim); margin-bottom: 16px; font-size: 14px; }
.card-cta {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--yellow);
  font-weight: 600;
}

/* ===== STATUS SECTION ===== */
.status-section h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-dim);
}
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.status-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-dot.warn { background: var(--orange); box-shadow: 0 0 8px var(--orange); }
.status-dot.err { background: var(--red); box-shadow: 0 0 8px var(--red); }
.status-label { flex: 1; font-size: 13px; }
.status-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-mute);
}

/* ===== LOGIN ===== */
.body-login .topnav { display: none; }
.body-login .footer { display: none; }
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(245,197,24,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(255,255,255,0.03) 0%, transparent 50%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 440px;
  padding: 48px 40px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}
.login-head { text-align: center; margin-bottom: 32px; }
.login-logo {
  width: 64px; height: 64px;
  border-radius: 12px;
  background: #000;
  border: 1px solid var(--line-2);
  object-fit: contain;
  padding: 6px;
  margin-bottom: 20px;
}
.login-head h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}
.login-sub { color: var(--text-dim); font-size: 14px; }
.login-sub strong { color: var(--yellow); }

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
  border: 1px solid;
}
.alert-error { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #fca5a5; }

.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; }
.login-form label span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-weight: 600;
}
.login-form input {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}
.login-form input:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(245,197,24,0.15);
}
.btn-primary {
  margin-top: 12px;
  padding: 14px 20px;
  background: #fff;
  color: #000;
  border: 1px solid #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #000;
}
.btn-primary .arrow { transition: transform 0.2s; }
.btn-primary:hover .arrow { transform: translateX(4px); }

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-mute);
}
.login-footer a { color: var(--yellow); border-bottom: 1px dotted var(--yellow); }

/* ===== FOOTER ===== */
.footer {
  padding: 16px 32px;
  border-top: 1px solid var(--line);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mute);
  display: flex;
  justify-content: space-between;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 720px) {
  .topnav { padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
  .nav-actions { gap: 12px; }
  .nav-link { font-size: 12px; }
  .user-menu { padding-left: 0; border-left: none; }
  .user-name { display: none; }
  .main { padding: 24px 16px; }
  .page-head h1 { font-size: 28px; }
  .login-card { padding: 32px 24px; }
}

/* ============================================================ */
/* BUILDER — ajouts Phase 4.2                                   */
/* ============================================================ */
.builder { display: flex; flex-direction: column; gap: 32px; margin-bottom: 48px; }

.builder-step {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 32px;
}
.step-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.step-title small {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-mute);
  margin-left: 8px;
}
.step-num {
  display: inline-flex;
  width: 28px; height: 28px;
  background: var(--yellow);
  color: #000;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

/* === Project cards (sélection radio stylisée) === */
.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.project-card {
  cursor: pointer;
  position: relative;
}
.project-card input { position: absolute; opacity: 0; pointer-events: none; }
.project-card-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-3);
  border: 2px solid var(--line);
  border-radius: 10px;
  transition: all 0.2s;
}
.project-card:hover .project-card-inner { border-color: var(--accent); }
.project-card input:checked + .project-card-inner {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-3));
  box-shadow: 0 0 0 1px var(--accent), 0 4px 16px color-mix(in srgb, var(--accent) 20%, transparent);
}
.project-card-badge {
  width: 56px; height: 56px;
  border-radius: 8px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  flex-shrink: 0;
}
.project-card-body { flex: 1; }
.project-card-body h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  margin-bottom: 4px;
  font-weight: 600;
}
.project-card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.project-card-meta strong { color: var(--text); }
.project-card-check {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-weight: bold;
  flex-shrink: 0;
}
.project-card input:checked ~ .project-card-inner .project-card-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* === Date inputs === */
.dates-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr;
  gap: 16px;
  align-items: end;
}
.date-input { display: flex; flex-direction: column; gap: 6px; }
.date-input span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  font-weight: 600;
}
.date-input input {
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  color-scheme: dark;
}
.date-input input:focus {
  outline: none;
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(245,197,24,0.15);
}
.period-detected {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.period-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-mute);
  font-weight: 600;
}
.period-badge {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
}
.period-monthly { color: #38bdf8; }
.period-weekly  { color: var(--yellow); }
.period-custom  { color: #a855f7; }
.period-error   { color: var(--red); font-size: 13px; }
.period-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}

/* === Blocs grid === */
.blocs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
}
.bloc-check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
}
.bloc-check:hover { border-color: var(--line-2); background: var(--bg); }
.bloc-check input { 
  width: 16px; height: 16px;
  accent-color: var(--yellow);
  cursor: pointer;
}
.bloc-check input:checked + span { color: var(--text); font-weight: 500; }

/* === Actions === */
.builder-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-large {
  padding: 16px 32px;
  font-size: 15px;
}
.btn-ghost {
  padding: 16px 24px;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text-dim);
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); background: rgba(245,158,11,0.05); }

/* === Recent section === */
.recent-section { margin-top: 16px; }
.recent-section h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-dim);
}
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recent-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 0.15s;
}
.recent-item:hover { border-color: var(--line-2); background: var(--bg-3); }
.recent-badge {
  padding: 4px 10px;
  border-radius: 4px;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.recent-body { flex: 1; }
.recent-body h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.recent-meta {
  font-size: 11px;
  color: var(--text-mute);
  display: flex;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
}
.recent-status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
}
.status-done    { color: var(--green); background: rgba(0,255,136,0.08); }
.status-running { color: var(--yellow); background: rgba(245,197,24,0.08); }
.status-queued  { color: var(--text-dim); background: var(--bg-3); }
.status-failed  { color: var(--red); background: rgba(239,68,68,0.08); }
.recent-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--bg-2);
}

/* === Loading card (page generation) === */
.loading-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 48px;
  text-align: center;
}
.loading-spinner {
  width: 48px; height: 48px;
  margin: 0 auto 24px;
  border: 3px solid var(--line);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-card h2 { font-family: 'Space Grotesk', sans-serif; margin-bottom: 12px; font-size: 22px; }
.loading-card p { color: var(--text-dim); margin-bottom: 8px; }
.loading-card a { display: inline-block; margin-top: 24px; }

/* === Responsive === */
@media (max-width: 720px) {
  .dates-row { grid-template-columns: 1fr; }
  .builder-actions { flex-direction: column; }
  .builder-actions button { width: 100%; }
}

/* ============================================================ */
/* DASHBOARD V3 — Glassmorphism + Inter/Space Grotesk + icônes  */
/* ============================================================ */

body { background: #000 !important; }

/* ===== Ambient halos ===== */
.ambient-halos {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.halo {
  position: absolute; border-radius: 50%; filter: blur(120px);
  opacity: 0.5; animation: halo-drift 20s ease-in-out infinite alternate;
}
.halo-1 { width:600px; height:600px;
  background: radial-gradient(circle, rgba(244,63,129,0.22) 0%, transparent 70%);
  top:-200px; left:-100px; animation-delay:0s; }
.halo-2 { width:500px; height:500px;
  background: radial-gradient(circle, rgba(21,128,61,0.16) 0%, transparent 70%);
  top:30%; right:-150px; animation-delay:5s; }
.halo-3 { width:400px; height:400px;
  background: radial-gradient(circle, rgba(245,197,24,0.10) 0%, transparent 70%);
  bottom:-100px; left:30%; animation-delay:10s; }
@keyframes halo-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, -30px) scale(1.05); }
}

/* ===== Background décoratif : icônes datavisualization ===== */
.ambient-icons {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden;
}
.bg-icon {
  position: absolute;
  width: 96px; height: 96px;
  color: rgba(255,255,255,0.05);
  animation: icon-float 30s ease-in-out infinite alternate;
}
.ic-1  { top:8%;  left:6%;   width:80px; animation-delay:0s; }
.ic-2  { top:18%; right:14%; width:90px; animation-delay:3s; }
.ic-3  { top:42%; left:8%;   width:70px; animation-delay:7s; }
.ic-4  { top:55%; right:8%;  width:85px; animation-delay:11s; }
.ic-5  { top:72%; left:14%;  width:65px; animation-delay:5s; }
.ic-6  { top:82%; right:18%; width:75px; animation-delay:9s; }
.ic-7  { top:35%; right:42%; width:60px; animation-delay:13s; }
.ic-8  { top:62%; left:48%;  width:80px; animation-delay:6s; }
.ic-9  { top:12%; left:48%;  width:70px; animation-delay:15s; }
.ic-10 { top:90%; left:60%;  width:90px; animation-delay:8s; }
@keyframes icon-float {
  0%   { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-20px) rotate(5deg); }
}

/* ===== Container ===== */
.dash-container {
  position: relative; z-index: 10;
  max-width: 1400px; margin: 0 auto; padding: 32px;
}
.main { padding-top: 0 !important; }

/* ===== HEADER ===== */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px; gap: 32px;
  opacity: 0; animation: fadeUp 700ms ease forwards;
}
.hello-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  display: block;
  margin-bottom: 10px;
}
.hello-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: #fff;
  margin: 0 0 12px 0;
}
.hello-name {
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.55) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}
.hello-sub {
  font-family: 'Inter', sans-serif;
  color: rgba(255,255,255,0.55);
  font-size: 15px;
  font-weight: 400;
}

.dash-stats { display: flex; gap: 12px; flex-shrink: 0; }
.stat-pill {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 12px 18px;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  transition: all 0.3s;
  opacity: 0; animation: fadeUp 700ms ease forwards;
}
.stat-pill:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}
.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px; font-weight: 700; line-height: 1;
}
.stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
  font-weight: 500;
}
.stat-pulse { display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 16px 18px; }
.stat-pulse .stat-label { margin-top: 0; color: #00ff88; }
.stat-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #00ff88;
  box-shadow: 0 0 12px #00ff88;
  animation: pulse-dot 2s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ===== GLASS CARDS ===== */
.glass-card {
  position: relative;
  padding: 28px;
  background: rgba(255,255,255,0.025);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  transition: all 0.3s ease;
  opacity: 0; animation: fadeUp 700ms ease forwards;
}
.glass-card::before {
  content: ''; position: absolute; inset: 0;
  border-radius: 20px; padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.06) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

.card-head {
  display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px;
}
.step-badge {
  flex-shrink: 0; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.7);
}
.card-head h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px; font-weight: 600;
  margin: 0 0 4px 0;
  color: #fff;
  letter-spacing: -0.01em;
}
.card-sub {
  font-family: 'Inter', sans-serif;
  color: rgba(255,255,255,0.45);
  font-size: 13px;
}
.card-actions { margin-left: auto; display: flex; gap: 12px; }
.link-btn {
  background: none; border: none;
  color: rgba(255,255,255,0.5);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer; padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.2s;
}
.link-btn:hover { background: rgba(255,255,255,0.05); color: #fff; }

/* ===== BUILDER GRID ===== */
.builder-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-bottom: 56px;
}
.builder-grid .full-width { grid-column: 1 / -1; }

/* ===== PROJECT CARDS ===== FIX cliquable ===== */
.project-cards-v2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.proj-card {
  position: relative;
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.3s;
  /* CRUCIAL : pour que le label soit cliquable partout */
  display: block;
}
.proj-card input { position: absolute; opacity: 0; pointer-events: none; }
.proj-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, var(--accent) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 1;
}
.proj-content {
  position: relative;
  z-index: 2; /* AU-DESSUS du glow pour rester cliquable */
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: rgba(255,255,255,0.02);
  border: 1.5px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  transition: all 0.3s;
}
.proj-card:hover .proj-content {
  border-color: var(--accent);
  background: rgba(255,255,255,0.04);
  transform: translateY(-1px);
}
.proj-card:hover .proj-glow { opacity: 0.08; }
.proj-card input:checked + .proj-glow { opacity: 0.12; }
.proj-card input:checked ~ .proj-content {
  border-color: var(--accent);
  background: rgba(255,255,255,0.04);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 32px color-mix(in srgb, var(--accent) 25%, transparent);
}
.proj-avatar { flex-shrink: 0; }
.avatar-initials {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 16px;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 30%, transparent);
}
.proj-meta { flex: 1; min-width: 0; }
.proj-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 4px; display: block;
}
.proj-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px; font-weight: 600;
  margin: 0 0 4px 0;
  color: #fff;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.proj-sg {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin: 4px 0 0 0;
}
.proj-sg strong { color: rgba(255,255,255,0.9); font-weight: 500; }
.proj-check {
  position: absolute; top: 14px; right: 14px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  transition: all 0.3s;
  z-index: 3;
}
.proj-card input:checked ~ .proj-content .proj-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.proj-check svg path { stroke-dasharray: 16; }
.proj-card input:checked ~ .proj-content .proj-check svg {
  animation: check-draw 400ms ease 100ms both;
}
@keyframes check-draw {
  from { stroke-dashoffset: 16; opacity: 0; }
  to   { stroke-dashoffset: 0; opacity: 1; }
}

/* ===== DATES ===== */
.dates-v2 { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.date-input-v2 { flex: 1; }
.date-input-v2 label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
  font-weight: 600;
}
.date-input-v2 input {
  width: 100%; padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color-scheme: dark;
  transition: all 0.2s;
}
.date-input-v2 input:focus {
  outline: none;
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.05);
}
.date-arrow { color: rgba(255,255,255,0.3); font-size: 18px; margin-top: 22px; }
.period-detected-v2 {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  transition: all 0.3s;
}
.period-detected-v2[data-type="monthly"] { border-color: rgba(56,189,248,0.3); background: rgba(56,189,248,0.05); }
.period-detected-v2[data-type="weekly"]  { border-color: rgba(245,197,24,0.3); background: rgba(245,197,24,0.05); }
.period-detected-v2[data-type="custom"]  { border-color: rgba(168,85,247,0.3); background: rgba(168,85,247,0.05); }
.period-detected-v2[data-type="error"]   { border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.05); }
.pd-icon { font-size: 24px; }
.pd-text { display: flex; flex-direction: column; }
.pd-type {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px; font-weight: 600;
  color: #fff;
}
.pd-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: rgba(255,255,255,0.55);
  margin-top: 2px;
}

/* ===== BLOCS ===== */
.blocs-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.bloc-group { display: flex; flex-direction: column; gap: 6px; }
.bg-title {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px; font-weight: 600;
}
.bloc-v2 {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  --accent: rgba(255,255,255,0.3);
}
.bloc-v2:hover { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.1); }
.bloc-v2 input {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer; flex-shrink: 0;
}
.bloc-v2 input:checked ~ .bloc-name { color: #fff; }
.bloc-v2 input:not(:checked) ~ .bloc-name { color: rgba(255,255,255,0.4); }
.bloc-icon { font-size: 16px; flex-shrink: 0; }
.bloc-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 9px;
  color: #fff; flex-shrink: 0;
  letter-spacing: 0.04em;
}
.bloc-name {
  flex: 1;
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 500;
  color: #fff;
  transition: color 0.2s;
}
.bloc-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.35);
}

/* ===== ACTIONS ===== */
.builder-actions-v2 {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 8px 0;
}
.btn-generate {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 18px 32px;
  background: #fff; color: #000;
  border: none; border-radius: 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 15px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.btn-generate:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(255,255,255,0.15);
}
.btn-generate:active { transform: translateY(0); }
.btn-icon { font-size: 18px; }
.btn-arrow { transition: transform 0.3s; }
.btn-generate:hover .btn-arrow { transform: translateX(4px); }
.btn-generate.is-loading { pointer-events: none; opacity: 0.7; }
.btn-generate.is-loading .btn-icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-secondary-v2 {
  padding: 18px 24px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; gap: 10px;
}
.btn-secondary-v2:hover {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.04);
  color: #fff;
}

/* ===== HISTORIQUE ===== */
.recent-section-v2 { opacity: 0; animation: fadeUp 700ms ease 800ms forwards; }
.section-head-v2 { display: flex; align-items: baseline; gap: 14px; margin-bottom: 24px; }
.section-head-v2 h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px; font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0;
}
.section-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  padding: 4px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
}
.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.recent-card {
  position: relative; display: block;
  padding: 20px 22px;
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  transition: all 0.3s;
  overflow: hidden;
  text-decoration: none;
}
.recent-card:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-2px);
}
.rc-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.rc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.rc-badge {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 11px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border: 1px solid;
  border-radius: 4px;
  background: rgba(0,0,0,0.3);
}
.rc-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.status-done    { color: #00ff88; background: rgba(0,255,136,0.08); }
.status-running { color: #F5C518; background: rgba(245,197,24,0.08); }
.status-queued  { color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.04); }
.status-failed  { color: #ef4444; background: rgba(239,68,68,0.08); }
.rc-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px; font-weight: 600;
  color: #fff;
  margin: 0 0 8px 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.rc-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
}
.rc-foot {
  display: flex; gap: 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  font-family: 'JetBrains Mono', monospace;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.recent-empty-v2 {
  padding: 64px 32px; text-align: center;
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 16px;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.recent-empty-v2 h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px; font-weight: 600;
  color: #fff;
  margin: 0 0 8px 0;
}
.recent-empty-v2 p {
  font-family: 'Inter', sans-serif;
  color: rgba(255,255,255,0.45);
  font-size: 14px;
}

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

/* Responsive */
@media (max-width: 980px) {
  .builder-grid { grid-template-columns: 1fr; }
  .blocs-groups { grid-template-columns: 1fr; }
  .dash-header { flex-direction: column; align-items: flex-start; }
  .hello-title { font-size: 32px; }
  .project-cards-v2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .dash-container { padding: 16px; }
  .glass-card { padding: 20px; }
  .dates-v2 { flex-direction: column; align-items: stretch; }
  .date-arrow { display: none; }
  .builder-actions-v2 { flex-direction: column; }
  .btn-generate, .btn-secondary-v2 { width: 100%; }
}
