:root{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--bg:#f4f5f7;--panel:#fff;--border:#e5e7eb;--border-strong:#d7dbe1;--text:#101828;--muted:#6b7280;--muted-2:#9ca3af;--accent:#16a34a;--accent-dark:#15803d;--accent-light:#dcfce7;--accent-text:#166534;--primary:#2563eb;--primary-text:#fff;--danger:#dc2626;--danger-light:#fee2e2;--danger-text:#991b1b;--warning-light:#fef3c7;--warning-text:#92400e;--info-light:#dbeafe;--info-text:#1e3a8a;--nav-bg:#0b1220;--nav-bg-raised:#141b2d;--nav-border:#1f2937;--nav-text:#cbd5e1;--nav-text-dim:#7c8aa5;--radius-sm:8px;--radius-md:12px;--radius-lg:16px;--shadow-sm:0 1px 2px #1018280f;--shadow-md:0 4px 16px #10182814;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}*{box-sizing:border-box}body{background:var(--bg);color:var(--text);margin:0}a{color:var(--primary)}button{cursor:pointer;border:1px solid var(--border-strong);background:var(--panel);border-radius:var(--radius-sm);color:var(--text);padding:.45rem .85rem;font-size:.85rem;font-weight:500;transition:background .12s,border-color .12s,transform 60ms}button:hover:not(:disabled){border-color:var(--muted-2)}button:active:not(:disabled){transform:translateY(1px)}button:disabled{opacity:.5;cursor:not-allowed}button.btn-primary{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600}button.btn-primary:hover:not(:disabled){background:var(--accent-dark);border-color:var(--accent-dark)}button.btn-danger{color:var(--danger);background:0 0;border-color:#0000}button.btn-danger:hover:not(:disabled){background:var(--danger-light)}button.btn-ghost{color:var(--muted);background:0 0;border-color:#0000}button.btn-ghost:hover:not(:disabled){background:#f3f4f6}input,select,textarea{border:1px solid var(--border-strong);border-radius:var(--radius-sm);color:var(--text);background:var(--panel);padding:.45rem .65rem;font-family:inherit;font-size:.88rem}input:focus,select:focus,textarea:focus{outline-offset:0;border-color:var(--accent);outline:2px solid #bbf7d0}.muted{color:var(--muted)}.error-text{color:var(--danger);font-size:.85rem}.login-page{background:radial-gradient(circle at 20% 20%, #f0fdf4, var(--bg) 55%);justify-content:center;align-items:center;min-height:100vh;display:flex}.login-card{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);flex-direction:column;gap:1.1rem;width:340px;padding:2.25rem;display:flex}.login-card label{color:var(--muted);flex-direction:column;gap:.35rem;font-size:.85rem;display:flex}.login-card button{background:var(--accent);color:#fff;border-radius:var(--radius-sm);border:none;padding:.65rem;font-weight:600}.login-card button:hover:not(:disabled){background:var(--accent-dark)}.app-shell{flex-direction:column;min-height:100vh;display:flex}.app-header{background:var(--nav-bg);border-bottom:1px solid var(--nav-border);color:var(--nav-text);align-items:center;gap:1.5rem;padding:.65rem 1.5rem;display:flex}.app-brand{flex-shrink:0;align-items:center;gap:.65rem;display:flex}.app-brand-mark{background:linear-gradient(135deg, var(--accent), #059669);color:#fff;border-radius:9px;flex-shrink:0;justify-content:center;align-items:center;width:34px;height:34px;display:flex}.app-brand-text{flex-direction:column;line-height:1.15;display:flex}.app-title{color:#fff;font-size:.95rem;font-weight:700}.app-subtitle{color:var(--nav-text-dim);font-size:.7rem}.app-header nav{flex:1;gap:.35rem;display:flex}.app-header nav a{color:var(--nav-text-dim);white-space:nowrap;border-radius:999px;align-items:center;gap:.4rem;padding:.4rem .75rem;font-size:.85rem;font-weight:500;text-decoration:none;display:flex}.app-header nav a:hover{color:var(--nav-text);background:#ffffff0d}.app-header nav a.active{color:#fff;background:var(--accent)}.app-header-user{color:var(--nav-text-dim);flex-shrink:0;align-items:center;gap:.85rem;font-size:.82rem;display:flex}.app-header-user .user-name{color:#fff;font-weight:600}.live-dot{color:var(--accent);background:#16a34a26;border-radius:999px;align-items:center;gap:.35rem;padding:.25rem .6rem;font-size:.72rem;font-weight:600;display:inline-flex}.live-dot:before{content:"";background:var(--accent);border-radius:999px;width:6px;height:6px;animation:1.8s infinite pulse-dot;box-shadow:0 0 #16a34a99}@keyframes pulse-dot{0%{box-shadow:0 0 #16a34a80}70%{box-shadow:0 0 0 6px #16a34a00}to{box-shadow:0 0 #16a34a00}}.app-header-user button{border:1px solid var(--nav-border);color:var(--nav-text);background:0 0}.app-header-user button:hover{background:#ffffff0f}.app-content{flex:1;width:100%;max-width:1400px;margin:0 auto;padding:1.5rem}.surface-card{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm)}.page-header-card{justify-content:space-between;align-items:center;gap:1rem;margin-bottom:1.25rem;padding:1.25rem 1.5rem;display:flex}.page-header-card-left{align-items:center;gap:.9rem;display:flex}.page-header-icon{border-radius:var(--radius-md);background:var(--nav-bg);width:42px;height:42px;color:var(--accent);flex-shrink:0;justify-content:center;align-items:center;display:flex}.page-header-card h2{margin:0 0 .2rem;font-size:1.1rem}.page-header-card p{color:var(--muted);margin:0;font-size:.85rem}.avatar{color:#fff;border-radius:999px;flex-shrink:0;justify-content:center;align-items:center;width:38px;height:38px;font-size:.8rem;font-weight:700;display:inline-flex}.avatar.sm{width:30px;height:30px;font-size:.68rem}.inbox-layout{grid-template-columns:340px 1fr;align-items:start;gap:1.25rem;height:calc(100vh - 130px);display:grid}.inbox-list-panel{flex-direction:column;height:100%;display:flex;overflow:hidden}.inbox-search{padding:.9rem .9rem .6rem}.inbox-search input{width:100%}.filter-bar{border-bottom:1px solid var(--border);flex-wrap:wrap;gap:.4rem;padding:0 .9rem .75rem;display:flex}.filter-chip{color:var(--muted);background:#f3f4f6;border-color:#0000;border-radius:999px;padding:.3rem .7rem;font-size:.78rem}.filter-chip.active{background:var(--nav-bg);color:#fff;border-color:var(--nav-bg)}.inbox-count{color:var(--muted);padding:.6rem .9rem .2rem;font-size:.78rem}.conversation-list{flex-direction:column;flex:1;gap:.15rem;margin:0;padding:.4rem;list-style:none;display:flex;overflow-y:auto}.conversation-row{border-radius:var(--radius-md);color:var(--text);align-items:flex-start;gap:.7rem;padding:.7rem;text-decoration:none;display:flex}.conversation-row:hover{background:#f6f7f9}.conversation-row.active{background:var(--accent-light)}.conversation-row-body{flex:1;min-width:0}.conversation-row-top{justify-content:space-between;align-items:baseline;gap:.5rem;display:flex}.customer-name{white-space:nowrap;text-overflow:ellipsis;font-size:.9rem;font-weight:600;overflow:hidden}.last-message{color:var(--muted);white-space:nowrap;text-overflow:ellipsis;margin-top:.15rem;font-size:.82rem;display:block;overflow:hidden}.conversation-row-meta{flex-wrap:wrap;align-items:center;gap:.35rem;margin-top:.4rem;display:flex}.badge{color:#374151;white-space:nowrap;background:#e5e7eb;border-radius:999px;align-items:center;gap:.25rem;padding:.2rem .55rem;font-size:.68rem;font-weight:600;display:inline-flex}.badge.mode-ai{background:var(--accent-light);color:var(--accent-text)}.badge.mode-human{background:var(--warning-light);color:var(--warning-text)}.badge.mode-hybrid{color:#5b21b6;background:#ede9fe}.badge.status-open{background:var(--info-light);color:var(--info-text)}.badge.status-pending{background:var(--warning-light);color:var(--warning-text)}.badge.status-escalated{background:var(--danger-light);color:var(--danger-text)}.badge.status-resolved,.badge.status-closed{color:#374151;background:#e5e7eb}.badge.unread{background:var(--accent);color:#fff}.badge.risk-sensitive{background:var(--danger-light);color:var(--danger-text)}.badge.risk-write{background:var(--warning-light);color:var(--warning-text)}.badge.risk-read{background:var(--accent-light);color:var(--accent-text)}.timestamp{color:var(--muted-2);flex-shrink:0;font-size:.72rem}.detail-page{grid-template-columns:1fr 320px;align-items:start;gap:1.25rem;height:calc(100vh - 130px);display:grid}.detail-main{flex-direction:column;height:100%;padding:1.1rem 1.25rem;display:flex;overflow:hidden}.detail-header{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;margin-bottom:.9rem;padding-bottom:.9rem;display:flex}.detail-header-left{align-items:center;gap:.75rem;display:flex}.detail-header-left .back-link{color:var(--muted);margin-right:.5rem;font-size:.85rem;text-decoration:none}.detail-identity h3{margin:0;font-size:.98rem}.detail-identity span{color:var(--muted);font-size:.8rem}.detail-badges{gap:.5rem;display:flex}.escalation-banner{background:var(--danger-light);color:var(--danger-text);border-radius:var(--radius-sm);margin-bottom:1rem;padding:.6rem 1rem;font-size:.85rem}.chat-timeline{flex-direction:column;flex:1;gap:.7rem;margin-bottom:.9rem;padding:.5rem .25rem;display:flex;overflow-y:auto}.chat-bubble{border-radius:var(--radius-md);background:#f3f4f6;max-width:72%;padding:.6rem .85rem;font-size:.88rem;line-height:1.4}.chat-bubble.sender-customer{background:#f3f4f6;border-bottom-left-radius:4px;align-self:flex-start}.chat-bubble.sender-ai{background:var(--accent-light);border-bottom-right-radius:4px;align-self:flex-end}.chat-bubble.sender-agent{background:var(--info-light);border-bottom-right-radius:4px;align-self:flex-end}.chat-bubble.sender-system{background:var(--warning-light);color:var(--warning-text);text-align:center;align-self:center;max-width:90%;font-size:.8rem;font-style:italic}.chat-bubble-meta{color:var(--muted);justify-content:space-between;gap:1rem;margin-bottom:.25rem;font-size:.68rem;font-weight:600;display:flex}.reply-form{gap:.5rem;margin-bottom:.75rem;display:flex}.reply-form input{flex:1}.reply-form button{background:var(--accent);color:#fff;border-color:var(--accent);font-weight:600}.action-bar{flex-wrap:wrap;gap:.5rem;display:flex}.action-bar button.primary-action{background:var(--warning-light);color:var(--warning-text);border-color:#0000;font-weight:600}.detail-sidebar{flex-direction:column;gap:1rem;height:100%;display:flex;overflow-y:auto}.detail-sidebar section{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius-md);padding:1rem}.detail-sidebar h3{text-transform:uppercase;letter-spacing:.03em;color:var(--muted);margin-top:0;margin-bottom:.7rem;font-size:.85rem}.detail-sidebar dl{grid-template-columns:auto 1fr;gap:.4rem .75rem;margin:0;font-size:.85rem;display:grid}.detail-sidebar dt{color:var(--muted)}.detail-sidebar dd{margin:0;font-weight:500}.tool-call-list,.note-list{flex-direction:column;gap:.75rem;margin:0;padding:0;list-style:none;display:flex}.tool-call-list li,.note-list li{border-top:1px solid var(--border);padding-top:.5rem}.tool-call-list li:first-child,.note-list li:first-child{border-top:none;padding-top:0}.tool-call-header{justify-content:space-between;align-items:center;margin-bottom:.3rem;display:flex}.tool-call-header code{background:#f3f4f6;border-radius:4px;padding:.1rem .4rem;font-size:.78rem}.tool-call-list pre{background:#f9fafb;border-radius:6px;margin:.3rem 0;padding:.5rem;font-size:.72rem;overflow-x:auto}.note-list p{margin:0;font-size:.85rem}.note-list form{flex-direction:column;align-items:stretch;gap:.6rem;margin-top:.75rem;display:flex}.note-list form textarea{resize:vertical;width:100%;min-height:80px;margin:0;font-family:inherit}.note-list form button{background:var(--accent);border-color:var(--accent);color:#fff;align-self:stretch;width:100%;font-weight:600}.note-list form button:hover:not(:disabled){background:var(--accent-dark)}.ai-settings-page section{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius-md);margin-bottom:1.25rem;padding:1.25rem}.system-prompt{white-space:pre-wrap;background:#f9fafb;border-radius:6px;max-height:400px;padding:1rem;font-size:.85rem;overflow-y:auto}.users-page-toolbar{justify-content:flex-end;margin-bottom:1rem;display:flex}.create-user-panel{margin-bottom:1.25rem;padding:1.25rem 1.5rem}.create-user-panel h3{margin:0 0 .9rem;font-size:.95rem}.create-user-form{flex-wrap:wrap;align-items:center;gap:.6rem;display:flex}.create-user-form input,.create-user-form select{flex:1;min-width:150px}.users-table-card{overflow:hidden}table{border-collapse:collapse;background:var(--panel);width:100%}th,td{text-align:left;border-bottom:1px solid var(--border);padding:.85rem 1.1rem;font-size:.85rem}thead th{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;background:#fafbfc;font-size:.72rem;font-weight:600}tbody tr:last-child td{border-bottom:none}tbody tr:hover{background:#fafbfc}.user-cell{align-items:center;gap:.7rem;display:flex}.user-cell-text{flex-direction:column;line-height:1.3;display:flex}.user-cell-text .user-email{color:var(--muted);font-size:.78rem}.status-pill{align-items:center;gap:.4rem;font-size:.78rem;font-weight:600;display:inline-flex}.status-pill:before{content:"";border-radius:999px;width:7px;height:7px}.status-pill.active{color:var(--accent-text)}.status-pill.active:before{background:var(--accent)}.status-pill.disabled{color:var(--muted)}.status-pill.disabled:before{background:var(--muted-2)}.icon-btn{color:var(--muted);background:0 0;border:none;padding:.3rem .5rem}.icon-btn:hover{background:var(--danger-light);color:var(--danger)}.dashboard-grid{grid-template-columns:repeat(4,1fr);gap:1rem;margin-bottom:1.25rem;display:grid}.kpi-card{flex-direction:column;gap:.5rem;padding:1.1rem 1.25rem;display:flex}.kpi-card-top{justify-content:space-between;align-items:center;display:flex}.kpi-icon{border-radius:var(--radius-sm);justify-content:center;align-items:center;width:34px;height:34px;display:flex}.kpi-icon.tint-green{background:var(--accent-light);color:var(--accent-text)}.kpi-icon.tint-blue{background:var(--info-light);color:var(--info-text)}.kpi-icon.tint-amber{background:var(--warning-light);color:var(--warning-text)}.kpi-icon.tint-purple{color:#5b21b6;background:#ede9fe}.kpi-value{font-size:1.7rem;font-weight:700;line-height:1}.kpi-label{color:var(--muted);font-size:.8rem}.dashboard-row{grid-template-columns:2fr 1fr;align-items:start;gap:1.25rem;margin-bottom:1.25rem;display:grid}.chart-card,.list-card{padding:1.25rem 1.4rem}.chart-card h3,.list-card h3{margin:0 0 1rem;font-size:.95rem}.bar-chart{align-items:flex-end;gap:6px;height:160px;display:flex}.bar-chart-col{flex-direction:column;flex:1;justify-content:flex-end;align-items:center;gap:.4rem;height:100%;display:flex}.bar-chart-bar{background:var(--accent);border-radius:4px 4px 0 0;width:100%;max-width:26px;min-height:3px;transition:height .3s}.bar-chart-label{color:var(--muted-2);white-space:nowrap;font-size:.62rem}.stat-list{flex-direction:column;gap:.75rem;margin:0;padding:0;list-style:none;display:flex}.stat-list li{justify-content:space-between;align-items:center;gap:1rem;font-size:.85rem;display:flex}.stat-list-bar-track{background:#eef0f2;border-radius:999px;flex:1;height:6px;margin:0 .75rem;overflow:hidden}.stat-list-bar-fill{background:var(--accent);border-radius:999px;height:100%}.dashboard-row-secondary{grid-template-columns:1fr 1fr 1fr;gap:1.25rem;display:grid}.mini-donut-row{align-items:center;gap:1.25rem;display:flex}.legend-list{flex-direction:column;gap:.5rem;margin:0;padding:0;font-size:.8rem;list-style:none;display:flex}.legend-swatch{border-radius:3px;width:9px;height:9px;margin-right:.5rem;display:inline-block}.kb-page-header{justify-content:space-between;align-items:center;margin-bottom:1rem;display:flex}.button-link{background:var(--accent);color:#fff;border-radius:var(--radius-sm);padding:.45rem .85rem;font-size:.85rem;font-weight:600;text-decoration:none}.badge.kb-status-active{background:var(--accent-light);color:var(--accent-text)}.badge.kb-status-stale{background:var(--warning-light);color:var(--warning-text)}.badge.kb-status-disabled{color:#374151;background:#e5e7eb}.kb-document-page{grid-template-columns:1fr 320px;align-items:start;gap:1.5rem;display:grid}.kb-document-form{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius-md);flex-direction:column;gap:1rem;padding:1.5rem;display:flex}.kb-document-form label{color:var(--muted);flex-direction:column;gap:.3rem;font-size:.85rem;display:flex}.kb-document-form textarea{resize:vertical;font-family:inherit}.kb-document-actions{flex-wrap:wrap;gap:.5rem;display:flex}.kb-chunks-panel{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius-md);padding:1rem}.kb-chunks-panel ul{flex-direction:column;gap:.75rem;max-height:70vh;margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}.kb-chunks-panel li{border-top:1px solid var(--border);padding-top:.5rem;font-size:.85rem}.kb-chunks-panel p{margin:.2rem 0 0}@media (width<=1100px){.dashboard-grid{grid-template-columns:repeat(2,1fr)}.dashboard-row,.dashboard-row-secondary{grid-template-columns:1fr}.inbox-layout,.detail-page{grid-template-columns:1fr;height:auto}}
