/* ============================================
   InstaVid Design System
   ============================================ */

/* Alpine.js — masque les éléments x-cloak avant l'initialisation */
[x-cloak] { display: none !important; }

/* --- TOKENS --- */
:root {
  --bg: #0a0a14;
  --bg2: #0d0d1a;
  --bg3: #12101f;

  --surface: rgba(255,255,255,0.04);
  --surface2: rgba(255,255,255,0.07);

  --border: rgba(255,255,255,0.08);
  --border2: rgba(255,255,255,0.14);

  --text: #ffffff;
  --text2: rgba(255,255,255,0.65);
  --text3: rgba(255,255,255,0.50);

  --purple: #8b5cf6;
  --cyan: #06b6d4;
  --grad: linear-gradient(135deg, #8b5cf6, #06b6d4);
  --grad-text: linear-gradient(90deg, #8b5cf6, #06b6d4);

  --glow-purple: rgba(139,92,246,0.25);
  --glow-cyan: rgba(6,182,212,0.20);

  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;

  --ig: #e1306c;
  --tt: #ff0050;
  --fb: #1877f2;

  --sidebar-w: 220px;
  --topbar-h: 56px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

/* --- RESET --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea { font-family: inherit; }

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: rgba(255,255,255,0.02);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar-top {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  width: 32px; height: 32px;
  background: var(--grad);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.logo-text {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 1.5px;
  color: var(--text);
}

/* Nav */
.nav-section { padding: 12px 10px 4px; }
.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text3);
  padding: 0 6px;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--text2);
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 1px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active {
  background: rgba(139,92,246,0.15);
  color: var(--text);
  font-weight: 600;
}
.nav-item.active .nav-icon { color: var(--purple); }
.nav-icon { font-size: 15px; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--purple);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
}
.nav-badge-amber { background: var(--amber); color: #000; }

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

/* Glow line */
.glow-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple), var(--cyan), transparent);
  opacity: 0.4;
  flex-shrink: 0;
}

/* Top bar */
.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 8px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.01);
}
.topbar-title { font-size: 16px; font-weight: 700; }
.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.bc-link { color: var(--text3); cursor: pointer; }
.bc-link:hover { color: var(--text2); }
.bc-sep { color: var(--text3); margin: 0 2px; }
.bc-current { color: var(--text); font-weight: 600; }

/* Page content */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

/* --- BUTTONS --- */
.btn-primary {
  background: var(--grad);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s, transform 0.15s;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--text2);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 9px;
  transition: background 0.15s, color 0.15s;
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-danger {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: var(--red);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 9px;
}
.btn-danger:hover { background: rgba(239,68,68,0.18); }

.btn-ai {
  background: rgba(139,92,246,0.15);
  border: 1px solid rgba(139,92,246,0.3);
  color: var(--purple);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 9px;
}
.btn-ai:hover { background: rgba(139,92,246,0.22); }

.btn-full {
  width: 100%;
  background: var(--grad);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 11px;
  border-radius: 10px;
}

/* --- STATUS BADGES --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}
.badge-active  { background: rgba(6,182,212,0.12);  color: var(--cyan);   border: 1px solid rgba(6,182,212,0.25); }
.badge-waiting { background: rgba(245,158,11,0.12); color: var(--amber);  border: 1px solid rgba(245,158,11,0.25); }
.badge-done    { background: rgba(16,185,129,0.12); color: var(--green);  border: 1px solid rgba(16,185,129,0.25); }
.badge-error   { background: rgba(239,68,68,0.12);  color: var(--red);    border: 1px solid rgba(239,68,68,0.25); }
.badge-brand   { background: rgba(139,92,246,0.15); color: var(--purple); border: 1px solid rgba(139,92,246,0.25); }

/* --- CARDS --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.card-sm { padding: 14px 16px; }

/* --- ACTION BANNER (validation requise) --- */
.action-banner {
  background: rgba(245,158,11,0.08);
  border-bottom: 1px solid rgba(245,158,11,0.2);
  padding: 10px 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.action-banner-text { font-size: 13px; color: var(--amber); font-weight: 600; }
.action-banner-sub  { font-size: 12px; color: rgba(245,158,11,0.85); }
.action-banner-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* --- FORMS --- */
.input {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  padding: 10px 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.input::placeholder { color: var(--text3); }
.input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}

.textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 13px;
  line-height: 1.6;
  padding: 12px 14px;
  resize: vertical;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}
.textarea:focus, .textarea:hover { border-color: rgba(139,92,246,0.3); }

/* --- TOGGLE --- */
.toggle {
  width: 34px; height: 19px;
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.toggle.on  { background: var(--purple); }
.toggle.off { background: rgba(255,255,255,0.1); }
.toggle-knob {
  position: absolute;
  top: 2px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s;
}
.toggle.on  .toggle-knob { left: 17px; }
.toggle.off .toggle-knob { left: 2px; }

/* --- GRADIENT TEXT --- */
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- SECTION LABEL --- */
.section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text3);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.section-sep {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text3);
  text-transform: uppercase;
  margin: 14px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* --- MINI PIPELINE DOTS (dashboard) --- */
.pipeline-dots { display: flex; gap: 3px; align-items: center; }
.pipe-dot { width: 6px; height: 6px; border-radius: 50%; }
.pipe-done    { background: var(--purple); }
.pipe-active  { background: var(--cyan); box-shadow: 0 0 4px var(--cyan); }
.pipe-idle    { background: rgba(255,255,255,0.12); }
.pipe-error   { background: var(--red); }

/* --- LOGS --- */
.log-ok    { color: var(--green); }
.log-warn  { color: var(--amber); }
.log-error { color: var(--red); }
.log-ai    { color: var(--purple); }
.log-info  { color: var(--text2); }
.log-live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  animation: blink 1.5s infinite;
}

/* --- ANIMATIONS --- */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(6,182,212,0.3); }
  50%       { box-shadow: 0 0 20px rgba(6,182,212,0.55); }
}
@keyframes pulse-purple {
  0%, 100% { box-shadow: 0 0 8px rgba(139,92,246,0.3); }
  50%       { box-shadow: 0 0 16px rgba(139,92,246,0.6); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.anim-blink     { animation: blink 1.5s infinite; }
.anim-glow      { animation: glow-pulse 2s infinite; }
.anim-spin      { animation: spin 1s linear infinite; }

/* --- TIMELINE --- */
.tl-item { display:flex; gap:12px; padding:10px 0; position:relative; }
.tl-item:not(:last-child)::after {
  content:''; position:absolute;
  left:13px; top:34px; bottom:-4px;
  width:1px; background:var(--border);
}
.tl-dot {
  width:28px; height:28px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size:13px; z-index:1; margin-top:3px;
}
.dot-done    { background:linear-gradient(135deg,rgba(139,92,246,0.25),rgba(99,102,241,0.15)); border:1px solid rgba(139,92,246,0.35); }
.dot-active  { background:linear-gradient(135deg,rgba(6,182,212,0.25),rgba(8,145,178,0.15)); border:1px solid rgba(6,182,212,0.45); animation:glow-pulse 2s infinite; }
.dot-waiting { background:rgba(245,158,11,0.15); border:1px solid rgba(245,158,11,0.35); }
.dot-idle    { background:rgba(255,255,255,0.03); border:1px solid var(--border); }

.tl-name-done    { font-size:13px; font-weight:700; color:var(--text2); }
.tl-name-active  { font-size:13px; font-weight:700; color:var(--text); }
.tl-name-waiting { font-size:13px; font-weight:700; color:var(--amber); }
.tl-name-idle    { font-size:13px; font-weight:700; color:rgba(255,255,255,0.2); }

.tl-desc-done    { font-size:11px; color:var(--text3); }
.tl-desc-active  { font-size:11px; color:rgba(6,182,212,0.75); }
.tl-desc-waiting { font-size:11px; color:rgba(245,158,11,0.65); }
.tl-desc-idle    { font-size:11px; color:rgba(255,255,255,0.12); }

/* Photo strip */
.photo-strip { display:flex; gap:5px; margin-top:8px; overflow:hidden; }
.photo-strip-thumb {
  width:38px; height:38px; border-radius:6px; flex-shrink:0;
  border:1px solid rgba(139,92,246,0.2); overflow:hidden;
  cursor:pointer; transition:transform 0.15s;
  display:flex; align-items:center; justify-content:center;
}
.photo-strip-thumb:hover { transform:scale(1.15); z-index:10; border-color:var(--purple); box-shadow:0 4px 12px rgba(139,92,246,0.4); }
.photo-strip-thumb img { width:100%; height:100%; object-fit:cover; }

/* Video strip */
.video-strip { display:flex; gap:5px; margin-top:8px; }
.video-strip-thumb {
  width:52px; height:38px; border-radius:6px; flex-shrink:0;
  border:1px solid rgba(6,182,212,0.2); overflow:hidden;
  cursor:pointer; transition:transform 0.15s; position:relative;
  display:flex; align-items:center; justify-content:center;
  background:rgba(6,182,212,0.05);
}
.video-strip-thumb:hover { transform:scale(1.12); z-index:10; border-color:var(--cyan); box-shadow:0 4px 12px rgba(6,182,212,0.4); }
.video-strip-thumb.generating { animation:blink 1.5s infinite; border-color:rgba(139,92,246,0.4); background:rgba(139,92,246,0.05); }
.video-strip-thumb.waiting { opacity:0.3; border-color:var(--border); }

/* Script preview */
.script-preview {
  margin-top:8px; background:rgba(255,255,255,0.04);
  border:1px solid var(--border); border-radius:8px;
  padding:9px 11px; cursor:pointer; position:relative;
  transition:border-color 0.15s;
}
.script-preview:hover { border-color:rgba(139,92,246,0.3); }
.script-preview-text { font-size:11px; color:var(--text2); line-height:1.55; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.script-tooltip {
  position:fixed; background:#0d0d1a; border:1px solid rgba(139,92,246,0.4);
  border-radius:14px; padding:18px 20px; max-width:340px; z-index:100;
  pointer-events:none; opacity:0; transition:opacity 0.2s;
  box-shadow:0 20px 60px rgba(0,0,0,0.8);
  top:50%; left:50%; transform:translate(-50%,-50%);
}
.script-preview:hover .script-tooltip { opacity:1; }

/* Audio waveform */
.waveform-preview { display:flex; align-items:center; gap:8px; margin-top:8px; }
.waveform-bars { display:flex; align-items:center; gap:2px; height:24px; }
.waveform-bar { width:3px; border-radius:3px; background:var(--amber); opacity:0.6; }

/* --- PHOTO GALLERY (select_photos) --- */
.photo-card-sel {
  border-radius:var(--radius-sm); overflow:hidden; cursor:pointer;
  position:relative; border:2px solid transparent;
  transition:all 0.18s; aspect-ratio:1;
}
.photo-card-sel.selected {
  border-color:var(--purple);
  box-shadow:0 0 0 1px var(--purple), 0 6px 24px rgba(139,92,246,0.45);
  transform:scale(1.02);
}
.photo-card-sel.selected:hover { transform:scale(1.05); }
.photo-card-sel.unselected { opacity:0.45; filter:saturate(0.5); }
.photo-card-sel.unselected:hover { opacity:0.85; filter:saturate(1); border-color:var(--border2); transform:scale(1.04); }
.photo-card-sel.rejected { opacity:0.2; filter:grayscale(1); cursor:not-allowed; }

.photo-pos-badge {
  position:absolute; top:7px; left:7px;
  background:var(--purple); color:#fff;
  font-size:11px; font-weight:800;
  width:22px; height:22px; border-radius:6px;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 2px 8px rgba(139,92,246,0.6); z-index:2;
}
.photo-check-badge {
  position:absolute; top:7px; right:7px;
  background:var(--green); color:#fff;
  width:20px; height:20px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:10px; font-weight:700;
  box-shadow:0 2px 8px rgba(16,185,129,0.5); z-index:2;
}
.photo-score-bar { position:absolute; bottom:0; left:0; right:0; height:4px; background:rgba(255,255,255,0.07); }
.photo-view-badge {
  position: absolute;
  bottom: 8px;
  left: 7px;
  background: rgba(0,0,0,0.65);
  color: rgba(255,255,255,0.85);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  z-index: 2;
  pointer-events: none;
  letter-spacing: 0.3px;
}
.photo-score-fill-sel { height:4px; background:linear-gradient(90deg,var(--purple),var(--cyan)); }
.photo-score-fill-unsel { height:4px; background:rgba(255,255,255,0.2); }
/* .photo-remove-btn est défini dans select_photos.html (overlay pleine carte) */

/* Sequence list */
.seq-item {
  display:flex; align-items:center; gap:7px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-sm); padding:5px 8px; cursor:grab;
  transition:border-color 0.15s, background 0.15s;
}
.seq-item:hover { border-color:rgba(139,92,246,0.3); background:rgba(139,92,246,0.07); }

/* --- REVIEW SOCIAL --- */
.platform-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; transition:border-color 0.15s; }
.platform-card:hover { border-color:var(--border2); }
.platform-header { padding:12px 14px; display:flex; align-items:center; gap:8px; border-bottom:1px solid var(--border); }
.platform-icon { width:28px; height:28px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0; }
.platform-icon-ig { background:linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.platform-icon-tt { background:#000; border:1px solid rgba(255,255,255,0.1); }
.platform-icon-fb { background:#1877f2; }
.platform-status-dot { width:7px; height:7px; border-radius:50%; margin-left:auto; }
.platform-status-ok     { background:var(--green); }
.platform-status-pending{ background:var(--amber); }

.caption-editable {
  background:rgba(255,255,255,0.04); border:1px solid var(--border);
  border-radius:var(--radius-sm); padding:8px 10px;
  font-size:11px; color:var(--text2); line-height:1.55;
  min-height:52px; cursor:text; transition:border-color 0.15s;
  outline:none;
}
.caption-editable:hover, .caption-editable:focus { border-color:rgba(139,92,246,0.3); }

.hashtag-chip {
  font-size:10px; font-weight:600; padding:2px 7px;
  border-radius:20px; cursor:pointer; display:inline-block;
}
.hashtag-ig { background:rgba(225,48,108,0.1); color:var(--ig); border:1px solid rgba(225,48,108,0.2); }
.hashtag-tt { background:rgba(255,0,80,0.1);   color:var(--tt); border:1px solid rgba(255,0,80,0.2); }
.hashtag-fb { background:rgba(24,119,242,0.1); color:var(--fb); border:1px solid rgba(24,119,242,0.2); }

/* --- STATS GRID (dashboard) --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

/* --- PHOTO GRID (select_photos) --- */
.photo-grid {
  grid-template-columns: repeat(5, 1fr);
}
#sequence-list {
  grid-template-columns: repeat(5, 1fr);
}

/* --- UTILITIES --- */
.hidden { display: none !important; }

/* --- FOCUS VISIBLE (accessibilité clavier) --- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
  border-radius: 6px;
}
.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.btn-danger:focus-visible,
.btn-ai:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 3px;
}
.nav-item:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: -2px;
}

/* --- ICÔNES NAV SVG --- */
.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* --- PROJECT CARD (remplace hover inline) --- */
.project-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 18px;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  text-decoration: none;
}
.project-card:hover {
  border-color: var(--border2);
  background: var(--surface2);
  transform: translateX(2px);
}
.project-card:focus-visible {
  border-color: var(--purple);
  background: var(--surface2);
}
.project-card-archived {
  opacity: 0.6;
}
.project-card-archived:hover { opacity: 1; }

/* --- TOUCH TARGETS MIN 36px --- */
.btn-sm-touch {
  min-height: 36px;
  padding: 7px 12px;
}

/* --- PREFERS-REDUCED-MOTION --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- RESPONSIVE --- */

/* Tablet landscape ≤1024px */
@media (max-width: 1024px) {
  .topbar { padding: 0 20px; }
  .action-banner { padding: 10px 20px; }
  .page-content { padding: 20px; }
}

/* Tablet portrait ≤768px : sidebar icon-only */
@media (max-width: 768px) {
  :root { --sidebar-w: 56px; }

  /* Sidebar collapse — icônes seules */
  .logo-text { display: none; }
  .nav-section { padding: 10px 6px 4px; }
  .nav-section-label { display: none; }
  .nav-label { display: none; }
  .nav-badge { display: none; }
  .nav-item { justify-content: center; padding: 10px; gap: 0; }
  .sidebar-bottom .nav-item { justify-content: center; padding: 10px; }

  .topbar { padding: 0 14px; }
  .topbar-title { font-size: 14px; }
  .action-banner { padding: 10px 14px; gap: 8px; flex-wrap: wrap; }
  .page-content { padding: 16px; }

  /* Stats grid 4 → 2 colonnes */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Dashboard new-project form : input pleine largeur */
  #new-project-form { flex-wrap: wrap; }
  #new-project-form input { width: 100% !important; }

  /* Grilles photos 5 → 3 colonnes */
  .photo-grid { grid-template-columns: repeat(3, 1fr) !important; }
  #sequence-list { grid-template-columns: repeat(3, 1fr) !important; }
}

/* Mobile ≤480px */
@media (max-width: 480px) {
  /* Sidebar masquée */
  .sidebar { display: none; }

  .page-content { padding: 12px; }
  .topbar { padding: 0 12px; }
  .topbar-title { font-size: 13px; }

  /* Stats grid → 1 colonne */
  .stats-grid { grid-template-columns: 1fr; }

  /* Grilles photos 3 → 2 colonnes */
  .photo-grid { grid-template-columns: repeat(2, 1fr) !important; }
  #sequence-list { grid-template-columns: repeat(2, 1fr) !important; }

  /* New project form */
  #new-project-form { flex-direction: column; align-items: stretch; }
  #new-project-form .btn-primary { width: 100%; justify-content: center; }
}
