:root{font-family:Inter,Segoe UI,Roboto,Arial,sans-serif;color:#0f172a;background:#f8fafc}*{box-sizing:border-box}body{margin:0;background:#f8fafc}.auth-wrap{min-height:100vh;display:grid;place-items:center;padding:16px}.auth-card{width:100%;max-width:420px;background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:20px;display:grid;gap:10px}.hint{margin:0;color:#334155}.page{max-width:1100px;margin:0 auto;padding:24px}.layout{display:grid;grid-template-columns:240px 1fr;min-height:100vh}.sidebar{background:#0f172a;color:#fff;padding:20px 14px;display:flex;flex-direction:column;gap:8px}.brand{font-weight:700;margin-bottom:12px}.menu-btn{width:100%;text-align:left;background:transparent;border:1px solid transparent;color:#cbd5e1;padding:6px 10px;font-size:13px;font-weight:500}.menu-btn:hover{border-color:#334155}.menu-btn.active{background:#1e293b;color:#fff;border-color:#334155}.sidebar-nav-group{display:flex;flex-direction:column;gap:4px}.menu-sub{display:flex;flex-direction:column;gap:2px;margin:0 0 4px 4px;padding-left:10px;border-left:1px solid #334155}button.menu-btn--sub{font-size:12px;padding:5px 8px 5px 10px;color:#94a3b8;font-weight:400}button.menu-btn--sub:hover{color:#e2e8f0}button.menu-btn--sub.active{color:#fff;font-weight:500}button.menu-btn--parent:not(.active){border-color:#334155;color:#e2e8f0}.menu-btn-row{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%}.menu-badge{flex-shrink:0;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#dc2626;color:#fff;font-size:10px;font-weight:700;line-height:18px;text-align:center}.menu-btn--crm-hint:not(.active){border-color:#475569}.menu-dot{width:8px;height:8px;border-radius:50%;background:#f97316;flex-shrink:0}.content{padding:20px}.topbar{display:flex;justify-content:space-between;align-items:center}header h1{margin-bottom:4px}header p{margin-top:0;color:#334155}.panel{background:#fff;border:1px solid #e2e8f0;border-radius:12px;padding:16px;margin-bottom:16px}.tabs{display:flex;gap:10px;margin-bottom:16px}.tab{background:#e2e8f0;color:#0f172a}.tab.active{background:#0f172a;color:#fff}.grid{display:grid;gap:10px}input,select,textarea{border:1px solid #cbd5e1;border-radius:8px;padding:10px;font-size:14px}button{border:1px solid transparent;border-radius:6px;padding:5px 10px;font-size:12px;font-weight:500;line-height:1.3;background:#0f172a;color:#fff;cursor:pointer}button:hover{opacity:.92}button.btn-hint{min-width:28px;padding:5px 9px;font-size:14px;font-weight:700;line-height:1.2;background:#e2e8f0;color:#0f172a;border-color:#94a3b8}button.btn-hint:hover{opacity:1;background:#cbd5e1}button.btn-hint[aria-pressed=true]{background:#334155;color:#fff;border-color:#334155}.checkbox{display:flex;align-items:center;gap:8px}.actions{display:flex;flex-wrap:wrap;gap:6px;align-items:center}td.actions{white-space:normal}table{width:100%;border-collapse:collapse}.nice-table{border:1px solid #e2e8f0;border-radius:10px;overflow:hidden}thead th{background:#f8fafc}th,td{border-bottom:1px solid #e2e8f0;text-align:left;padding:10px}.error{color:#b91c1c;font-weight:600}.info{color:#0f766e;font-weight:600}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f172a73;display:grid;place-items:center;padding:16px}.modal{width:100%;max-width:560px;background:#fff;border-radius:12px;border:1px solid #e2e8f0;padding:16px}.modal-wide{max-width:640px}.modal-compact{max-width:440px;padding:14px 16px}.modal-compact h2{margin:0 0 6px;font-size:1.1rem}.hint-inline{margin:0 0 10px;font-size:12px;color:#64748b;line-height:1.35}.form-compact{display:flex;flex-direction:column;gap:8px}.form-compact .field{display:flex;flex-direction:column;gap:3px}.form-compact .field label{font-size:12px;color:#64748b;font-weight:500}.form-compact .field-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}.form-compact input,.form-compact select{padding:7px 9px;font-size:13px}.form-compact input[type=file]{padding:6px 0;border:none;font-size:12px}.form-compact button[type=submit]{margin-top:4px;padding:6px 12px;align-self:flex-start}.form-compact textarea{padding:7px 9px;font-size:13px;line-height:1.4;resize:vertical;min-height:0}.form-compact select{width:100%}.modal-agent-compact{max-width:480px;padding:14px 16px}.modal-agent-compact h2{margin:0 0 6px;font-size:1.1rem}.form-compact .checkbox-compact{margin:0;font-size:13px;gap:6px}.hint-panel{margin-bottom:16px}.hint-panel h3{margin-top:0}.hint-panel ol{margin:0;padding-left:20px;color:#334155}.mb-gap{margin-bottom:10px}.ingest-index-wrap{grid-column:1 / -1}.ingest-index-wrap .field{display:flex;flex-direction:column;gap:4px;margin-bottom:8px}.ingest-index-wrap .field label{font-size:12px;color:#64748b;font-weight:500}.agent-card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:14px}.agent-card{border:1px solid #e2e8f0;border-radius:12px;padding:14px;background:#fff;display:flex;flex-direction:column;gap:12px}.agent-card-head{display:flex;gap:12px;align-items:flex-start;min-width:0}.agent-avatar{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;font-weight:700;font-size:16px;line-height:1;flex-shrink:0}.agent-card-head-text{min-width:0;flex:1}.agent-card-title-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.agent-card-name{margin:0;font-size:16px;font-weight:600;color:#0f172a;line-height:1.25}.agent-status-badge{font-size:11px;font-weight:600;padding:2px 8px;border-radius:999px;white-space:nowrap}.agent-status-badge--on{background:#dcfce7;color:#166534}.agent-status-badge--off{background:#f1f5f9;color:#64748b}.agent-card-id{margin:4px 0 0;font-size:12px;color:#94a3b8;font-weight:500}.agent-card-sub{margin:6px 0 0;font-size:13px;color:#64748b;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.agent-card--interactive{cursor:pointer;transition:border-color .15s ease,box-shadow .15s ease}.agent-card--interactive:hover{border-color:#cbd5e1;box-shadow:0 4px 14px #0f172a0f}.agent-card--interactive:focus-visible{outline:2px solid #334155;outline-offset:2px}.agent-card-hint{margin:auto 0 0;padding-top:6px;font-size:11px;color:#94a3b8;font-weight:500}.agents-empty{text-align:center;padding:36px 16px;color:#64748b}.agents-empty p{margin:0 0 14px;font-size:15px}.agent-drawer-root{position:fixed;top:0;right:0;bottom:0;left:0;z-index:200}button.agent-drawer-backdrop{position:absolute;top:0;right:0;bottom:0;left:0;margin:0;padding:0;border:none;background:#0f172a73;cursor:pointer;display:block;width:100%;height:100%;animation:agent-drawer-backdrop-in .22s ease forwards}button.agent-drawer-backdrop:focus-visible{outline:2px solid #fff;outline-offset:-4px}@keyframes agent-drawer-backdrop-in{0%{opacity:0}to{opacity:1}}@keyframes agent-drawer-slide-in{0%{transform:translate(100%)}to{transform:translate(0)}}.agent-drawer{position:absolute;top:0;right:0;bottom:0;width:min(440px,100vw);max-width:100%;background:#fff;border-left:1px solid #e2e8f0;box-shadow:-8px 0 32px #0f172a1f;z-index:1;display:flex;flex-direction:column;overflow:hidden;animation:agent-drawer-slide-in .28s ease forwards}.agent-drawer-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px 12px 18px;border-bottom:1px solid #e2e8f0;flex-shrink:0;background:#fff}.agent-drawer-head h2{margin:0;font-size:1.1rem;font-weight:600;color:#0f172a}button.agent-drawer-close{min-width:36px;height:36px;padding:0;font-size:22px;line-height:1;font-weight:400;background:#f1f5f9;color:#334155;border:1px solid #e2e8f0;border-radius:8px;flex-shrink:0}button.agent-drawer-close:hover{opacity:1;background:#e2e8f0}.agent-drawer-body{padding:12px 18px 20px;overflow-y:auto;flex:1;min-height:0}.agent-drawer-body .hint-inline:first-of-type{margin-top:0}.crm-root{display:flex;flex-direction:column;gap:12px}.crm-split{display:grid;grid-template-columns:minmax(220px,320px) 1fr;gap:14px;align-items:start}@media (max-width: 900px){.crm-split{grid-template-columns:1fr}}.crm-list-panel{padding:12px;max-height:min(70vh,640px);overflow-y:auto}.crm-list-toolbar{display:flex;justify-content:flex-end;align-items:center;margin-bottom:8px;min-height:28px}.crm-filter-inline{display:flex;align-items:center;gap:6px;max-width:100%;min-width:0}.crm-filter-label{font-size:11px;font-weight:500;color:#64748b;white-space:nowrap;flex-shrink:0;margin:0}select.crm-filter-select{font-size:12px;line-height:1.25;padding:4px 8px;min-height:28px;max-width:200px;width:auto;border-radius:6px;border:1px solid #cbd5e1;background:#fff;color:#0f172a}select.crm-filter-select--narrow{max-width:130px}.crm-list-panel .crm-conv-list{margin-top:0}.crm-detail-panel{padding:12px;min-height:280px;max-height:min(75vh,720px);display:flex;flex-direction:column;gap:10px}.crm-conv-list{list-style:none;margin:10px 0 0;padding:0;display:flex;flex-direction:column;gap:6px}button.crm-conv-item{width:100%;text-align:left;background:#f8fafc;color:#0f172a;border:1px solid #e2e8f0;border-radius:8px;padding:8px 10px;cursor:pointer;display:flex;flex-direction:column;gap:2px;font-size:12px}button.crm-conv-item:hover{opacity:1;background:#f1f5f9}button.crm-conv-item.active{border-color:#334155;background:#e2e8f0}button.crm-conv-item--unread:not(.active){border-left:3px solid #2563eb;padding-left:7px;background:#eff6ff}button.crm-conv-item--unread.active{border-left:3px solid #1d4ed8;padding-left:7px}.crm-conv-title{font-weight:600;font-size:13px}.crm-conv-meta{color:#64748b;font-size:11px}.crm-conv-preview{color:#94a3b8;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.crm-thread{flex:1;overflow-y:auto;border:1px solid #e2e8f0;border-radius:8px;padding:10px;background:#fafafa;display:flex;flex-direction:column;gap:10px;min-height:160px}.crm-msg{border-radius:8px;padding:8px 10px;font-size:13px;line-height:1.4}.crm-msg--user{background:#e0e7ff;align-self:flex-start;max-width:95%}.crm-msg--ai{background:#fff;border:1px solid #e2e8f0;align-self:flex-end;max-width:95%}.crm-msg--human{background:#dcfce7;align-self:flex-end;max-width:95%}.crm-msg-label{display:block;font-size:10px;color:#64748b;margin-bottom:4px;font-weight:600}.crm-msg-text{white-space:pre-wrap;word-break:break-word}.crm-create-lead-btn{align-self:flex-start;margin-top:6px}.crm-lead-head{margin:0;font-size:14px;color:#334155}.crm-reply-form{display:flex;flex-direction:column;gap:6px}.crm-reply-form label{font-size:12px;color:#64748b;font-weight:500}.crm-reply-form textarea{width:100%;resize:vertical;min-height:72px}.crm-close-lead{align-self:flex-start;background:#64748b}.crm-close-lead:hover{opacity:.92}
