/* ─── Projects Page Refresh ─── */

.project-info-row {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	flex-wrap: wrap;
}

.project-toggle {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	background: none;
	border: none;
	font: inherit;
	color: inherit;
	cursor: pointer;
	padding: var(--space-2);
	border-radius: var(--radius-md);
	flex: 1;
	justify-content: flex-start;
	min-width: 0;
}

.project-toggle > div {
	min-width: 0;
	flex: 1;
}

.project-toggle h3 {
	margin: 0;
	font-size: var(--font-size-lg);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.project-actions {
	margin-left: auto;
	flex-shrink: 0;
}

.project-toggle:hover {
	background: var(--bg);
}

.project-toggle h3 {
	margin: 0;
	font-size: var(--font-size-lg);
}

.repo-count {
	font-size: var(--font-size-xs);
	padding: var(--space-1) var(--space-2);
	background: var(--bg);
	border-radius: 999px;
	color: var(--muted);
}

.project-detail {
	margin-top: var(--space-4);
	padding-top: var(--space-4);
	border-top: 1px solid var(--border);
}

.project-repos {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
}

.project-repos-header {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: var(--space-3);
}

.project-repos-header .btn {
	margin-left: var(--space-2);
}

.project-repos-header .config-section-title {
	margin-bottom: 0;
}

.repo-list {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
}

.repo-block {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	background: var(--bg);
}

.repo-block,
.repo-block.card-md {
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
}

.repo-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--space-3);
	flex-wrap: wrap;
}

.repo-header h4 {
	margin: 0;
	font-size: var(--font-size-base);
}

.workspace-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: var(--space-3);
}

.workspace-chip {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	padding: var(--space-3);
	font-size: var(--font-size-sm);
	border-radius: var(--radius-md);
}

.workspace-chip,
.workspace-chip.card-sm {
	background: var(--panel);
	border: 1px solid var(--border);
}

.workspace-chip a {
	font-weight: 600;
	color: var(--brand);
}

.workspace-chip .ws-branch {
	color: var(--muted);
	font-size: var(--font-size-xs);
}

.workspace-chip .ws-instances {
	font-size: var(--font-size-xs);
	color: var(--success);
}

.workspace-chip .ws-actions {
	display: flex;
	gap: var(--space-1);
	margin-top: var(--space-1);
}

.workspace-chip .ws-actions button {
	background: none;
	border: none;
	color: var(--muted);
	cursor: pointer;
	padding: var(--space-1);
	border-radius: 4px;
}

.workspace-chip .ws-actions button:hover {
	background: var(--bg);
	color: var(--ink);
}

.workspace-chip .ws-actions button.danger-text:hover {
	color: var(--danger);
}

.project-add-repo-card {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-3);
	background: transparent;
	color: var(--muted);
	border-style: dashed;
	cursor: pointer;
	min-height: 120px;
}

.project-add-repo-card:hover {
	background: var(--bg);
	color: var(--ink);
	border-color: var(--brand);
}

.project-add-repo-card .project-repo-name {
	font-weight: 500;
	white-space: normal;
	text-align: center;
}

@media (max-width: 767px) {
	.project-repos-header {
		flex-direction: column;
		gap: var(--space-2);
	}
}

/* ─── New Project Pane List Layout ─── */
.project-list {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
}

.project-list-item {
	display: flex;
	flex-direction: column;
	gap: var(--space-4);
	padding: var(--space-4);
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
}

.project-list-item-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--space-3);
}

.project-list-item-title h3 {
	margin: 0;
	font-size: var(--font-size-lg);
}

.project-list-item-title p {
	margin: var(--space-1) 0 0;
}

.project-list-item-actions {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	flex-shrink: 0;
}

.project-repo-list {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: var(--space-3);
}

.project-repo-item {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	min-width: 260px;
	max-width: 320px;
	flex: 1 1 260px;
	padding: var(--space-3);
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
}

.project-repo-item-header {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	padding-bottom: var(--space-2);
	border-bottom: 1px solid var(--border);
}

.project-repo-name {
	font-weight: 600;
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.project-repo-branch {
	display: inline-flex;
	align-items: center;
	gap: var(--space-1);
	font-size: var(--font-size-xs);
	color: var(--muted);
}

.project-repo-workspaces {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
}

.project-repo-workspace {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
}

.workspace-name {
	font-weight: 500;
	color: var(--brand);
}

.workspace-name:hover {
	text-decoration: underline;
}

.workspace-tool-list {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	margin: 0;
	padding: 0;
	list-style: none;
}

.workspace-tool-link {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	padding: var(--space-1) var(--space-2);
	border-radius: var(--radius-md);
	background: var(--panel);
	border: 1px solid var(--border);
	color: var(--ink);
	font-size: var(--font-size-sm);
	text-decoration: none;
}

.workspace-tool-link:hover {
	background: var(--bg);
}

.session-status-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--muted);
}

.session-status-dot.running {
	background: var(--success);
}

.tool-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Inline radio buttons for repository creation mode */
.repo-mode-radios {
	display: flex;
	gap: var(--space-4);
	flex-wrap: wrap;
	padding: var(--space-2) 0;
}

.repo-mode-label {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-size: var(--font-size-sm);
	font-weight: 500;
	cursor: pointer;
	color: var(--ink);
}

.repo-mode-label input[type="radio"] {
	width: 18px;
	height: 18px;
	accent-color: var(--brand);
	margin: 0;
}
