/* ── Agents tab layout ─────────────────────────────────────────────────────── */
#agents-container { display: flex; height: 100%; }

.agents-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

/* ── Agent list items ──────────────────────────────────────────────────────── */
.agent-item {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 12px;
    border-radius: 4px;
    margin-bottom: 2px;
    transition: background 0.1s;
}
.agent-item:hover  { background: var(--surface2); }
.agent-item.active { background: var(--accent-dim); color: var(--accent); }

.agent-item-name { font-weight: 600; }
.agent-item-sub  {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 2px;
}

/* ── Detail pane ───────────────────────────────────────────────────────────── */
#agent-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
}
#agent-detail-inner {
    padding: 16px 18px;
    flex: 1;
    overflow-y: auto;
}

.agent-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 12px;
}
.agent-detail-header h3 {
    font-size: 15px;
    color: var(--accent);
    margin: 0;
}
.agent-detail-actions { display: flex; gap: 6px; flex-shrink: 0; }

.agent-scope-hint {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 16px;
    padding: 6px 10px;
    background: var(--surface2);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.agent-scope-hint code {
    color: var(--accent);
    font-weight: 600;
}

/* ── File cards ────────────────────────────────────────────────────────────── */
.agent-file-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    overflow: hidden;
}
.agent-file-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface3);
}
.agent-file-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}
.agent-file-actions {
    display: flex;
    gap: 4px;
}
.agent-file-content {
    padding: 12px 14px;
    font-size: 11px;
    line-height: 1.55;
    overflow-x: auto;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    margin: 0;
}

/* ── Agent create modal ────────────────────────────────────────────────────── */
.agent-create-content {
    min-width: min(90vw, 600px);
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    text-align: left;
}
.agent-create-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 14px;
}
.agent-create-textarea {
    font-family: var(--font);
    font-size: 11px;
    line-height: 1.55;
    resize: vertical;
    min-height: 200px;
    tab-size: 4;
}

/* ── Agent file editor modal ───────────────────────────────────────────────── */
.agent-file-modal-content {
    min-width: min(90vw, 600px);
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    text-align: left;
}
.agent-file-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}
.agent-file-textarea {
    font-family: var(--font);
    font-size: 11px;
    line-height: 1.55;
    resize: vertical;
    min-height: 250px;
    tab-size: 4;
}

@media (max-width: 700px) {
    .agent-create-content,
    .agent-file-modal-content {
        min-width: unset;
    }
}