/* S4 Project Launch — Admin CSS */
:root {
	--s4-primary: #2563eb;
	--s4-primary-dark: #1d4ed8;
	--s4-sidebar-bg: #1e293b;
	--s4-sidebar-text: #94a3b8;
	--s4-sidebar-active: #fff;
	--s4-sidebar-width: 240px;
}

body {
	font-family: "Inter", system-ui, sans-serif;
	background: #f1f5f9;
}

/* ── Sidebar ── */
#sidebar {
	width: var(--s4-sidebar-width);
	min-height: 100vh;
	background: var(--s4-sidebar-bg);
	position: fixed;
	top: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	z-index: 100;
}
#sidebar .sidebar-brand {
	padding: 1.5rem 1.25rem 1rem;
	color: #fff;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	text-decoration: none;
}
#sidebar .sidebar-brand span {
	color: var(--s4-primary);
}
#sidebar .nav-link {
	color: var(--s4-sidebar-text);
	padding: 0.6rem 1.25rem;
	border-radius: 0;
	font-size: 0.875rem;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	transition: background 0.15s, color 0.15s;
}
#sidebar .nav-link:hover,
#sidebar .nav-link.active {
	color: var(--s4-sidebar-active);
	background: rgba(255, 255, 255, 0.07);
}
#sidebar .nav-link i {
	width: 18px;
	text-align: center;
}

#sidebar .sidebar-footer {
	margin-top: auto;
	padding: 1rem 1.25rem;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Main content ── */
#main-content {
	margin-left: var(--s4-sidebar-width);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.topbar {
	background: #fff;
	border-bottom: 1px solid #e2e8f0;
	padding: 0.75rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: sticky;
	top: 0;
	z-index: 99;
}
.topbar .page-title {
	font-size: 1rem;
	font-weight: 600;
	color: #0f172a;
	margin: 0;
}

.page-body {
	padding: 1.5rem;
	flex: 1;
}

/* ── Cards ── */
.s4-card {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 0.5rem;
	padding: 1.5rem;
}

/* ── Status badges ── */
.badge-draft {
	background: #e2e8f0;
	color: #475569;
}
.badge-active {
	background: #dbeafe;
	color: #1d4ed8;
}
.badge-completed {
	background: #dcfce7;
	color: #16a34a;
}

/* ── Progress bar ── */
.progress {
	height: 8px;
	border-radius: 99px;
}

/* ── Task editor ── */
.task-card {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 0.5rem;
	margin-bottom: 0.75rem;
	overflow: hidden;
}
.task-card .task-header {
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	padding: 0.75rem 1rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	cursor: grab;
}
.task-card .task-header:active {
	cursor: grabbing;
}
.task-card .task-body {
	padding: 1rem;
}

.instruction-box {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 0.5rem;
	padding: 0.85rem;
}

.instruction-step-row {
	display: flex;
	gap: 0.5rem;
	align-items: flex-start;
	margin-bottom: 0.5rem;
	padding: 0.6rem;
	border: 1px solid #e2e8f0;
	border-radius: 0.4rem;
	background: #fff;
}

.instruction-step-row:last-child {
	margin-bottom: 0;
}

.instruction-step-content {
	flex: 1;
}

.instruction-format-toolbar .btn {
	font-size: 0.75rem;
	line-height: 1.1;
}

.instruction-step-description p {
	margin-bottom: 0.35rem;
}

.instruction-step-description p:last-child {
	margin-bottom: 0;
}

.instruction-step-description ul {
	margin-bottom: 0.35rem;
	padding-left: 1rem;
}

.instruction-step-description ul:last-child {
	margin-bottom: 0;
}

.resource-file-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem;
	border: 1px solid #e2e8f0;
	border-radius: 0.4rem;
	background: #fff;
	margin-bottom: 0.45rem;
}

.resource-file-row:last-child {
	margin-bottom: 0;
}

.resource-file-meta {
	flex: 1;
	min-width: 180px;
}

.field-row {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 0.375rem;
	padding: 0.75rem;
	margin-bottom: 0.5rem;
	display: flex;
	gap: 0.5rem;
	align-items: flex-start;
	flex-wrap: wrap;
}

.field-drag-handle {
	width: 24px;
	min-height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #94a3b8;
	cursor: grab;
	user-select: none;
}

.field-drag-handle:active {
	cursor: grabbing;
}

.sortable-ghost {
	opacity: 0.55;
}

.sortable-chosen {
	box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

/* ── Client layout ── */
.client-layout {
	display: grid;
	grid-template-columns: 280px 1fr;
	min-height: 100vh;
}
.client-sidebar {
	background: var(--s4-sidebar-bg);
	padding: 1.5rem 1rem;
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
}
.client-sidebar .brand {
	color: #fff;
	font-weight: 700;
	margin-bottom: 1.5rem;
	display: block;
}
.client-sidebar .task-link {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.6rem 0.75rem;
	border-radius: 0.375rem;
	color: var(--s4-sidebar-text);
	text-decoration: none;
	font-size: 0.875rem;
	margin-bottom: 0.25rem;
	transition: background 0.15s, color 0.15s;
}
.client-sidebar .task-link:hover {
	background: rgba(255, 255, 255, 0.07);
	color: #fff;
}
.client-sidebar .task-link.active {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}
.client-sidebar .task-link.done {
	color: #4ade80;
}
.client-sidebar .task-link.skipped {
	color: #94a3b8;
	text-decoration: line-through;
}

.client-main {
	padding: 2rem;
	max-width: 760px;
}

.instruction-check-row {
	padding: 0.4rem 0.5rem 0.4rem 2rem;
	border: 1px solid #e2e8f0;
	border-radius: 0.4rem;
	background: #fff;
}

.task-status-icon {
	font-size: 1rem;
}

/* ── Utility ── */
.cursor-move {
	cursor: move;
}
.btn-icon {
	padding: 0.25rem 0.5rem;
	line-height: 1;
}

@media (max-width: 992px) {
	#sidebar {
		position: static;
		width: 100%;
		min-height: auto;
	}

	#main-content {
		margin-left: 0;
	}

	.client-layout {
		grid-template-columns: 1fr;
	}

	.client-sidebar {
		position: static;
		height: auto;
	}

	.client-main {
		max-width: none;
		padding: 1.25rem;
	}
}

.client-sidebar .text-muted {
	color: #eaeaea !important;
}
