:root{font-family:Segoe UI,Helvetica Neue,Arial,sans-serif;color:#27313d;background:#eef2f4;--page: #eef2f4;--panel: #ffffff;--panel-soft: #f7f9fb;--border: #d9e0e7;--border-strong: #c3ccd6;--text: #27313d;--muted: #6c7885;--blue: #2fc6f6;--blue-dark: #1d6fb8;--green: #27a857;--yellow: #b27800;--red: #d83a34;--shadow: 0 1px 4px rgba(39, 49, 61, .12)}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh}button,input,select,textarea{font:inherit}button{cursor:pointer}.shell{display:grid;grid-template-columns:248px minmax(0,1fr);min-height:100vh;background:var(--page)}.sidebar{display:flex;flex-direction:column;gap:18px;min-height:100vh;padding:14px 12px;border-right:1px solid var(--border);background:#f7f9fa}.brand{display:flex;align-items:center;gap:10px;min-height:54px;padding:8px}.brand-mark{display:grid;place-items:center;width:38px;height:38px;border-radius:8px;background:var(--blue);color:#fff;font-weight:800}.brand h1,.brand p,.page-header h2,.page-header p,.resource-head h3,.resource-head p,.settings-section h3{margin:0}.brand h1{font-size:17px;font-weight:700}.brand p{color:var(--muted);font-size:12px}.nav{display:flex;flex-direction:column;gap:4px}.nav-item{display:grid;grid-template-columns:22px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:40px;padding:0 10px;border-radius:6px;color:#465462;text-decoration:none}.nav-item:hover,.nav-item.is-active{background:#fff;color:var(--blue-dark);box-shadow:var(--shadow)}.nav-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nav-item strong{min-width:22px;padding:2px 6px;border-radius:999px;background:#eef2f4;color:#6c7885;font-size:11px;text-align:center}.sidebar-status{margin-top:auto;padding:8px;border-top:1px solid var(--border);color:var(--muted);font-size:12px}.sidebar-status div{display:flex;align-items:center;gap:7px;min-height:28px}.workspace{min-width:0}.topbar{display:flex;align-items:center;justify-content:space-between;min-height:54px;padding:0 20px;border-bottom:1px solid var(--border);background:#fff}.topbar-kicker{display:block;color:var(--muted);font-size:12px}.topbar-actions,.toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.environment-pill,.portal-pill{display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:0 10px;border:1px solid var(--border);border-radius:999px;color:#465462;font-size:12px;background:#fff}.content{padding:18px 20px 24px}.page{display:flex;flex-direction:column;gap:14px}.page-full{height:calc(100vh - 78px);min-height:720px}.page-header{display:flex;align-items:center;justify-content:space-between;gap:14px}.page-header h2{font-size:24px;font-weight:600}.page-header p{margin-top:4px;color:var(--muted);font-size:13px}.button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:0 13px;border:1px solid transparent;border-radius:6px;font-weight:700;font-size:13px}.button-primary{background:var(--blue);color:#fff}.button-secondary,.button-ghost{background:#fff;border-color:var(--border-strong);color:#465462}.button-danger{background:#fff0f0;border-color:#ffb9b5;color:var(--red)}.button-icon{display:inline-flex}.icon-button{display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--border);border-radius:6px;background:#fff;color:#465462}.stat-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.stat-tile{min-height:78px;padding:12px 14px;border:1px solid var(--border);border-radius:8px;background:#fff;box-shadow:var(--shadow)}.empty-state{padding:24px;border:1px dashed var(--border-strong);border-radius:10px;background:#fbfcfd;color:var(--muted)}.empty-state h3{margin:0 0 6px;color:var(--text);font-size:16px}.empty-state p{margin:0;line-height:1.45}.empty-state-list{margin:12px}.empty-state-thread{display:grid;flex:1;place-content:center;text-align:center}.stat-tile span,.stat-tile small{display:block;color:var(--muted);font-size:12px}.stat-tile strong{display:block;margin:4px 0 2px;color:var(--text);font-size:24px;line-height:1}.chat-layout{display:grid;grid-template-columns:390px minmax(0,1fr);gap:12px;min-height:0;flex:1}.chat-list,.chat-thread,.table-wrap,.form-panel,.resource-card,.settings-section,.crm-search{border:1px solid var(--border);border-radius:8px;background:#fff;box-shadow:var(--shadow)}.chat-list{display:flex;flex-direction:column;min-height:0;overflow:hidden}.list-tools{padding:12px;border-bottom:1px solid var(--border);background:var(--panel-soft)}.search-box,.crm-search{display:flex;align-items:center;gap:8px;min-height:38px;padding:0 10px}.search-box{border:1px solid var(--border);border-radius:6px;background:#fff}.search-box input,.crm-search input{width:100%;min-width:0;border:0;outline:0;background:transparent}.filter-strip{display:flex;gap:6px;margin-top:10px;overflow-x:auto}.filter-strip button{flex:0 0 auto;min-height:30px;padding:0 10px;border:1px solid var(--border);border-radius:999px;background:#fff;color:#465462;font-size:12px}.filter-strip button.is-active{border-color:var(--blue);background:#e5f9ff;color:var(--blue-dark);font-weight:700}.chat-list-scroll{min-height:0;overflow:auto}.chat-card{display:grid;grid-template-columns:42px minmax(0,1fr);gap:10px;padding:12px;border-bottom:1px solid #eef2f4;cursor:pointer}.chat-card.is-active,.chat-card:hover{background:#eaf8fe}.avatar{display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#d8dfe5;color:#465462;font-weight:800}.chat-meta{min-width:0}.chat-row{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.chat-row strong,.chat-card p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-row span{flex:0 0 auto;color:var(--muted);font-size:12px}.chat-card p{margin:5px 0 8px;color:#465462;font-size:13px}.chat-tags{display:flex;align-items:center;justify-content:space-between;gap:8px}.chat-tags span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:2px 7px;border-radius:4px;background:#eef2f4;color:#465462;font-size:12px}.chat-tags strong{min-width:22px;padding:2px 7px;border-radius:999px;background:var(--red);color:#fff;font-size:12px;text-align:center}.chat-thread{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}.thread-header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:64px;padding:12px 16px;border-bottom:1px solid var(--border)}.thread-header h3{margin:0 0 3px;font-size:18px}.thread-header p{margin:0;color:var(--muted);font-size:13px}.crm-inline{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:1px;background:var(--border);border-bottom:1px solid var(--border)}.crm-inline div{padding:10px 14px;background:#fbfcfd}.crm-inline span{display:block;color:var(--muted);font-size:11px;text-transform:uppercase}.crm-inline strong{display:block;margin-top:3px;font-size:13px}.message-list{flex:1;min-height:0;overflow:auto;padding:18px;background:#eef2f4}.message{max-width:66%;margin-bottom:12px;padding:10px 12px 8px;border-radius:8px;background:#fff;box-shadow:var(--shadow)}.message.outbound{margin-left:auto;background:#dcf4ca}.message-author{display:block;margin-bottom:5px;color:var(--muted);font-size:12px;font-weight:700}.message p{margin:0;line-height:1.45}.message time{display:block;margin-top:7px;color:var(--muted);font-size:11px;text-align:right}.composer{padding:12px;border-top:1px solid var(--border);background:#fff}.composer textarea{width:100%;resize:vertical;border:1px solid var(--border-strong);border-radius:6px;padding:10px;outline:0}.composer .toolbar{justify-content:flex-end;margin-top:10px}.resource-grid,.settings-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.resource-card,.settings-section,.form-panel{padding:14px}.resource-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.resource-head h3,.settings-section h3,.form-panel h3{font-size:16px}.resource-head p,.resource-metrics,.resource-error{color:var(--muted);font-size:13px}.resource-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:14px 0}.resource-metrics span{padding:8px;border-radius:6px;background:var(--panel-soft)}.resource-error{padding:8px 10px;border-radius:6px;background:#fff4e5;color:var(--yellow)}.status{display:inline-flex;min-height:24px;align-items:center;padding:0 8px;border-radius:999px;font-size:12px;font-weight:700}.status-active{background:#e7f7ed;color:var(--green)}.status-syncing{background:#e5f9ff;color:var(--blue-dark)}.status-auth_required,.status-rate_limited,.status-error{background:#fff0f0;color:var(--red)}.table-wrap{overflow:auto}.data-table{width:100%;min-width:760px;border-collapse:collapse;font-size:13px}.data-table th{position:sticky;top:0;z-index:1;padding:10px 12px;background:#f7f9fb;border-bottom:1px solid var(--border);color:var(--muted);text-align:left;font-size:11px;text-transform:uppercase}.data-table td{padding:11px 12px;border-bottom:1px solid #eef2f4;vertical-align:middle}.data-table tr:hover td{background:#fbfcfd}.split-layout{display:grid;grid-template-columns:340px minmax(0,1fr);gap:12px}.form-panel{align-self:start}.form-panel label,.settings-section label{display:flex;flex-direction:column;gap:5px;margin-top:10px;color:var(--muted);font-size:12px}.form-panel input,.form-panel select,.settings-section input{min-height:36px;border:1px solid var(--border-strong);border-radius:6px;padding:0 9px;color:var(--text);background:#fff}.check-list{display:flex;flex-direction:column;gap:4px;margin:14px 0}.check-list label{flex-direction:row;align-items:center;margin:0}.crm-search{min-height:46px;padding:0 12px}.row-action{display:inline-flex;align-items:center;gap:5px}.settings-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-section h3{display:flex;align-items:center;gap:8px;margin-bottom:8px}@media (max-width: 1180px){.shell{grid-template-columns:86px minmax(0,1fr)}.brand p,.brand h1,.nav-item span,.sidebar-status span{display:none}.brand{justify-content:center}.nav-item{grid-template-columns:1fr;justify-items:center}.nav-item strong{display:none}.chat-layout{grid-template-columns:320px minmax(0,1fr)}}@media (max-width: 920px){.shell,.chat-layout,.split-layout,.resource-grid,.settings-grid,.stat-row{grid-template-columns:1fr}.page-full{height:auto}.sidebar{min-height:auto;border-right:0;border-bottom:1px solid var(--border)}.brand h1,.brand p,.nav-item span,.sidebar-status span{display:block}.nav-item{grid-template-columns:22px minmax(0,1fr) auto;justify-items:stretch}.topbar,.page-header{align-items:flex-start;flex-direction:column;padding-top:12px;padding-bottom:12px}.message{max-width:88%}.crm-inline{grid-template-columns:1fr}}
