/* ELEVA Chat — estilos base (Tailwind se carga por CDN; aquí solo componentes reutilizables) */
[x-cloak] { display: none !important; }
html { -webkit-tap-highlight-color: transparent; }

/* Botones */
.btn-primary, .btn-secondary, .btn-danger, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: .6rem; padding: .55rem 1rem; font-size: .875rem; font-weight: 500;
  transition: background-color .15s, box-shadow .15s, opacity .15s; white-space: nowrap;
}
.btn-primary { background: #4f46e5; color: #fff; box-shadow: 0 1px 2px rgba(79,70,229,.25); }
.btn-primary:hover { background: #4338ca; }
.btn-secondary { background: #fff; color: #334155; border: 1px solid #e2e8f0; }
.btn-secondary:hover { background: #f8fafc; }
.dark .btn-secondary { background: #1e293b; color: #e2e8f0; border-color: #334155; }
.dark .btn-secondary:hover { background: #273449; }
.btn-danger { background: #e11d48; color: #fff; }
.btn-danger:hover { background: #be123c; }
.btn-ghost { color: #475569; }
.btn-ghost:hover { background: #f1f5f9; }
.dark .btn-ghost { color: #cbd5e1; }
.dark .btn-ghost:hover { background: #1e293b; }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; }
button:disabled, .btn-primary[disabled] { opacity: .55; cursor: not-allowed; }

/* Formularios */
.input, .select, .textarea {
  width: 100%; border-radius: .6rem; border: 1px solid #e2e8f0; background: #fff;
  padding: .55rem .8rem; font-size: .875rem; color: #0f172a; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.dark .input, .dark .select, .dark .textarea { background: #0f172a; border-color: #334155; color: #e2e8f0; }
.label { display: block; font-size: .8rem; font-weight: 500; color: #475569; margin-bottom: .35rem; }
.dark .label { color: #94a3b8; }
.help { font-size: .75rem; color: #94a3b8; margin-top: .3rem; }

/* Tarjetas y tablas */
.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.dark .card { background: #0f172a; border-color: #1e293b; }
.table { width: 100%; font-size: .875rem; }
.table th { text-align: left; font-weight: 500; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: #64748b; padding: .75rem 1rem; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.dark .table th { background: #0b1222; border-color: #1e293b; }
.table td { padding: .75rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.dark .table td { border-color: #1e293b; }
.table tbody tr:hover { background: #f8fafc; }
.dark .table tbody tr:hover { background: #111a2e; }

.badge { display: inline-flex; align-items: center; gap: .25rem; border-radius: 999px; padding: .1rem .55rem; font-size: .7rem; font-weight: 600; }

/* Navegación */
.nav-link { display: flex; align-items: center; gap: .75rem; border-radius: .6rem; padding: .55rem .75rem; font-size: .875rem; font-weight: 500; color: #475569; }
.nav-link:hover { background: #f1f5f9; color: #0f172a; }
.dark .nav-link { color: #94a3b8; }
.dark .nav-link:hover { background: #1e293b; color: #fff; }
.nav-link-active, .nav-link-active:hover { background: #eef2ff; color: #4338ca; }
.dark .nav-link-active, .dark .nav-link-active:hover { background: rgba(99,102,241,.15); color: #c7d2fe; }

.tab { padding: .6rem .2rem; font-size: .875rem; font-weight: 500; color: #64748b; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: #0f172a; }
.dark .tab:hover { color: #fff; }
.tab-active { color: #4f46e5; border-color: #4f46e5; }
.dark .tab-active { color: #a5b4fc; border-color: #818cf8; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: .5rem; }
.dark .skeleton { background: linear-gradient(90deg, #1e293b 25%, #273449 37%, #1e293b 63%); background-size: 400% 100%; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Scrollbars finos */
.thin-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.thin-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.dark .thin-scroll::-webkit-scrollbar-thumb { background: #334155; }

/* Chat */
.chat-bg { background-color: #f4f5f9; background-image: radial-gradient(#e3e6ef 1px, transparent 1px); background-size: 18px 18px; }
.dark .chat-bg { background-color: #0b1120; background-image: radial-gradient(#162033 1px, transparent 1px); }
.bubble-in { background: #fff; border: 1px solid #e8ebf2; }
.dark .bubble-in { background: #172033; border-color: #1f2a40; }
.bubble-out { background: #4f46e5; color: #fff; }
.bubble-bot { background: #0f766e; color: #fff; }
.bubble-note { background: #fef9c3; border: 1px dashed #eab308; color: #713f12; }
.dark .bubble-note { background: #3a2f0b; color: #fde68a; border-color: #a16207; }

/* Drawflow (editor de flujos) */
#drawflow { width: 100%; height: 100%; }
.drawflow .drawflow-node { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 4px 12px rgba(15,23,42,.06); padding: 0; width: 250px; color: #0f172a; }
.dark .drawflow .drawflow-node { background: #0f172a; border-color: #334155; color: #e2e8f0; }
.drawflow .drawflow-node.selected { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.25); background: #fff; }
.dark .drawflow .drawflow-node.selected { background: #0f172a; }
.drawflow .drawflow-node .input, .drawflow .drawflow-node .output { width: 14px; height: 14px; border: 2px solid #6366f1; background: #fff; }
.drawflow .connection .main-path { stroke: #818cf8; stroke-width: 3px; }
.drawflow .connection .main-path.selected { stroke: #e11d48; }
.drawflow-delete { background: #e11d48 !important; border: none !important; color: #fff !important; }
.df-head { display: flex; align-items: center; gap: .5rem; padding: .55rem .75rem; border-bottom: 1px solid #f1f5f9; font-weight: 600; font-size: .8rem; }
.dark .df-head { border-color: #1e293b; }
.df-body { padding: .6rem .75rem .75rem; display: flex; flex-direction: column; gap: .4rem; }
.df-body textarea, .df-body input, .df-body select { width: 100%; border: 1px solid #e2e8f0; border-radius: 8px; padding: .35rem .5rem; font-size: .78rem; background: transparent; color: inherit; }
.dark .df-body textarea, .dark .df-body input, .dark .df-body select { border-color: #334155; background: #0b1222; }
.df-body small { color: #94a3b8; font-size: .7rem; }
.df-dot { width: 8px; height: 8px; border-radius: 999px; }
