body{font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
.ctrl{background:#1e293b;border:1px solid #334155;color:#e2e8f0;border-radius:6px;padding:6px 10px;font-size:13px;outline:none;transition:border-color .15s}
.ctrl:focus{border-color:#f59e0b}
.btn-primary{background:#f59e0b;color:#0f172a;font-weight:700;font-size:13px;padding:6px 14px;border-radius:6px;border:none;cursor:pointer;transition:background .15s}
.btn-primary:hover{background:#fbbf24}
.btn-primary:disabled{opacity:.5;cursor:not-allowed}
.btn-secondary{background:#1e293b;color:#e2e8f0;font-size:13px;padding:6px 12px;border-radius:6px;border:1px solid #334155;cursor:pointer;transition:background .15s}
.btn-secondary:hover{background:#334155}
.btn-danger{background:#e11d48;color:#fff;font-weight:700;font-size:13px;padding:6px 14px;border-radius:6px;border:none;cursor:pointer}
.btn-danger:hover{background:#f43f5e}
.btn-action{background:transparent;border:1px solid #334155;color:#94a3b8;font-size:11px;padding:3px 8px;border-radius:4px;cursor:pointer;transition:all .15s}
.btn-action:hover{border-color:#f59e0b;color:#f59e0b}
.btn-action.danger:hover{border-color:#e11d48;color:#fb7185}
.btn-action.success:hover{border-color:#10b981;color:#34d399}
.tab-btn{background:transparent;border:none;color:#94a3b8;font-size:13px;padding:6px 12px;border-radius:6px;cursor:pointer;font-weight:500}
.tab-btn:hover{color:#fbbf24}
.tab-btn.active{background:#1e293b;color:#fbbf24}
.card{background:#0f172a;border:1px solid #1e293b;border-radius:8px;padding:16px}
.card.p-0{padding:0}
.card-title{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#94a3b8;margin-bottom:10px}
.kpi{background:#0f172a;border:1px solid #1e293b;border-radius:8px;padding:12px}
.kpi-label{color:#94a3b8;font-size:10px;text-transform:uppercase;letter-spacing:.1em}
.kpi-value{font-size:20px;font-weight:700;margin-top:4px;line-height:1}
.kpi-delta{font-size:11px;margin-top:4px;font-weight:600}
.delta-up{color:#34d399}
.delta-down{color:#fb7185}
.delta-flat{color:#64748b}
.scrollbar::-webkit-scrollbar{height:8px;width:8px}
.scrollbar::-webkit-scrollbar-track{background:#0f172a}
.scrollbar::-webkit-scrollbar-thumb{background:#f59e0b;border-radius:4px}
th.sortable{cursor:pointer;user-select:none}
th.sortable:hover{color:#fbbf24}
.row-expanded{background:#0c1322}
.thumb{aspect-ratio:1/1;background:#1e293b;border-radius:6px;overflow:hidden;position:relative}
.thumb img{width:100%;height:100%;object-fit:cover}
.thumb-overlay{position:absolute;inset:0;background:linear-gradient(to top,rgba(0,0,0,.85),transparent 50%);display:flex;flex-direction:column;justify-content:flex-end;padding:8px}
.badge{display:inline-block;padding:2px 6px;border-radius:4px;font-size:10px;font-weight:600;letter-spacing:.05em}
.badge-active{background:#10b98133;color:#34d399}
.badge-paused{background:#64748b33;color:#94a3b8}
.badge-disapproved{background:#e11d4833;color:#fb7185}
.badge-pending{background:#f59e0b33;color:#fbbf24}
.toggle{position:relative;width:34px;height:20px;background:#334155;border-radius:10px;cursor:pointer;transition:background .15s;flex-shrink:0}
.toggle.on{background:#10b981}
.toggle::after{content:'';position:absolute;top:2px;left:2px;width:16px;height:16px;background:#fff;border-radius:50%;transition:transform .15s}
.toggle.on::after{transform:translateX(14px)}
.spinner{width:14px;height:14px;border:2px solid #334155;border-top-color:#f59e0b;border-radius:50%;animation:spin 1s linear infinite;display:inline-block;vertical-align:middle}
@keyframes spin{to{transform:rotate(360deg)}}
.fade-in{animation:fadeIn .25s ease-out}
@keyframes fadeIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
@media (max-width:768px){
  .ctrl{padding:5px 8px;font-size:12px}
  .kpi-value{font-size:16px}
  .card{padding:12px}
}

/* ── IA Chat ─────────────────────────────────────────────── */
.ai-chip {
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  color: #c4b5fd;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ai-chip:hover { background: rgba(124,58,237,0.3); border-color: rgba(124,58,237,0.6); }
.ai-msg-user { background: rgba(124,58,237,0.2); border: 1px solid rgba(124,58,237,0.3); }
.ai-msg-ai   { background: #1e293b; }
.ai-typing span { animation: blink 1s infinite; display: inline-block; width:6px; height:6px; border-radius:50%; background:#c4b5fd; margin:0 1px; vertical-align:middle; }
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,80%,100%{opacity:0.2} 40%{opacity:1} }
.ai-prose p  { margin-bottom: 0.5rem; }
.ai-prose ul { list-style: disc; padding-left: 1.25rem; margin-bottom: 0.5rem; }
.ai-prose li { margin-bottom: 0.2rem; }
.ai-prose strong { color: #f1f5f9; }

/* ── Drill link + compare bar ────────────────────────────── */
.drill-link{color:#fbbf24;text-decoration:none;cursor:pointer;border-bottom:1px dashed rgba(251,191,36,0.35);transition:color .15s,border-color .15s}
.drill-link:hover{color:#fde68a;border-bottom-color:#fde68a}
tr.selected{background:rgba(245,158,11,0.08)}
.row-checkbox{cursor:pointer;width:15px;height:15px}
