/* bot-base.css — parte del styles.css del panel de WhatsApp de Brizuela (partido el 13/11/2026, hasta 150 líneas por archivo). El orden de los <link> en index.html es el del original: la cascada no cambia. */
*{margin:0;padding:0;box-sizing:border-box}
:root{
  --bg:#0f1012;--bg2:#1e2024;--red:#C41E1E;--red-dark:#9E1A1A;
  --white:#f4f4f5;--gray:#8b8f96;--gray-light:#D9D9D9;
  --green:#37b26b;--blue:#4b8ef1;--gold:#d79a2f;
  --bubble-client:#1A3A2A;--bubble-bot:#2A2A2A;--bubble-admin:#1A2A3A;
  --accent:#e8363d;
  --border:rgba(196,30,30,.22);--border-soft:rgba(255,255,255,.07);
  --field-bg:rgba(10,10,10,.6);--bg2-solid:#160d0d;
}
html,body{height:100%;overflow:hidden}
body{font-family:'Montserrat',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:radial-gradient(1200px 700px at 50% -10%, #3a1414 0%, #1a0a0a 40%, #0F0F0F 100%) fixed;color:var(--white)}
a{color:var(--red);text-decoration:none}

/* Login */
.login-screen{display:flex;align-items:center;justify-content:center;height:100%;background:var(--bg)}
.login-box{background:var(--bg2);border-radius:12px;padding:40px;width:360px;text-align:center;border:1px solid #333}
.login-box h1{color:var(--red);font-size:22px;margin-bottom:6px}
.login-box p{color:var(--gray);font-size:13px;margin-bottom:24px}
.login-box input{width:100%;padding:12px 16px;border-radius:8px;border:1px solid #333;background:#111;color:var(--white);font-size:14px;margin-bottom:12px;outline:none}
.login-box input:focus{border-color:var(--red)}
.pwd-wrap{position:relative;margin-bottom:12px}
.pwd-wrap input{margin-bottom:0;padding-right:42px}
.pwd-toggle{position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:none;color:var(--gray);cursor:pointer;padding:6px;display:flex;align-items:center;justify-content:center;border-radius:6px}
.pwd-toggle:hover{color:var(--white);background:#222}
.pwd-toggle svg{width:18px;height:18px;display:block}
.pwd-toggle .eye-off{display:none}
.pwd-toggle.showing .eye-on{display:none}
.pwd-toggle.showing .eye-off{display:block}
.login-box .btn{width:100%;padding:12px;border:none;border-radius:8px;font-size:14px;font-weight:600;cursor:pointer;margin-bottom:8px}
.btn-primary{background:var(--red);color:var(--white)}
.btn-primary:hover{background:var(--red-dark)}
.btn-demo{background:transparent;color:var(--gray);border:1px solid #333!important}
.btn-demo:hover{color:var(--white);border-color:var(--gray)!important}
.login-error{color:var(--red);font-size:12px;margin-bottom:12px;display:none}

/* Panel Layout */
.panel{display:none;height:100%;flex-direction:column}
.panel.active{display:flex}
.panel-body{display:flex;flex:1;min-height:0;overflow:hidden}

/* Sidebar */
.sidebar{width:360px;min-width:360px;background:var(--bg2);border-right:1px solid #333;display:flex;flex-direction:column;height:100%}
.sidebar-header{padding:16px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #333;flex-shrink:0;gap:8px}
.sidebar-header h2{font-size:16px;font-weight:600}
.sidebar-header .badge{background:var(--red);color:var(--white);font-size:11px;padding:2px 8px;border-radius:10px}
.sidebar-btns{display:flex;gap:6px;align-items:center}
.sidebar-btns button{background:none;border:1px solid #333;color:var(--gray);padding:4px 10px;border-radius:6px;font-size:11px;cursor:pointer}
.sidebar-btns button:hover{color:var(--white);border-color:var(--gray)}
.sidebar-btns button.active-view{color:var(--red);border-color:var(--red)}
.bot-toggle{display:flex;align-items:center;gap:8px;padding:8px 16px;border-bottom:1px solid #333;font-size:12px;color:var(--gray);flex-shrink:0}
.bot-toggle label{cursor:pointer;display:flex;align-items:center;gap:6px}
.switch{position:relative;width:36px;height:20px;flex-shrink:0}
.switch input{opacity:0;width:0;height:0}
.slider{position:absolute;inset:0;background:#333;border-radius:10px;cursor:pointer;transition:.3s}
.slider:before{content:'';position:absolute;height:14px;width:14px;left:3px;bottom:3px;background:var(--white);border-radius:50%;transition:.3s}
.switch input:checked+.slider{background:var(--green)}
.switch input:checked+.slider:before{transform:translateX(16px)}

.chat-list{flex:1;overflow-y:auto;min-height:0}
.chat-item{padding:12px 16px;cursor:pointer;border-bottom:1px solid #222;display:flex;gap:12px;align-items:center;transition:background .15s}
.chat-item:hover,.chat-item.active{background:#252525}
.chat-avatar{width:44px;height:44px;border-radius:50%;background:var(--red);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:16px;flex-shrink:0}
.chat-info{flex:1;min-width:0}
.chat-name{font-size:14px;font-weight:600;display:flex;justify-content:space-between;align-items:center}
.chat-name .time{font-size:11px;color:var(--gray);font-weight:400}
.chat-preview{font-size:12px;color:var(--gray);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}
.chat-tags{display:flex;gap:4px;margin-top:4px}
.tag{font-size:10px;padding:1px 6px;border-radius:4px;background:#333;color:var(--gray)}
.tag.bot-off{background:#3A1A1A;color:var(--red)}
.label-badge{font-size:10px;padding:1px 7px;border-radius:4px;font-weight:600;letter-spacing:.3px}
.label-lead{background:#2A2A10;color:#D4A017;border:1px solid #4A4A10}
.label-cliente{background:#0A2A10;color:#4ade80;border:1px solid #1A5A20}
.label-perdido{background:#2A1A1A;color:#888;border:1px solid #3A2A2A}
.label-select{background:#111;border:1px solid #333;color:#aaa;padding:4px 8px;border-radius:6px;font-size:11px;cursor:pointer;outline:none}
.label-select:focus{border-color:var(--red)}
.label-select option{background:#111}

/* Chat area */
.chat-area{flex:1;display:flex;flex-direction:column;background:var(--bg);min-height:0;min-width:0;overflow:hidden}
.chat-empty{flex:1;display:flex;align-items:center;justify-content:center;color:var(--gray);font-size:14px}
.chat-header{padding:12px 20px;background:var(--bg2);border-bottom:1px solid #333;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}
.chat-header-info{display:flex;align-items:center;gap:12px}
.chat-header-info .name{font-weight:600;font-size:15px}
.chat-header-info .phone{font-size:12px;color:var(--gray)}
.chat-header-actions{display:flex;gap:8px;align-items:center}
.chat-header-actions button{padding:6px 12px;border-radius:6px;border:1px solid #333;background:transparent;color:var(--gray);font-size:12px;cursor:pointer}
.chat-header-actions button:hover{color:var(--white);border-color:var(--gray)}
.chat-header-actions button.bot-on{color:var(--green);border-color:var(--green)}

.chat-content{display:none;flex-direction:column;flex:1;min-height:0;overflow:hidden;position:relative}

.messages{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:4px;min-height:0}
/* Drawer de memoria del bot */
.memory-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;background:var(--gold);color:#000;border-radius:9px;font-size:10px;font-weight:700;margin-left:6px}
.memory-badge.empty{background:#333;color:#666}
.memory-drawer{position:absolute;top:0;right:0;width:360px;max-width:90vw;height:100%;background:var(--bg2);border-left:1px solid #333;box-shadow:-4px 0 20px rgba(0,0,0,.4);transform:translateX(100%);transition:transform .25s ease;z-index:20;display:flex;flex-direction:column}
.memory-drawer.open{transform:translateX(0)}
.memory-drawer-header{padding:16px 20px;border-bottom:1px solid #333;display:flex;justify-content:space-between;align-items:center;flex-shrink:0}
.memory-drawer-title{font-size:14px;font-weight:700;color:var(--gold);text-transform:uppercase;letter-spacing:.5px}
.memory-drawer-close{background:transparent;border:none;color:#888;font-size:24px;cursor:pointer;padding:0 6px;line-height:1}
.memory-drawer-close:hover{color:var(--red)}
.memory-drawer-body{flex:1;overflow-y:auto;padding:12px 16px}
.memory-empty{color:#666;font-size:13px;font-style:italic;text-align:center;padding:30px 10px;line-height:1.5}
.memory-item{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#1a1a1a;border:1px solid #2a2a2a;border-radius:8px;padding:10px 12px;margin-bottom:8px;transition:border-color .15s}
.memory-item:hover{border-color:#444}
.memory-item-info{flex:1;min-width:0}
.memory-group{font-size:11px;color:#aaa;font-weight:700;letter-spacing:.4px;margin:16px 0 8px;padding-bottom:5px;border-bottom:1px solid #2a2a2a}
.memory-group:first-child{margin-top:0}
.memory-item-label{font-size:10px;color:var(--gold);font-weight:700;text-transform:uppercase;letter-spacing:.5px;margin-bottom:2px}
.memory-item-value{font-size:13px;color:#eee;word-break:break-word}
.memory-item-del{background:transparent;border:1px solid #333;color:#888;font-size:14px;cursor:pointer;padding:4px 8px;border-radius:6px;flex-shrink:0}
.memory-item-del:hover{color:var(--red);border-color:var(--red)}
.memory-item-value-input{width:100%;background:#0d0d0d;border:1px solid var(--gold,#D4A017);color:#fff;border-radius:5px;padding:5px 7px;font-size:13px;outline:none}
.memory-item-value.editable{cursor:text}
.memory-item-value.editable:hover{color:#fff;outline:1px dashed #444;outline-offset:2px;border-radius:3px}
.memory-notes-section{padding:14px 16px;border-top:1px solid #2a2a2a;border-bottom:1px solid #2a2a2a;background:#141414}
.memory-notes-label{font-size:10px;color:var(--gold,#D4A017);font-weight:700;text-transform:uppercase;letter-spacing:.5px;margin-bottom:6px;display:flex;justify-content:space-between;align-items:center}
.memory-notes-status{font-size:9px;color:#666;font-weight:400;text-transform:none;letter-spacing:0}
.memory-notes-textarea{width:100%;min-height:80px;background:#0d0d0d;border:1px solid #2a2a2a;color:#eee;border-radius:6px;padding:8px 10px;font-size:13px;font-family:inherit;resize:vertical;outline:none;line-height:1.4}
.memory-notes-textarea:focus{border-color:var(--gold,#D4A017)}
.memory-notes-textarea[readonly]{opacity:.7;cursor:default}
.memory-drawer-footer{padding:12px 16px;border-top:1px solid #333;flex-shrink:0}
.memory-clear-all{width:100%;padding:8px;background:transparent;border:1px solid var(--red);color:var(--red);border-radius:6px;cursor:pointer;font-size:12px;transition:background .15s}
.memory-clear-all:hover{background:var(--red);color:#fff}
.memory-drawer-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.4);z-index:19;display:none}
.memory-drawer-backdrop.open{display:block}
@media(max-width:700px){.memory-drawer{width:100%;max-width:100%}}
