:root{
  /* Palette PréparAction — ajuste si besoin */
  --bg: #0f172a;            /* fond */
  --surface: #0b1226;       /* panneaux */
  --surface-2: #111a34;
  --primary: #4f8cff;       /* bleu principal */
  --accent: #ffde00;        /* Jaune */
  --text: #e6ebff;
  --muted: #9fb3ffb3;
  --border: #1e2a4a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

*{ box-sizing: border-box }
html,body{ height:100% }
body{
  margin:0; font-family:Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(79,140,255,.12), transparent 60%),
              radial-gradient(900px 600px at -10% 110%, rgba(34,211,238,.10), transparent 60%),
              var(--bg);
  color:var(--text);
}

/* Layout */
.app{ display:grid; grid-template-columns: 340px 1fr; min-height:100vh }
.sidebar{
  border-right:1px solid var(--border);
  padding:20px; background: linear-gradient(180deg, rgba(17,26,52,.55), rgba(11,18,38,.6));
}
.main{ display:flex; flex-direction:column; min-height:100vh }
.topbar{
  padding:18px 22px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  background:linear-gradient(180deg, rgba(17,26,52,.5), rgba(11,18,38,.2));
}
.topbar .title{ font-weight:600; letter-spacing:.2px }
.topbar .meta{ color:var(--muted); font-size:13px }

.brand{ display:flex; align-items:center; gap:10px; margin-bottom:16px; font-weight:600 }
.brand img{ height:22px }

.panel{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:14px; margin-bottom:14px; box-shadow: var(--shadow);
}
.panel-title{ font-size:13px; color:var(--muted); margin-bottom:8px; text-transform:uppercase; letter-spacing:.6px }
label{ font-size:13px; color:var(--muted); display:block; margin:8px 0 6px }

input, textarea{
  background: var(--surface-2); color:var(--text);
  border:1px solid var(--border); border-radius:10px; padding:10px 12px; outline:none; width:100%;
}
input:disabled, textarea:disabled{ opacity:.7 }

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

.kv{ display:flex; justify-content:space-between; margin:6px 0; color:var(--text) }
.small{ font-size:12px }
.muted{ color:var(--muted) }

/* Buttons */
.btn{
  background: var(--surface-2); color:var(--text);
  border:1px solid var(--border); padding:10px 12px; border-radius:12px; cursor:pointer;
}
.btn:hover{ border-color:#2a3a68 }
.btn:disabled{ opacity:.5; cursor:not-allowed }
.btn-primary{ background: linear-gradient(180deg, var(--primary), #3b72e7); border-color: #456fe0 }
.btn-ghost{ background: transparent; border-color: #2a3a68 }
.link{ color: var(--accent); text-decoration:none; display:inline-block; margin-right:10px }
.link:hover{ text-decoration:underline }

/* Chat */
.chat{ flex:1; overflow:auto; padding:22px; display:flex; flex-direction:column; gap:14px }
.bubble{
  max-width: 780px; padding:12px 14px; border-radius:14px; line-height:1.45;
  border:1px solid var(--border); box-shadow: var(--shadow);
}
.bubble.user{ align-self:flex-end; background: linear-gradient(180deg, #14224a, #0e1a3d) }
.bubble.assistant{ align-self:flex-start; background: linear-gradient(180deg, #0f1b3b, #0d1328) }
.bubble.system{ align-self:center; background: #0c1329; opacity:.9; font-size:13px; color:var(--muted) }

/* Composer */
.composer{
  border-top:1px solid var(--border); padding:12px; display:flex; gap:10px; align-items:flex-end;
}
.composer textarea{
  flex:1; min-height:54px; resize:vertical; font-size:14px;
}
.composer-actions{ display:flex; gap:8px }

/* Progress */
.progress{ width:100%; height:7px; background:#0b1226; border-radius:999px; border:1px solid var(--border); margin-top:8px; overflow:hidden }
.progress > div{ height:100%; width:0%; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .3s ease }

/* Toast */
.toast{
  position: fixed; right: 16px; bottom: 16px; background: #101a37; color: var(--text);
  border:1px solid var(--border); padding:12px 14px; border-radius:12px; box-shadow: var(--shadow);
}

@media (max-width: 980px){
  .app{ grid-template-columns: 1fr }
  .sidebar{ order:2 }
  .main{ order:1 }
}
