* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", sans-serif; color: #222; background: #fafafa; }

.admin-header {
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
    gap: 16px;
}
.admin-title { font-weight: 600; font-size: 15px; }
.admin-user { color: #666; font-size: 13px; flex: 1; }
.admin-back { color: #06f; text-decoration: none; font-size: 13px; }
.admin-back:hover { text-decoration: underline; }

.admin-main {
    display: grid;
    grid-template-columns: 240px 320px 1fr;
    height: calc(100vh - 48px);
}

.col-users, .col-sessions, .col-detail {
    border-right: 1px solid #eee;
    background: #fff;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.col-detail { border-right: none; }

.col-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #333;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.muted { color: #999; font-weight: 400; font-size: 12px; }

.list {
    flex: 1;
    overflow-y: auto;
}
.empty { color: #aaa; text-align: center; padding: 32px 16px; font-size: 13px; }

.user-item, .session-item {
    padding: 10px 16px;
    border-bottom: 1px solid #fafafa;
    cursor: pointer;
    transition: background 0.15s;
}
.user-item:hover, .session-item:hover { background: #f7f7f7; }
.user-item.active, .session-item.active { background: #eef4ff; }
.user-item-name { font-size: 13px; color: #222; display: flex; align-items: center; gap: 6px; }
.user-item-name .badge {
    font-size: 10px;
    background: #06f;
    color: #fff;
    padding: 1px 5px;
    border-radius: 8px;
    line-height: 1.4;
}
.user-item-meta { color: #999; font-size: 11px; margin-top: 2px; }

.session-item-title {
    font-size: 13px;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.session-item-meta { color: #999; font-size: 11px; margin-top: 2px; }
.session-item-id { color: #bbb; font-family: monospace; font-size: 10px; margin-top: 2px; }

.detail-meta {
    padding: 8px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
    font-size: 12px;
    background: #fafafa;
    flex-shrink: 0;
}
.detail-meta b { color: #333; font-weight: 600; }
.detail-meta div { margin: 2px 0; }
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
}

.msg {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.msg.user {
    background: #eef4ff;
    border-left: 3px solid #06f;
}
.msg.text {
    background: #fff;
    border: 1px solid #eee;
}
.msg.tool_use {
    background: #fff7e6;
    border-left: 3px solid #faad14;
    font-family: monospace;
    font-size: 12px;
}
.msg.tool_result {
    background: #f6ffed;
    border-left: 3px solid #52c41a;
    font-family: monospace;
    font-size: 12px;
}
.msg.tool_result.error {
    background: #fff2f0;
    border-left-color: #f5222d;
}
.msg-role {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
}

button.danger {
    background: #fff;
    border: 1px solid #f5222d;
    color: #f5222d;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
button.danger:hover { background: #f5222d; color: #fff; }
