:root{
  --bg:#dfe6ef;
  --panel:#f8fafc;
  --line:#c8d2df;
  --line2:#b8c4d2;
  --ink:#172033;
  --text:#253247;
  --muted:#627089;
  --brand:#c8ced8;
  --blue:#5474a5;
  --gold:#9a773a;
  --pink:#a65d7f;
  --success:#477763;
  --danger:#974b59;
}
*{box-sizing:border-box}
body{margin:0;min-height:100vh;background:linear-gradient(135deg,#e7edf4,#d8e1eb);color:var(--text);font-family:Inter,Segoe UI,Arial,sans-serif}
a{color:inherit;text-decoration:none}
.sidebar{position:fixed;inset:0 auto 0 0;width:224px;background:#050608;color:#eef4fb;padding:18px 12px;display:flex;flex-direction:column}
.brand{border-bottom:1px solid rgba(255,255,255,.14);padding:6px 4px 18px;margin-bottom:18px}
.brand strong{display:block;font-size:17px;letter-spacing:.18em}.brand span{display:block;margin-top:8px;color:#c3cede;font-size:13px}
.sidebar nav{display:grid;gap:8px}.sidebar a{border-radius:7px;padding:12px 13px;color:#cbd5e1;font-weight:800}.sidebar a:hover{background:#26374c;color:#fff}.sidebar a.on{background:linear-gradient(90deg,#3c424b,#252a31);color:#fff;box-shadow:inset 3px 0 0 #d6dbe3,0 0 16px rgba(214,219,227,.12)}
.main{margin-left:224px;max-width:1480px;padding:34px 38px 58px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:24px}
.actions,.panel-head,.row-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.row-actions{justify-content:flex-end;gap:8px}
.eyebrow{display:block;margin-bottom:9px;color:#697891;font-size:12px;text-transform:uppercase;letter-spacing:.16em;font-weight:850}
.lead-subtitle{margin:8px 0 0;color:#627089;font-size:16px;font-weight:750}.lead-context{margin:-4px 0 16px;color:#627089;font-size:14px;font-weight:750}
h1{margin:0;color:var(--ink);font-size:32px;line-height:1.1}h2{margin:0 0 16px;color:var(--ink);font-size:18px}
.panel,.kpi-grid article{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:22px 24px;box-shadow:0 10px 24px rgba(38,51,73,.05);margin-bottom:22px}
.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:24px}.kpi-grid article{min-height:130px;margin:0;border-top:4px solid var(--brand)}
.kpi-grid article:nth-child(2){border-top-color:var(--blue)}.kpi-grid article:nth-child(3){border-top-color:var(--gold)}.kpi-grid article:nth-child(4){border-top-color:var(--pink)}
.kpi-grid span,.status-grid span{display:block;color:#697891;font-size:11px;text-transform:uppercase;letter-spacing:.12em;font-weight:850;margin-bottom:14px}.kpi-grid strong{font-size:38px;color:#1d293b}
.grid.two{display:grid;grid-template-columns:1fr 1fr;gap:20px}.inline-form{display:flex;align-items:flex-end;gap:13px;flex-wrap:wrap}.inline-form label{margin-bottom:0}.inline-form button{min-height:41px}.inline-form .wide{flex:1 1 360px}
label{display:block;color:#53627a;font-size:13px;font-weight:750;margin-bottom:13px}label input,label select,textarea{display:block;width:100%;margin-top:7px}
input,select,textarea{border:1px solid var(--line2);border-radius:8px;padding:10px 12px;background:#fff;color:var(--text);font:inherit;outline:none}
textarea{min-height:150px;resize:vertical;line-height:1.55}label:has(textarea){grid-column:1/-1}
button,.button{display:inline-flex;align-items:center;justify-content:center;border:1px solid #050608;border-radius:8px;background:#050608;color:#fff;font-weight:850;padding:10px 15px;cursor:pointer}
.button.secondary{background:#111827;border-color:#111827;color:#fff}.button:hover,button:hover{filter:brightness(1.18)}
table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:14px 10px;border-bottom:1px solid rgba(99,112,137,.18);font-size:14px;vertical-align:middle}
th{color:#687790;font-size:10px;text-transform:uppercase;letter-spacing:.14em;font-weight:850;border-bottom:2px solid rgba(99,112,137,.24)}tbody tr:nth-child(even){background:rgba(241,245,249,.65)}
.muted{display:block;color:var(--muted);font-size:13px;line-height:1.5}.notice{background:#dbece4;border:1px solid #b8d8ca;color:#426f5e;border-radius:8px;padding:12px 14px;margin-bottom:16px;font-weight:750}
.alert{background:#efdce0;border:1px solid #dbb7bf;color:#934d5a;border-radius:8px;padding:12px 14px;margin-bottom:16px;font-weight:750}
.tag{display:inline-flex;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:800;background:#e1e8f0;color:#3e4d64}.tag.active{background:#dbece4;color:#477763}.tag.inactive{background:#e8edf4;color:#667085}.tag.pending,.tag.pendiente{background:#fff0c2;color:#8a6100}.tag.procesando{background:#dcefff;color:#23658f}.tag.finalizado{background:#dbece4;color:#477763}.tag.failed{background:#efdce0;color:#974b59}
.score{display:inline-flex;min-width:42px;justify-content:center;border-radius:999px;background:#e7f6f3;color:#08786d;padding:6px 9px;font-weight:850}
.status-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.status-grid article{background:#eef3f8;border:1px solid var(--line);border-radius:8px;padding:14px}.status-grid strong{font-size:28px;color:#1d293b}
.bars{height:190px;display:flex;align-items:flex-end;gap:8px;border-bottom:1px solid var(--line2);padding:10px 4px 24px}.bars div{flex:1;height:100%;display:flex;align-items:flex-end;position:relative}.bars i{display:block;width:100%;border-radius:5px 5px 0 0;background:linear-gradient(180deg,#8b96a8,#5474a5)}.bars span{position:absolute;bottom:-22px;left:50%;transform:translateX(-50%);font-size:11px;color:#7b8798}
.conversation{display:grid;gap:12px;margin-bottom:18px}.conversation article{max-width:820px;border:1px solid var(--line);border-radius:10px;padding:13px 15px;background:#fff}.conversation article.assistant{margin-left:auto;background:#effaf8}.conversation strong{display:block;color:#172033;text-transform:uppercase;font-size:11px;letter-spacing:.12em}.conversation p{margin:7px 0;line-height:1.5}.conversation small{color:#748197}
.detail-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0}.detail-list div{background:#eef3f8;border:1px solid var(--line);border-radius:8px;padding:12px}.detail-list dt{color:#697891;font-size:11px;text-transform:uppercase;letter-spacing:.12em;font-weight:850}.detail-list dd{margin:6px 0 0;color:#1d293b;font-weight:800}
.log-box{max-height:360px;overflow:auto;background:#111827;color:#eef4fb;border:1px solid #2f3a4b;border-radius:8px;padding:14px;white-space:pre-wrap;word-break:break-word}
.test-chat-panel{overflow:hidden}.n8n-chat-shell{height:720px;min-height:560px;max-width:470px;margin:0 auto;border:1px solid #b8c4d2;border-radius:8px;background:#efe7dd;overflow:hidden;box-shadow:0 18px 46px rgba(15,23,42,.16);--chat--color-primary:#075e54;--chat--color-primary-shade-50:#064f47;--chat--color-primary-shade-100:#043f39;--chat--color-secondary:#25d366;--chat--color-secondary-shade-50:#1eb85a;--chat--color-white:#fff;--chat--color-light:#f4f0ea;--chat--color-light-shade-50:#e9ded2;--chat--color-light-shade-100:#d6c8b9;--chat--color-medium:#c8bdb1;--chat--color-dark:#075e54;--chat--color-disabled:#87909a;--chat--color-typing:#667085;--chat--border-radius:8px;--chat--window--width:100%;--chat--window--height:100%;--chat--header--background:#075e54;--chat--header--color:#fff;--chat--message--user--background:#dcf8c6;--chat--message--user--color:#172033;--chat--message--bot--background:#fff;--chat--message--bot--color:#172033;--chat--toggle--background:#075e54;--chat--toggle--hover--background:#064f47;--chat--input--background:#f7f7f7;--chat--input--text-color:#172033;--chat--input--border:#ded6cc}.n8n-chat-shell .chat-window{width:100%!important;height:100%!important;border:0!important;border-radius:0!important;box-shadow:none!important}.n8n-chat-shell .chat-header{min-height:62px!important;padding:13px 16px!important;background:#075e54!important;color:#fff!important}.n8n-chat-shell .chat-header h1,.n8n-chat-shell .chat-header p{color:#fff!important}.n8n-chat-shell .chat-messages-list,.n8n-chat-shell .chat-body{background:#efe7dd!important;background-image:linear-gradient(45deg,rgba(255,255,255,.18) 25%,transparent 25%),linear-gradient(-45deg,rgba(255,255,255,.18) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(255,255,255,.18) 75%),linear-gradient(-45deg,transparent 75%,rgba(255,255,255,.18) 75%)!important;background-size:22px 22px!important;background-position:0 0,0 11px,11px -11px,-11px 0!important}.n8n-chat-shell .chat-message{border-radius:7px!important;box-shadow:0 1px 1px rgba(15,23,42,.08)!important;line-height:1.45!important}.n8n-chat-shell .chat-message-from-user,.n8n-chat-shell .chat-message--user{background:#dcf8c6!important;color:#172033!important;margin-left:auto!important}.n8n-chat-shell .chat-message-from-bot,.n8n-chat-shell .chat-message--bot,.n8n-chat-shell .chat-message-from-assistant{background:#fff!important;color:#172033!important}.n8n-chat-shell .chat-input,.n8n-chat-shell .chat-footer{background:#f0f2f5!important;border-top:1px solid #ddd6cf!important}.n8n-chat-shell textarea,.n8n-chat-shell input{border-radius:999px!important;background:#fff!important;border:1px solid #e5e7eb!important}.empty-state{display:grid;place-items:start;gap:10px;border:1px dashed var(--line2);border-radius:8px;background:#eef3f8;padding:24px}
.modal{display:none;position:fixed;inset:0;z-index:50;align-items:center;justify-content:center;padding:22px}.modal:target{display:flex}.modal-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.55)}.modal-card{position:relative;z-index:1;width:min(760px,94vw);max-height:88vh;overflow:auto;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:22px}.modal-head{display:flex;align-items:center;justify-content:space-between;gap:16px}
.login-page{display:grid;place-items:center;background:#dce4ed}.login-card{width:min(420px,92vw);background:#050608;border-radius:12px;padding:32px;color:#f8fafc;box-shadow:0 24px 70px rgba(15,23,42,.28)}.login-card strong{display:block;text-align:center;font-size:24px;letter-spacing:.18em}.login-card p{text-align:center;color:#d8e2ee}.login-card label{color:#d8e2ee}.login-card input{background:#111827;border-color:#374151;color:#f8fafc}.login-card button{width:100%;background:#f8fafc;border-color:#f8fafc;color:#0b1220}.login-card small{display:block;margin-top:15px;color:#9aa8ba}
@media(max-width:900px){.sidebar{position:static;width:auto}.main{margin-left:0;padding:22px 16px}.kpi-grid,.grid.two,.status-grid,.detail-list{grid-template-columns:1fr}.panel{overflow-x:auto}table{min-width:760px}.topbar{align-items:flex-start;flex-direction:column}.inline-form{display:block}}
