:root {
	--ink: #0f172a;
	--muted: #64748b;
	--line: #e2e8f0;
	--paper: #ffffff;
	--soft: #f8fafc;
	--teal: #059669; /* emerald-600 */
	--gold: #f59e0b;
	--red: #ef4444;
	--blue: #3b82f6;
	--radius: 12px;
	--radius-sm: 8px;
	--shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
	--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: Inter, "Segoe UI", Arial, sans-serif;
	color: var(--ink);
	background: var(--soft);
	line-height: 1.5;
}

a {
	color: inherit;
	text-decoration: none;
}

button,
input,
textarea,
select {
	font: inherit;
}

img {
	max-width: 100%;
	display: block;
}

.login-page {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 24px;
	background:
		linear-gradient(120deg, rgba(15, 118, 110, .86), rgba(37, 99, 235, .5)),
		url('../img/school-hero.png') center / cover;
}

.login-panel {
	width: min(420px, 100%);
	padding: 30px;
	border-radius: var(--radius);
	background: rgba(255, 255, 255, .95);
	box-shadow: var(--shadow);
}

.login-panel img {
	width: 70px;
	height: 70px;
	object-fit: contain;
	border-radius: 50%;
	border: 1px solid var(--line);
	margin-bottom: 18px;
}

.login-panel h1 {
	margin: 0;
	font-size: 26px;
}

.login-panel p {
	margin: 4px 0 20px;
	color: var(--muted);
}

.login-panel form,
.form-panel {
	display: grid;
	gap: 16px;
}

.login-panel label,
.form-panel label {
	display: grid;
	gap: 7px;
	font-weight: 800;
}

.login-panel input,
.form-panel input,
.form-panel textarea,
.form-panel select {
	width: 100%;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 11px 12px;
	background: #fff;
	color: var(--ink);
	outline: none;
}

.login-panel textarea,
.form-panel textarea {
	resize: vertical;
}

.login-panel button {
	min-height: 44px;
	border: 0;
	border-radius: var(--radius);
	background: var(--teal);
	color: #fff;
	font-weight: 900;
	cursor: pointer;
}

.login-panel small {
	display: block;
	margin-top: 16px;
	color: var(--muted);
}

.admin-body {
	min-height: 100vh;
	display: grid;
	grid-template-columns: 270px minmax(0, 1fr);
}

.admin-sidebar {
	position: sticky;
	top: 0;
	height: 100vh;
	padding: 20px 16px;
	background: #1e293b; /* slate-800 */
	color: #cbd5e1;
	overflow-y: auto;
	box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}

.admin-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	color: #fff;
}

.admin-brand img {
	width: 48px;
	height: 48px;
	object-fit: contain;
	border-radius: 50%;
	background: #fff;
}

.admin-brand strong,
.admin-brand small {
	display: block;
}

.admin-brand small {
	color: #cbd5e1;
	font-size: 12px;
}

.admin-menu {
	display: grid;
	gap: 4px;
	margin-top: 24px;
}

.admin-menu a {
	padding: 12px 16px;
	border-radius: var(--radius-sm);
	color: #94a3b8;
	font-weight: 600;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	gap: 10px;
}

.admin-menu a:hover {
	background: #334155;
	color: #f8fafc;
	transform: translateX(4px);
}

.admin-menu a.active {
	background: var(--teal);
	color: #fff;
	box-shadow: 0 4px 6px -1px rgba(5, 150, 105, 0.4);
}

.admin-shell {
	min-width: 0;
}

.admin-top {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 72px;
	padding: 0 32px;
	background: rgba(255, 255, 255, .85);
	border-bottom: 1px solid var(--line);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
}

.admin-top strong,
.admin-top span {
	display: block;
}

.admin-top span {
	color: var(--muted);
	font-size: 13px;
}

.admin-top nav {
	display: flex;
	gap: 10px;
	align-items: center;
}

.admin-top nav a,
.sidebar-toggle,
.admin-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 18px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: #fff;
	color: var(--ink);
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.admin-top nav a.danger,
.actions .danger {
	color: var(--red);
}

.sidebar-toggle {
	display: none;
}

.admin-main {
	padding: 28px;
}

.admin-alert {
	margin-bottom: 18px;
	padding: 13px 16px;
	border-radius: var(--radius);
	font-weight: 800;
}

.admin-alert.success {
	background: #ecfdf5;
	color: #047857;
	border: 1px solid #a7f3d0;
}

.admin-alert.error {
	background: #fff1f2;
	color: #be123c;
	border: 1px solid #fecdd3;
}

.stat-grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 16px;
	margin-bottom: 22px;
}

.stat-card,
.panel {
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: #fff;
	box-shadow: var(--shadow);
	transition: box-shadow 0.2s ease;
}

.panel:hover {
	box-shadow: var(--shadow-lg);
}

.stat-card {
	padding: 18px;
}

.stat-card span {
	display: block;
	color: var(--muted);
	font-weight: 800;
	font-size: 13px;
}

.stat-card strong {
	display: block;
	margin-top: 8px;
	font-size: 30px;
	line-height: 1;
}

.admin-grid {
	display: grid;
	gap: 20px;
}

.admin-grid.two {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-grid.two.uneven {
	grid-template-columns: 360px minmax(0, 1fr);
	align-items: start;
}

.panel {
	padding: 20px;
}

.panel-head,
.page-actions,
.form-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.panel-head h2,
.form-panel h2 {
	margin: 0;
	font-size: 20px;
}

.panel-head a {
	color: var(--teal);
	font-weight: 900;
}

.page-actions {
	justify-content: flex-end;
}

.admin-btn.primary {
	border-color: var(--teal);
	background: var(--teal);
	color: #fff;
}

.admin-btn:hover,
.admin-top nav a:hover {
	box-shadow: var(--shadow);
}

.table-wrap {
	width: 100%;
	overflow-x: auto;
}

table {
	width: 100%;
	border-collapse: collapse;
}

th,
td {
	padding: 16px 14px;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
	font-size: 14px;
}

th {
	color: #475569;
	font-size: 12px;
	text-transform: uppercase;
}

td small {
	display: block;
	color: var(--muted);
	margin-top: 3px;
}

.actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	font-weight: 900;
}

.actions a {
	color: var(--blue);
}

.badge {
	display: inline-flex;
	align-items: center;
	min-height: 26px;
	padding: 0 9px;
	border-radius: 999px;
	background: #e2e8f0;
	color: #334155;
	font-size: 12px;
	font-weight: 900;
	text-transform: uppercase;
}

.badge.published,
.badge.approved {
	background: #dcfce7;
	color: #166534;
}

.badge.draft,
.badge.pending {
	background: #fef3c7;
	color: #92400e;
}

.badge.rejected {
	background: #fee2e2;
	color: #991b1b;
}

.message-preview {
	padding: 13px 0;
	border-bottom: 1px solid var(--line);
}

.message-preview.unread {
	border-left: 4px solid var(--gold);
	padding-left: 10px;
}

.message-preview strong,
.message-preview span {
	display: block;
}

.message-preview span,
.message-preview p {
	color: var(--muted);
	font-size: 13px;
}

.message-preview p {
	margin: 5px 0 0;
}

.form-panel {
	max-width: 980px;
}

.form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.check-field {
	display: flex !important;
	align-items: center;
	gap: 10px;
	align-self: end;
	min-height: 45px;
}

.check-field input {
	width: auto;
}

.preview {
	width: 220px;
	max-height: 150px;
	object-fit: cover;
	border-radius: var(--radius);
	border: 1px solid var(--line);
}

.preview.wide {
	width: 420px;
	max-height: 220px;
}

.logo-preview {
	width: 90px;
	height: 90px;
	object-fit: contain;
	background: #fff;
}

.with-thumb {
	display: grid;
	grid-template-columns: 76px minmax(0, 1fr);
	gap: 12px;
	align-items: center;
}

.with-thumb img {
	width: 76px;
	height: 58px;
	object-fit: cover;
	border-radius: 6px;
	background: #e2e8f0;
}

.color-dot {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	margin-right: 8px;
}

@media (max-width: 1100px) {
	.stat-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.admin-grid.two,
	.admin-grid.two.uneven {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 820px) {
	.admin-body {
		grid-template-columns: 1fr;
	}

	.admin-sidebar {
		position: fixed;
		z-index: 30;
		left: 0;
		top: 0;
		bottom: 0;
		width: 270px;
		transform: translateX(-100%);
		transition: transform .2s ease;
	}

	.admin-sidebar.open {
		transform: translateX(0);
	}

	.sidebar-toggle {
		display: inline-flex;
	}

	.admin-top {
		padding: 0 16px;
	}

	.admin-top nav {
		display: none;
	}

	.admin-main {
		padding: 18px 16px;
	}

	.stat-grid,
	.form-grid {
		grid-template-columns: 1fr;
	}

	.with-thumb {
		grid-template-columns: 1fr;
	}
}
