.slms-admin {
	--slms-primary: #2377d2;
	--slms-primary-dark: #276ebb;
	--slms-ink: #1e2422;
	--slms-muted: #667066;
	--slms-border: #dfe6e1;
	--slms-bg-soft: #f2f6f4;

	max-width: 1200px;
	margin: 0 auto 2em;
}

.slms-admin * {
	box-sizing: border-box;
}

.slms-admin__header {
	margin-bottom: 1em;
}

/* Shared with dashboard.css: the logged-out / access-denied screens use
   these same class names. Duplicated here (small, and no !important
   conflicts) so [simple_lms_admin] renders correctly even on a page that
   never also loads [simple_lms_dashboard]'s stylesheet. */

.slms-panel {
	border: 1px solid var(--slms-border);
	border-radius: 14px;
	padding: 2em;
}

.slms-panel--center {
	max-width: 440px;
	margin: 1em auto;
	text-align: center;
}

.slms-panel--center h2 {
	margin: 0 0 0.6em;
}

.slms-admin__tabs {
	display: flex;
	gap: 0.5em;
	border-bottom: 1px solid var(--slms-border);
	margin-bottom: 1.5em;
}

.slms-admin-tab {
	padding: 0.6em 1.1em;
	border: none;
	background: transparent;
	color: var(--slms-muted) !important;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}

.slms-admin-tab--active {
	color: var(--slms-primary) !important;
	border-bottom-color: var(--slms-primary);
}

.slms-admin-description {
	color: var(--slms-muted);
	font-size: 0.85rem;
}

.slms-admin-input {
	width: 100%;
	max-width: 420px;
	padding: 0.5em 0.8em;
	border-radius: 8px;
	border: 1px solid var(--slms-border);
	background: transparent;
	color: inherit;
	font-size: 0.95rem;
	font-family: inherit;
}

.slms-admin-textarea {
	max-width: none;
	resize: vertical;
}

.slms-select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding: 0.5em 2.2em 0.5em 0.9em;
	border-radius: 8px;
	border: 1px solid var(--slms-border);
	background-color: transparent;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23667066' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.7em center;
	background-size: 12px;
	color: inherit;
	cursor: pointer;
}

.slms-admin-toolbar {
	display: flex;
	gap: 0.75em;
	flex-wrap: wrap;
	align-items: center;
	margin-bottom: 1em;
}

.slms-admin-subgrid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5em;
	margin-bottom: 1.5em;
}

.slms-admin-inline-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6em;
	align-items: center;
	margin-bottom: 1em;
}

.slms-admin-btn {
	display: inline-block;
	padding: 0.4em 0.9em;
	border-radius: 999px;
	border: 1px solid var(--slms-border);
	background: transparent;
	color: var(--slms-ink) !important;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.slms-admin-btn:hover {
	border-color: var(--slms-primary);
	color: var(--slms-primary) !important;
}

.slms-admin-btn--danger {
	border-color: #e2a2a2;
	color: #b3261e !important;
}

.slms-admin-btn--danger:hover {
	background: #fdf3f2;
	border-color: #b3261e;
	color: #b3261e !important;
}

.slms-admin-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1em;
}

.slms-admin-table th,
.slms-admin-table td {
	text-align: left;
	padding: 0.7em;
	border-bottom: 1px solid var(--slms-border);
	vertical-align: middle;
	font-size: 0.9rem;
}

.slms-admin-table th {
	color: var(--slms-muted);
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.slms-admin-table__thumb {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 6px;
	display: block;
}

.slms-admin-thumb-preview {
	display: block;
	max-width: 160px;
	max-height: 120px;
	border-radius: 8px;
	margin-bottom: 0.5em;
	object-fit: cover;
}

/* Lesson reordering: drag handle + up/down buttons */

.slms-admin-table__drag-col {
	width: 2em;
}

.slms-admin-drag-handle {
	cursor: grab;
	color: var(--slms-muted);
	font-size: 1.1rem;
	line-height: 1;
	user-select: none;
}

.slms-admin-draggable-row {
	cursor: default;
}

.slms-admin-draggable-row--dragging {
	opacity: 0.4;
}

.slms-admin-reorder-btn {
	border: 1px solid var(--slms-border);
	background: transparent;
	color: var(--slms-ink) !important;
	border-radius: 6px;
	width: 1.6em;
	height: 1.6em;
	line-height: 1;
	cursor: pointer;
	font-size: 0.8rem;
	margin-left: 0.4em;
}

.slms-admin-reorder-btn:hover {
	border-color: var(--slms-primary);
	color: var(--slms-primary) !important;
}

.slms-admin-edit-panel {
	border: 1px solid var(--slms-primary);
	border-radius: 14px;
	padding: 1.5em;
	margin-bottom: 1.5em;
	background: var(--slms-bg-soft);
}

.slms-admin-edit-panel h3 {
	margin-top: 0;
}

.slms-admin-edit-message {
	font-size: 0.85rem;
	color: var(--slms-muted);
	min-height: 1.2em;
}

.slms-btn {
	display: inline-block;
	padding: 0.55em 1.3em;
	border-radius: 999px;
	border: none;
	background: var(--slms-primary);
	color: #fff !important;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	text-decoration: none;
}

.slms-btn:hover {
	background: var(--slms-primary-dark);
	color: #fff !important;
}

.slms-btn--ghost {
	background: transparent;
	color: var(--slms-primary) !important;
	border: 1px solid var(--slms-primary);
}

@media (max-width: 640px) {
	.slms-admin-toolbar,
	.slms-admin-inline-form {
		flex-direction: column;
		align-items: stretch;
	}

	.slms-admin-table {
		display: block;
		overflow-x: auto;
	}
}
