/* School Management System - app styles
   Modern blue, Noto Sans Bengali, mobile-first (app-like on phones), light animation. */

/* ---- Font (put the two files in assets/fonts/, see README) -------------------- */
@font-face {
	font-family: 'Noto Sans Bengali';
	font-weight: 400;
	font-style: normal;
	font-display: swap;
	src: local('Noto Sans Bengali'), url('../fonts/NotoSansBengali-Regular.woff2') format('woff2');
}
@font-face {
	font-family: 'Noto Sans Bengali';
	font-weight: 600;
	font-style: normal;
	font-display: swap;
	src: local('Noto Sans Bengali SemiBold'), url('../fonts/NotoSansBengali-SemiBold.woff2') format('woff2');
}

/* ---- Design tokens (change colors here only) -------------------------------- */
:root {
	--primary: #2563EB;
	--primary-dark: #1E40AF;
	--primary-light: #DBEAFE;
	--bg: #F8FAFC;
	--surface: #FFFFFF;
	--text: #0F172A;
	--muted: #64748B;
	--border: #E2E8F0;
	--success: #16A34A;
	--warning: #D97706;
	--danger: #DC2626;
	--radius: 12px;
	--radius-sm: 8px;
	--topbar-h: 56px;
	--nav-h: 64px;
	--sidebar-w: 248px;
	--sat: env(safe-area-inset-top, 0px);
	--sab: env(safe-area-inset-bottom, 0px);
	--font: 'Noto Sans Bengali', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.sms-app {
	margin: 0;
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.6;
	color: var(--text);
	background: var(--bg);
	-webkit-tap-highlight-color: transparent;
	overscroll-behavior-y: none;
}
.sms-app a { color: var(--primary); text-decoration: none; }
.sms-app a:hover { color: var(--primary-dark); }
.sms-app :focus-visible { outline: 3px solid var(--primary-light); outline-offset: 2px; border-radius: 6px; }
.sms-icon { display: block; flex: none; }
.sms-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sms-h2 { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.4; }
.sms-h3 { margin: 0 0 12px; font-size: 18px; font-weight: 600; line-height: 1.4; }
.sms-muted { margin: 0; color: var(--muted); font-size: 14px; }

/* ---- Loading animation ------------------------------------------------------- */
.sms-loader {
	position: fixed; inset: 0; z-index: 1000;
	display: flex; align-items: center; justify-content: center;
	background: #fff;
	opacity: 1; visibility: visible;
	transition: opacity .25s ease, visibility .25s ease;
}
.sms-loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.sms-spinner {
	position: relative; width: 64px; height: 64px;
	display: flex; align-items: center; justify-content: center;
	color: var(--primary);
}
.sms-spinner::before {
	content: ''; position: absolute; inset: 0;
	border: 5px solid var(--primary-light); border-top-color: var(--primary);
	border-radius: 50%; animation: sms-turn .9s linear infinite;
}
@keyframes sms-turn { to { transform: rotate(360deg); } }

.sms-skeleton {
	background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
	background-size: 200% 100%; border-radius: 6px;
	animation: sms-shine 1.4s ease-in-out infinite;
}
@keyframes sms-shine { to { background-position: -200% 0; } }

/* ---- Shell: MOBILE (app style) ----------------------------------------------- */
.sms-shell { min-height: 100vh; }
.sms-sidebar { display: none; }

.sms-topbar {
	position: fixed; top: 0; left: 0; right: 0; z-index: 50;
	height: calc(var(--topbar-h) + var(--sat)); padding: var(--sat) 16px 0;
	display: flex; align-items: center; gap: 10px;
	background: var(--primary); color: #fff;
}
.sms-topbar__mark {
	width: 32px; height: 32px; border-radius: 8px; flex: none;
	display: flex; align-items: center; justify-content: center;
	background: rgba(255, 255, 255, .18);
}
.sms-topbar__title { margin: 0; flex: 1; min-width: 0; font-size: 18px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sms-topbar__right { display: flex; align-items: center; gap: 10px; }
.sms-topbar__lang { display: none; }
.sms-user { display: flex; align-items: center; gap: 8px; }
.sms-user__avatar {
	width: 32px; height: 32px; border-radius: 50%; flex: none;
	display: flex; align-items: center; justify-content: center;
	background: #fff; color: var(--primary-dark); font-weight: 600; font-size: 14px;
}
.sms-user__name { display: none; }

.sms-content {
	padding: calc(var(--topbar-h) + var(--sat) + 16px) 16px calc(var(--nav-h) + var(--sab) + 24px);
	display: flex; flex-direction: column; gap: 16px;
	animation: sms-rise .2s ease both;
}
@keyframes sms-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Fixed bottom navbar (like a mobile app) */
.sms-bottomnav {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
	height: calc(var(--nav-h) + var(--sab)); padding-bottom: var(--sab);
	display: flex; background: var(--surface);
	border-top: 1px solid var(--border);
	box-shadow: 0 -2px 12px rgba(15, 23, 42, .06);
}
.sms-bottomnav__item {
	flex: 1; min-width: 0; border: 0; background: transparent; cursor: pointer; font-family: inherit;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
	color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.2;
	transition: color .15s ease, transform .15s ease;
}
.sms-bottomnav__item:active { transform: scale(.94); }
.sms-bottomnav__icon {
	width: 52px; height: 30px; border-radius: 15px;
	display: flex; align-items: center; justify-content: center;
	transition: background-color .2s ease, color .2s ease;
}
.sms-bottomnav__label { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sms-app .sms-bottomnav__item.is-active { color: var(--primary); }
.sms-bottomnav__item.is-active .sms-bottomnav__icon { background: var(--primary-light); }

/* "More" bottom sheet */
.sms-sheet { position: fixed; inset: 0; z-index: 70; visibility: hidden; }
.sms-sheet.is-open { visibility: visible; }
.sms-sheet__overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); opacity: 0; transition: opacity .2s ease; }
.sms-sheet.is-open .sms-sheet__overlay { opacity: 1; }
.sms-sheet__panel {
	position: absolute; left: 0; right: 0; bottom: 0;
	max-height: 85vh; overflow-y: auto;
	padding: 8px 16px calc(16px + var(--sab));
	background: var(--surface); border-radius: 20px 20px 0 0;
	transform: translateY(100%); transition: transform .25s ease;
}
.sms-sheet.is-open .sms-sheet__panel { transform: none; }
.sms-sheet__grip { width: 40px; height: 4px; margin: 4px auto 12px; border-radius: 2px; background: var(--border); }
.sms-sheet__user { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.sms-sheet__user .sms-user__avatar { background: var(--primary-light); width: 44px; height: 44px; font-size: 18px; }
.sms-sheet__user small { color: var(--muted); }
.sms-sheet__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 16px 0; }
.sms-sheet__grid a {
	display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px;
	border-radius: var(--radius); color: var(--text); font-size: 13px; font-weight: 600; text-align: center; line-height: 1.3;
	transition: background-color .15s ease;
}
.sms-sheet__grid a:active, .sms-sheet__grid a.is-active { background: var(--primary-light); }
.sms-sheet__icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--primary); }
.sms-sheet__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* Language switch */
.sms-lang { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
.sms-lang a { padding: 4px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); transition: background-color .15s ease, color .15s ease; }
.sms-lang a.is-active { background: var(--primary-light); color: var(--primary-dark); }

/* ---- Components -------------------------------------------------------------- */
.sms-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.sms-card--hello { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sms-grid { display: grid; gap: 12px; }
.sms-grid--stats { grid-template-columns: repeat(2, 1fr); }
.sms-stat { display: flex; flex-direction: column; gap: 2px; }
.sms-stat__icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--primary-light); color: var(--primary-dark); margin-bottom: 6px; }
.sms-stat__num { font-size: 28px; font-weight: 600; line-height: 1.2; }
.sms-stat__label { color: var(--muted); font-size: 14px; }
.sms-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.sms-steps a { font-weight: 600; }
.sms-empty, .sms-message { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 16px; }
.sms-empty__icon { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--primary-light); color: var(--primary); }

.sms-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
	font-family: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
	transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.sms-btn:active { transform: scale(.98); }
.sms-btn--primary { background: var(--primary); color: #fff; }
.sms-app .sms-btn--primary:hover { background: var(--primary-dark); color: #fff; }
.sms-btn--secondary { background: #fff; color: var(--primary-dark); border-color: var(--primary); }
.sms-app .sms-btn--secondary:hover { background: var(--primary-light); }
.sms-btn--danger { background: var(--danger); color: #fff; }
.sms-btn.is-loading { position: relative; color: transparent; pointer-events: none; }
.sms-btn.is-loading::after {
	content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
	border: 3px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: sms-turn .8s linear infinite;
}
.sms-btn--secondary.is-loading::after { border-color: var(--primary-light); border-top-color: var(--primary); }

.sms-badge { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.sms-badge--primary { background: var(--primary-light); color: var(--primary-dark); }
.sms-badge--success { background: #DCFCE7; color: #166534; }
.sms-badge--warning { background: #FEF3C7; color: #92400E; }
.sms-badge--danger { background: #FEE2E2; color: #991B1B; }

.sms-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.sms-field label { font-size: 14px; font-weight: 600; }
.sms-field input, .sms-field select, .sms-field textarea {
	width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
	font-family: inherit; font-size: 16px; color: var(--text); background: #fff;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.sms-field input:focus, .sms-field select:focus, .sms-field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.sms-field .sms-error { color: var(--danger); font-size: 14px; }

/* Tables: scroll on desktop, turn into cards on phones (add data-label to each td) */
.sms-table-wrap { overflow-x: auto; }
.sms-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.sms-table th { text-align: left; padding: 10px 12px; font-size: 14px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); background: var(--bg); }
.sms-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.sms-table tbody tr:hover { background: var(--primary-light); }
@media (max-width: 767px) {
	.sms-table thead { display: none; }
	.sms-table, .sms-table tbody, .sms-table tr, .sms-table td { display: block; width: 100%; }
	.sms-table tr { margin-bottom: 12px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
	.sms-table td { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border: 0; text-align: right; }
	.sms-table td::before { content: attr(data-label); color: var(--muted); font-size: 14px; font-weight: 600; text-align: left; }
}

/* Stand-alone message page */
.sms-message-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.sms-message-page .sms-message { width: 100%; max-width: 420px; padding: 32px 24px; }

/* ---- TABLET / DESKTOP: sidebar layout --------------------------------------- */
@media (min-width: 768px) {
	.sms-bottomnav, .sms-sheet { display: none; }

	.sms-sidebar {
		position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; width: var(--sidebar-w);
		display: flex; flex-direction: column; padding: 16px 12px;
		background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto;
	}
	.sms-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
	.sms-brand__mark { width: 36px; height: 36px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; }
	.sms-brand__name { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
	.sms-sidenav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
	.sms-sidenav a, .sms-sidenav__logout {
		display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
		border-radius: var(--radius-sm); color: var(--text); font-weight: 600; font-size: 15px;
		transition: background-color .15s ease, color .15s ease;
	}
	.sms-sidenav a:hover, .sms-sidenav__logout:hover { background: var(--bg); color: var(--text); }
	.sms-sidenav a.is-active { background: var(--primary-light); color: var(--primary-dark); }
	.sms-sidenav__logout { color: var(--muted); }

	.sms-main { margin-left: var(--sidebar-w); }
	.sms-topbar {
		position: sticky; top: 0; height: 64px; padding: 0 24px;
		background: var(--surface); color: var(--text); border-bottom: 1px solid var(--border);
	}
	.sms-topbar__mark { display: none; }
	.sms-topbar__title { font-size: 20px; }
	.sms-topbar__lang { display: block; }
	.sms-user__name { display: inline; font-size: 14px; font-weight: 600; }
	.sms-user__avatar { background: var(--primary-light); }

	.sms-content { padding: 24px; max-width: 1100px; }
	.sms-grid--stats { grid-template-columns: repeat(4, 1fr); }
}

/* ---- Reduced motion ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.sms-app *, .sms-app *::before, .sms-app *::after { animation: none !important; transition: none !important; }
}

/* ---- Login and registration ---------------------------------------------------- */
.sms-auth { min-height: 100vh; display: flex; flex-direction: column; }
.sms-auth__brand {
	padding: calc(20px + var(--sat)) 20px 56px; background: var(--primary-dark); color: #fff;
	display: flex; flex-direction: column; gap: 12px;
}
.sms-auth__logo { display: flex; align-items: center; gap: 12px; }
.sms-auth__mark { width: 44px; height: 44px; border-radius: 10px; background: #fff; color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
.sms-auth__name { font-size: 20px; font-weight: 600; line-height: 1.3; }
.sms-auth__pitch h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; line-height: 1.4; }
.sms-auth__pitch p { margin: 0; color: var(--primary-light); font-size: 14px; }
.sms-auth__main { flex: 1; padding: 0 16px calc(24px + var(--sab)); margin-top: -36px; display: flex; flex-direction: column; gap: 12px; }
.sms-auth__top { display: flex; justify-content: flex-end; }
.sms-auth__top .sms-lang { background: rgba(255, 255, 255, .95); }
.sms-auth__card {
	width: 100%; max-width: 480px; margin: 0 auto; padding: 24px 20px;
	background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, .08); animation: sms-rise .2s ease both;
}
.sms-mb { margin-bottom: 20px; }
.sms-mt { margin-top: 20px; }
.sms-center { text-align: center; }
.sms-h4 { margin: 20px 0 12px; font-size: 16px; font-weight: 600; color: var(--primary-dark); }
.sms-btn--block { width: 100%; min-height: 48px; }
.sms-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; font-size: 14px; }
.sms-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.sms-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.sms-cols { display: grid; grid-template-columns: 1fr; column-gap: 16px; }
.sms-hint { color: var(--muted); font-size: 14px; }
.sms-field.has-error input { border-color: var(--danger); }
.sms-pass { position: relative; }
.sms-pass input { padding-right: 48px; }
.sms-pass__toggle { position: absolute; right: 2px; top: 2px; width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); }
.sms-pass__toggle:hover { color: var(--primary); }
.sms-alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.sms-alert--danger { background: #FEE2E2; color: #991B1B; }
.sms-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (min-width: 768px) {
	.sms-auth { flex-direction: row; }
	.sms-auth__brand { width: 42%; max-width: 520px; padding: 48px; justify-content: space-between; }
	.sms-auth__pitch h2 { font-size: 30px; }
	.sms-auth__pitch p { font-size: 16px; }
	.sms-auth__main { margin-top: 0; padding: 24px 48px; justify-content: center; }
	.sms-auth__top { position: absolute; top: 24px; right: 32px; }
	.sms-auth__card { padding: 32px; max-width: 560px; box-shadow: none; }
	.sms-cols { grid-template-columns: 1fr 1fr; }
}

/* ---- Tabs, lists, rows (academic setup and later modules) ------------------------------ */
.sms-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); scrollbar-width: none; }
.sms-tabs::-webkit-scrollbar { display: none; }
.sms-tabs a { flex: 1 0 auto; text-align: center; padding: 8px 14px; border-radius: var(--radius-sm); color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; transition: background-color .15s ease, color .15s ease; }
.sms-tabs a.is-active { background: var(--primary-light); color: var(--primary-dark); }
.sms-back { align-self: flex-start; font-size: 14px; font-weight: 600; }

.sms-list { display: flex; flex-direction: column; gap: 8px; }
.sms-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); animation: sms-rise .2s ease both; }
.sms-item__main { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--text); }
.sms-app .sms-item__main:hover { color: var(--text); background: var(--bg); border-radius: var(--radius); }
.sms-item--row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.sms-item__icon { width: 44px; height: 44px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--primary-light); color: var(--primary-dark); }
.sms-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.sms-item__meta { color: var(--muted); font-size: 14px; }
.sms-item__actions { display: flex; align-items: center; gap: 4px; }
.sms-item__actions form { margin: 0; }
.sms-main-chevron { color: var(--muted); }
.sms-item__main > .sms-icon:last-child { color: var(--muted); }

.sms-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sms-chip { padding: 0 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--muted); }

.sms-rows { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; }
.sms-rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.sms-rows li:last-child { border-bottom: 0; }
.sms-rows form { margin: 0; }

.sms-iconbtn { width: 40px; height: 40px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background-color .15s ease, color .15s ease; }
.sms-app .sms-iconbtn:hover { background: var(--primary-light); color: var(--primary-dark); }

.sms-checks { display: grid; grid-template-columns: 1fr; gap: 4px 16px; margin-bottom: 16px; }
.sms-checks .sms-check { min-height: 40px; font-size: 15px; }
.sms-alert--success { background: #DCFCE7; color: #166534; }
.sms-alert--warning { background: #FEF3C7; color: #92400E; }
.sms-field textarea { padding-top: 10px; resize: vertical; }
.sms-card form .sms-btn + .sms-btn { margin-left: 8px; }
.sms-card form:not(:last-child) { margin-bottom: 0; }

@media (min-width: 768px) {
	.sms-checks { grid-template-columns: repeat(2, 1fr); }
}

/* ---- People: avatars, toolbar, filters, forms ---------------------------------------- */
.sms-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.sms-toolbar .sms-btn { flex: 1 1 auto; }
.sms-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; align-items: end; }
.sms-filters .sms-field:first-child { grid-column: 1 / -1; }
.sms-filters .sms-btn { grid-column: 1 / -1; margin-bottom: 16px; }
.sms-form { display: flex; flex-direction: column; gap: 16px; }
.sms-avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: var(--primary-light); color: var(--primary-dark); font-weight: 600; font-size: 18px; }
.sms-avatar--lg { width: 64px; height: 64px; font-size: 26px; }
.sms-profile { display: flex; align-items: center; gap: 16px; }
.sms-dl { margin: 0; display: flex; flex-direction: column; }
.sms-dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.sms-dl > div:last-child { border-bottom: 0; }
.sms-dl dt { color: var(--muted); font-size: 14px; font-weight: 600; }
.sms-dl dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.sms-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.sms-creds { border-color: var(--primary); background: #F5F9FF; }
.sms-creds code, .sms-item code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
.sms-subjects { display: flex; flex-direction: column; margin-bottom: 16px; }
.sms-subjrow { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.sms-subjrow select { width: 100%; min-height: 40px; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 15px; background: #fff; }
.sms-field input[type="file"] { padding-top: 9px; }

@media (min-width: 768px) {
	.sms-toolbar .sms-btn { flex: 0 0 auto; }
	.sms-filters { grid-template-columns: 2fr 1fr 1fr 1fr auto; }
	.sms-filters .sms-field:first-child { grid-column: auto; }
	.sms-filters .sms-btn { grid-column: auto; }
	.sms-subjrow { flex-direction: row; align-items: center; justify-content: space-between; }
	.sms-subjrow select { width: 260px; }
}

@media print {
	.sms-topbar, .sms-sidebar, .sms-bottomnav, .sms-sheet, .sms-toolbar, .sms-filters, .sms-tabs, .sms-back, .sms-loader { display: none !important; }
	.sms-main { margin: 0; }
	.sms-content { padding: 0; }
}

.sms-viewing { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.sms-viewing a { font-weight: 600; }

/* ---- Attendance and notices ------------------------------------------------------------- */
.sms-row--wrap { flex-wrap: wrap; }
.sms-att { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
.sms-att__who { display: flex; align-items: center; gap: 12px; }
.sms-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sms-seg__opt { position: relative; display: block; }
.sms-seg__opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sms-seg__opt span {
	display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 4px;
	border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
	font-size: 14px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.2;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.sms-seg__opt input:checked + span { color: #fff; border-color: transparent; }
.sms-seg__opt--present input:checked + span { background: #15803D; }
.sms-seg__opt--absent input:checked + span { background: var(--danger); }
.sms-seg__opt--late input:checked + span { background: #B45309; }
.sms-seg__opt--leave input:checked + span { background: var(--primary); }
.sms-seg__opt input:focus-visible + span { outline: 3px solid var(--primary-light); outline-offset: 1px; }
.sms-seg__opt input:disabled + span { opacity: .6; cursor: not-allowed; }
.sms-savebar { position: sticky; bottom: calc(var(--nav-h) + var(--sab) + 8px); z-index: 5; padding: 8px 0 0; }
.sms-monthnav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sms-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); vertical-align: baseline; }
.sms-dot--success { background: #15803D; }
.sms-dot--danger { background: var(--danger); }
.sms-dot--warning { background: #B45309; }
.sms-minis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.sms-mini { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; background: var(--bg); border-radius: var(--radius-sm); text-align: center; font-size: 13px; color: var(--muted); }
.sms-mini strong { font-size: 22px; color: var(--text); line-height: 1.2; }
.sms-notice__body { line-height: 1.8; overflow-wrap: anywhere; }
.sms-rows li > a { flex: 1; min-width: 0; }

@media (min-width: 768px) {
	.sms-filters--att { grid-template-columns: 2fr 1fr 1fr auto; }
	.sms-att { flex-direction: row; align-items: center; justify-content: space-between; }
	.sms-seg { width: 380px; }
	.sms-savebar { bottom: 8px; }
}

/* ---- Exams and results --------------------------------------------------------------------- */
.sms-exam { padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.sms-exam__head { display: flex; align-items: center; gap: 12px; }
.sms-exam__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sms-exam__actions form { margin: 0; }
.sms-markrow { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.sms-markrow input { width: 96px; min-height: 44px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 18px; font-weight: 600; text-align: center; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.sms-markrow input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.sms-markrow input:disabled { background: var(--bg); color: var(--muted); }
.sms-filters--entry, .sms-filters--sheet { grid-template-columns: 1fr 1fr; }
.sms-filters--entry .sms-field:nth-child(1), .sms-filters--sheet .sms-field:nth-child(1) { grid-column: 1 / -1; }
.sms-resulthead { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.sms-resulthead .sms-muted { line-height: 1.5; }
.sms-minis--result { grid-template-columns: repeat(3, 1fr); margin: 16px 0; }
.sms-table--sheet td, .sms-table--sheet th { white-space: nowrap; }

@media (min-width: 768px) {
	.sms-filters--entry { grid-template-columns: 2fr 1.5fr 1fr 2fr 1fr auto; }
	.sms-filters--sheet { grid-template-columns: 2fr 1.5fr 1fr auto; }
	.sms-filters--entry .sms-field:nth-child(1), .sms-filters--sheet .sms-field:nth-child(1) { grid-column: auto; }
	.sms-minis--result { grid-template-columns: repeat(6, 1fr); }
}

/* ---- School website editor ----------------------------------------------------------------- */
.sms-sechead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.sms-sechead .sms-h3 { margin: 0; }
.sms-sechead__ctl { display: flex; align-items: center; gap: 16px; }
.sms-order { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.sms-order input { width: 64px; min-height: 40px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 16px; text-align: center; background: #fff; }
.sms-imgbox { margin-bottom: 16px; padding: 12px; background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius); text-align: center; }
.sms-imgbox img { max-width: 100%; max-height: 180px; border-radius: var(--radius-sm); }
.sms-thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sms-thumbs figure { position: relative; margin: 0; overflow: hidden; border-radius: var(--radius-sm); background: var(--bg); aspect-ratio: 4 / 3; }
.sms-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sms-thumbs form { position: absolute; top: 4px; right: 4px; margin: 0; }
.sms-thumbs .sms-iconbtn { background: rgba(255, 255, 255, .92); color: var(--danger); }
.sms-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sms-swatch { position: relative; display: block; width: 44px; height: 44px; cursor: pointer; }
.sms-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sms-swatch span { display: block; width: 100%; height: 100%; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border); transition: box-shadow .15s ease, transform .15s ease; }
.sms-swatch input:checked + span { box-shadow: 0 0 0 3px var(--text); transform: scale(1.05); }
.sms-swatch input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary); }
.sms-label { font-size: 14px; font-weight: 600; }

@media (min-width: 768px) {
	.sms-thumbs { grid-template-columns: repeat(4, 1fr); }
}
