/* ============================================================
   Dash Agents module (.ag-*) — 2026 module-namespaced pattern.
   Shared by /agents, run views, and /agents/skills.
   Card chrome mirrors .pd-card; pills mirror .pos-pill.
   ============================================================ */

.ag-card {
	background: #fff;
	border: 1px solid #ebebeb;
	border-radius: 16px;
	margin-bottom: 16px;
}

.ag-card-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 18px;
	border-bottom: 1px solid #f0f2f4;
	font-size: 15px;
	font-weight: 600;
	color: #303233;
}

.ag-card-header .ag-card-action {
	margin-left: auto;
}

.ag-card-body {
	padding: 16px 18px;
}

/* ---- Tab strip ---- */
.ag-tabs {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.ag-tab {
	background: #fff;
	border: 1px solid #e3e6ea;
	border-radius: 999px;
	padding: 8px 15px;
	font-size: 13px;
	font-weight: 500;
	color: #5a6b7b;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.ag-tab .ag-tab-count {
	background: #eef1f4;
	border-radius: 999px;
	font-size: 11px;
	padding: 1px 7px;
	font-weight: 600;
}

.ag-tab.active {
	background: #003264;
	border-color: #003264;
	color: #fff;
}

.ag-tab.active .ag-tab-count {
	background: rgba(255, 255, 255, 0.22);
	color: #fff;
}

/* ---- Status pills ---- */
.ag-status {
	font-size: 11px;
	font-weight: 600;
	border-radius: 999px;
	padding: 2px 9px;
	white-space: nowrap;
}

.ag-status-on { background: #e7f4ec; color: #198754; }
.ag-status-off { background: #eef1f4; color: #5a6b7b; }
.ag-status-attention { background: #fff3d9; color: #b45309; }
.ag-status-trouble { background: #fdecec; color: #b42020; }

/* ---- Buttons ---- */
.ag-btn {
	background: #0d3b66;
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 9px 15px;
	font-size: 13px;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	white-space: nowrap;
}

.ag-btn:hover { background: #0a2f52; color: #fff; }

.ag-btn-ghost {
	background: #fff;
	color: #5a6b7b;
	border: 1px solid #dfe4e9;
}

.ag-btn-ghost:hover { background: #f7f9fb; color: #303233; }

.ag-btn-keep {
	background: #198754;
}

.ag-btn-keep:hover { background: #146c43; }

/* ---- Skills page: proposal cards ---- */
.ag-proposal {
	border: 1px solid #cfe8d8;
	background: #f6fbf8;
	border-radius: 14px;
	padding: 14px 16px;
	margin-bottom: 12px;
}

.ag-proposal-head {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 13.5px;
	font-weight: 600;
	margin-bottom: 8px;
}

.ag-proposal-head i { color: #1b6b3f; }

.ag-proposal-source {
	font-size: 11.5px;
	color: var(--ed-text-muted);
	font-weight: 400;
	margin-left: auto;
}

.ag-proposal-text {
	font-size: 13px;
	line-height: 1.55;
	color: #3f4a55;
}

.ag-proposal-detail {
	background: #fff;
	border: 1px solid #e6efe9;
	border-radius: 10px;
	padding: 10px 12px;
	margin: 10px 0;
	font-size: 12.5px;
	line-height: 1.6;
	white-space: pre-wrap;
}

.ag-proposal-detail .ag-diff-old { color: #a05252; text-decoration: line-through; }
.ag-proposal-detail .ag-diff-new { color: #1b6b3f; font-weight: 500; }

.ag-proposal-actions {
	display: flex;
	gap: 8px;
	margin-top: 6px;
}

/* ---- Skills page: skill rows ---- */
.ag-skill-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid #f0f2f4;
	font-size: 13.5px;
}

.ag-skill-row:last-child { border-bottom: none; }

.ag-skill-icon {
	width: 32px;
	height: 32px;
	border-radius: 9px;
	background: #e7f0fb;
	color: #003264;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	flex-shrink: 0;
}

.ag-skill-title { font-weight: 600; }

.ag-skill-desc {
	font-size: 12px;
	color: var(--ed-text-muted);
	margin-top: 2px;
}

.ag-skill-meta {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 10px;
	white-space: nowrap;
	font-size: 11.5px;
	color: var(--ed-text-muted);
}

.ag-source-tag {
	border-radius: 999px;
	padding: 2px 8px;
	font-size: 10.5px;
	font-weight: 600;
}

.ag-source-learned { background: #eef7f1; color: #1b6b3f; }
.ag-source-owner { background: #e7f0fb; color: #003264; }

.ag-row-link {
	color: #0d3b66;
	font-size: 12.5px;
	font-weight: 500;
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
}

.ag-row-link.ag-row-link-muted { color: #8a96a3; }

/* ---- Skills page: memory cards ---- */
.ag-memory-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

@media (max-width: 900px) {
	.ag-memory-grid { grid-template-columns: 1fr; }
}

.ag-memory-cap {
	margin-left: auto;
	font-size: 11px;
	font-weight: 400;
	color: var(--ed-text-muted);
}

.ag-memory-textarea {
	width: 100%;
	border: 1px solid #dfe4e9;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.6;
	min-height: 160px;
	resize: vertical;
	font-family: inherit;
	color: #303233;
}

.ag-memory-textarea:focus {
	outline: none;
	border-color: #003264;
}

/* ---- Skills page: history timeline ---- */
.ag-history-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 11px 0;
	border-bottom: 1px solid #f0f2f4;
	font-size: 13px;
}

.ag-history-row:last-child { border-bottom: none; }

.ag-history-when {
	color: var(--ed-text-muted);
	font-size: 12px;
	white-space: nowrap;
	min-width: 90px;
}

/* ---- Chips (shared) ---- */
.ag-chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: #f0f4f8;
	border: 1px solid #e3e6ea;
	border-radius: 999px;
	padding: 3px 11px;
	font-size: 12px;
	font-weight: 500;
	color: #33526f;
	white-space: nowrap;
}

/* ---- Empty states ---- */
.ag-empty-tab {
	text-align: center;
	padding: 44px 20px;
	color: var(--ed-text-muted);
}

.ag-empty-tab i {
	font-size: 28px;
	margin-bottom: 10px;
	display: block;
	color: #aab5bf;
}

.ag-empty-tab .ag-empty-title {
	font-size: 15px;
	font-weight: 600;
	color: #303233;
	margin-bottom: 4px;
}

.ag-empty-inline {
	color: var(--ed-text-muted);
	font-size: 13px;
	padding: 10px 0;
}

/* ---- Home: "Waiting for your OK" approval inbox ---- */
.ag-okbox {
	background: #fff8ec;
	border: 1px solid #f3dfb6;
	border-radius: 14px;
	padding: 14px 16px;
}

.ag-okbox-head {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	font-size: 14px;
	color: #b45309;
	margin-bottom: 6px;
}

.ag-okbox-count {
	background: #b45309;
	color: #fff;
	border-radius: 999px;
	font-size: 11px;
	padding: 1px 8px;
}

.ag-okrow {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-top: 1px solid #f3e8cf;
	font-size: 13.5px;
	flex-wrap: wrap;
}

.ag-okrow-what {
	flex: 1;
	min-width: 220px;
}

.ag-okrow-from {
	color: var(--ed-text-muted);
	font-size: 12px;
	white-space: nowrap;
}

.ag-okrow-actions {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-shrink: 0;
}

/* ---- Home: "Dash picked something up" banner ---- */
.ag-learnbox {
	background: #eef7f1;
	border: 1px solid #cfe8d8;
	border-radius: 14px;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 13.5px;
	flex-wrap: wrap;
}

.ag-learnbox-icon {
	width: 34px;
	height: 34px;
	border-radius: 10px;
	background: #d8eee0;
	color: #1b6b3f;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	flex-shrink: 0;
}

.ag-learnbox-link {
	margin-left: auto;
	color: #1b6b3f;
	font-weight: 600;
	font-size: 12.5px;
	white-space: nowrap;
	text-decoration: none;
}

.ag-learnbox-link:hover { color: #14522f; }

/* ---- Home: shortcut cards (Dash Skills + Connected apps) ---- */
.ag-shortcut-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

/* Only Dash Skills shows (no integrations permission) — don't leave a gap. */
.ag-shortcut-row-single { grid-template-columns: 1fr; }

@media (max-width: 900px) {
	.ag-shortcut-row { grid-template-columns: 1fr; }
}

.ag-shortcut {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	border: 1px solid #ebebeb;
	border-radius: 14px;
	padding: 14px 16px;
	text-decoration: none;
	color: inherit;
	transition: box-shadow 0.2s, transform 0.2s;
}

.ag-shortcut:hover {
	color: inherit;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
	transform: translateY(-1px);
}

.ag-shortcut-icon {
	width: 38px;
	height: 38px;
	border-radius: 11px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 17px;
	flex-shrink: 0;
}

.ag-shortcut-icon-skills { background: #eef7f1; color: #1b6b3f; }
.ag-shortcut-icon-apps { background: #e7f0fb; color: #003264; }

.ag-shortcut-body { flex: 1; min-width: 0; }

.ag-shortcut-title {
	font-size: 14px;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.ag-shortcut-count {
	background: #198754;
	color: #fff;
	border-radius: 999px;
	font-size: 10.5px;
	padding: 2px 8px;
	font-weight: 600;
}

.ag-shortcut-sub {
	font-size: 12px;
	color: var(--ed-text-muted);
	margin-top: 3px;
}

.ag-shortcut-chips {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	margin-top: 5px;
}

.ag-shortcut-chevron {
	font-size: 12px;
	color: #aab5bf;
	flex-shrink: 0;
}

/* ---- Home: build-your-agent CTA (moved from an inline style block) ---- */
.btn-build-agent {
	background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
	border: none;
	color: #fff;
	border-radius: 12px;
	padding: 8px 20px;
	font-size: 14px;
	transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-build-agent:hover:not(:disabled) {
	opacity: 0.88;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
	color: #fff;
}

.btn-build-agent:active:not(:disabled) {
	transform: translateY(0);
	box-shadow: none;
}

.btn-build-agent:disabled {
	opacity: 0.55;
	color: #fff;
}

/* ---- Run timeline: thought + condensation nodes ---- */
.ag-thought {
	color: #7b8794;
	font-style: italic;
	font-size: 12.5px;
	line-height: 1.5;
}

.ag-cost-note {
	background: #e7f0fb;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 12.5px;
	color: #33526f;
}

.ag-cost-note b { color: #003264; }

/* ---- Form bits (playbook editor) ---- */
.ag-input {
	width: 100%;
	border: 1px solid #dfe4e9;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 13.5px;
	color: #303233;
	background: #fff;
}

.ag-input:focus {
	outline: none;
	border-color: #003264;
}

.ag-label {
	font-size: 12.5px;
	font-weight: 600;
	margin-bottom: 6px;
	display: block;
	color: #303233;
}

.ag-form-row { margin-bottom: 12px; }
