/* ==========================
   Стили страниц "Расписание" и "Дневник" — под фирменный стиль сайта.
   Палитра и шрифт взяты из about.css: акцентный синий #0059ff / #366ee6,
   шрифт 'Asap Sharp', белые карточки с мягкой синей тенью.
   ========================== */

:root {
	--sch-ink: #262626;
	--sch-text-muted: #6b6b6b;
	--sch-heading: #4c4c4c;
	--sch-line: rgba(0, 0, 0, 0.06);
	--sch-card-bg: #ffffff;
	--sch-page-bg: #EBEBFA;
	--sch-accent: #0059ff;
	--sch-accent-btn: #366ee6;
	--sch-accent-btn-hover: #074ce0;
	--sch-accent-light: #6fa2ff;
	--sch-accent-soft: color-mix(in srgb, #0059ff 10%, white);
	--sch-shadow: 0 12px 28px -18px rgba(0, 89, 255, 0.35);
	--sch-shadow-hover: 0 20px 34px -16px rgba(0, 89, 255, 0.4);
}

.sch-page {
	margin: 0 auto;
	padding: 10px 60px 120px;
	font-family: 'Asap Sharp', sans-serif;
	color: var(--sch-ink);
	background: var(--sch-page-bg);
}

.sch-label {
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.3px;
	color: var(--sch-accent);
	margin-bottom: 10px;
}

.sch-title {
	font-family: 'Asap Sharp', sans-serif;
	font-size: 30px;
	font-weight: 600;
	color: var(--sch-heading);
	margin: 0 0 10px;
}

.sch-subtitle {
	font-size: 15px;
	font-weight: 300;
	line-height: 1.7;
	color: var(--sch-text-muted);
	margin: 0 0 40px;
}

/* ---------- Таблица недельного расписания ---------- */

.sch-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	background: var(--sch-card-bg);
	border: 1px solid var(--sch-line);
	border-radius: 18px;
	box-shadow: var(--sch-shadow);
}

.sch-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 720px;
}

.sch-table th,
.sch-table td {
	border-bottom: 1px solid var(--sch-line);
	border-right: 1px solid var(--sch-line);
	padding: 14px 16px;
	text-align: left;
	vertical-align: top;
	font-size: 13.5px;
	font-weight: 300;
	color: var(--sch-text-muted);
}

.sch-table th:last-child,
.sch-table td:last-child {
	border-right: none;
}

.sch-table thead th {
	background: var(--sch-accent-soft);
	font-weight: 600;
	color: var(--sch-heading);
	position: sticky;
	top: 0;
}

.sch-table thead th:first-child {
	border-top-left-radius: 18px;
}
.sch-table thead th:last-child {
	border-top-right-radius: 18px;
}

.sch-table tbody tr:last-child td {
	border-bottom: none;
}

.sch-time-cell {
	white-space: nowrap;
	font-weight: 600;
	color: var(--sch-heading);
	background: #fbfcff;
	width: 128px;
}

.sch-time-cell .sch-bell-number {
	display: block;
	font-size: 11.5px;
	font-weight: 500;
	color: var(--sch-accent-light);
}

.sch-lesson-room {
	display: block;
	font-size: 12px;
	color: var(--sch-accent-light);
	margin-top: 2px;
}

.sch-table th.sch-today-col,
.sch-table td.sch-today-col {
	background: var(--sch-accent-soft);
}

.sch-empty-cell {
	color: rgba(38, 38, 38, 0.25);
}

/* ---------- Журнал оценок ---------- */

.sch-journal-subject-cell {
	font-weight: 600;
	color: var(--sch-heading);
	white-space: nowrap;
}

.sch-journal-year-col {
	background: var(--sch-accent-soft);
	font-weight: 600;
}

.sch-journal-grade-input {
	width: 48px;
	text-align: center;
}

/* ---------- Переключатель дней (Дневник) ---------- */

.sch-week-nav {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 24px;
}

.sch-week-nav-btn {
	border: 1px solid var(--sch-line);
	background: var(--sch-card-bg);
	border-radius: 10px;
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 17px;
	color: var(--sch-accent);
	flex-shrink: 0;
	transition: background-color 0.3s ease, transform 0.2s ease;
}

.sch-week-nav-btn:hover {
	background: var(--sch-accent-soft);
	transform: translateY(-2px);
}

.sch-day-picker {
	display: flex;
	gap: 10px;
}

.sch-day-pill {
	border: 1px solid var(--sch-line);
	background: var(--sch-card-bg);
	border-radius: 12px;
	padding: 10px 16px;
	cursor: pointer;
	text-align: center;
	min-width: 86px;
	font-family: 'Asap Sharp', sans-serif;
	box-shadow: var(--sch-shadow);
	transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.sch-day-pill-label {
	display: block;
	font-size: 11.5px;
	font-weight: 500;
	color: var(--sch-text-muted);
}

.sch-day-pill-date {
	display: block;
	font-size: 15px;
	font-weight: 600;
	color: var(--sch-heading);
	margin-top: 3px;
}

.sch-day-pill:hover {
	transform: translateY(-3px);
	box-shadow: var(--sch-shadow-hover);
}

.sch-day-pill.active {
	background: var(--sch-accent-btn);
	border-color: var(--sch-accent-btn);
}

.sch-day-pill.active .sch-day-pill-label,
.sch-day-pill.active .sch-day-pill-date {
	color: #ffffff;
}

.sch-day-pill.today:not(.active) {
	border-color: var(--sch-accent-light);
}

.sch-day-pill.today:not(.active) .sch-day-pill-date {
	color: var(--sch-accent);
}

/* ---------- Список уроков дня (Дневник) ---------- */

.sch-day-heading {
	font-family: 'Asap Sharp', sans-serif;
	font-size: 21px;
	font-weight: 600;
	color: var(--sch-heading);
	margin: 36px 0 18px;
}

.sch-day-list {
	list-style: none;
	margin: 0;
	padding: 0;
	background: var(--sch-card-bg);
	border: 1px solid var(--sch-line);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: var(--sch-shadow);
}

.sch-day-item {
	display: flex;
	gap: 18px;
	align-items: center;
	padding: 16px 20px;
	border-bottom: 1px solid var(--sch-line);
	transition: background-color 0.25s ease;
}

.sch-day-item:hover {
	background: var(--sch-accent-soft);
}

.sch-day-item:last-child {
	border-bottom: none;
}

.sch-day-item-bell {
	width: 90px;
	flex-shrink: 0;
	font-weight: 600;
	font-size: 13.5px;
	color: var(--sch-accent);
}

.sch-day-item-bell .sch-bell-number {
	display: block;
	font-size: 11.5px;
	font-weight: 500;
	color: var(--sch-accent-light);
}

.sch-day-item-subject {
	font-size: 15px;
	font-weight: 600;
	color: var(--sch-heading);
}

.sch-day-item-room {
	font-size: 12.5px;
	font-weight: 300;
	color: var(--sch-text-muted);
	margin-top: 2px;
}

.sch-day-empty {
	padding: 36px 20px;
	text-align: center;
	font-size: 14px;
	font-weight: 300;
	color: var(--sch-text-muted);
}

/* ---------- Домашнее задание в дневнике ---------- */

.sch-day-item-main {
	flex: 1;
}

.sch-homework-text {
	margin-top: 8px;
	font-size: 13px;
	font-weight: 300;
	color: var(--sch-ink);
	background: var(--sch-accent-soft);
	border-radius: 8px;
	padding: 8px 10px;
	white-space: pre-wrap;
}

.sch-homework-empty {
	margin-top: 8px;
	font-size: 12.5px;
	font-weight: 300;
	font-style: italic;
	color: rgba(38, 38, 38, 0.35);
}

.sch-homework-input {
	margin-top: 8px;
	width: 100%;
	min-height: 60px;
	font-family: 'Asap Sharp', sans-serif;
	font-size: 13px;
	border: 1px solid var(--sch-line);
	border-radius: 8px;
	padding: 8px 10px;
	resize: vertical;
	box-sizing: border-box;
}

.sch-homework-input:focus {
	outline: none;
	border-color: var(--sch-accent);
}

.sch-homework-buttons {
	display: flex;
	gap: 8px;
	margin-top: 8px;
}

.sch-homework-edit-btn {
	margin-top: 8px;
}

.sch-btn-small {
	padding: 6px 12px;
	font-size: 12px;
}

@media (max-width: 768px) {
	.sch-page {
		padding: 60px 20px 70px;
	}
	.sch-title {
		font-size: 24px;
	}
	.sch-subtitle {
		font-size: 14px;
		margin-bottom: 28px;
	}
	.sch-day-heading {
		font-size: 18px;
		margin: 26px 0 14px;
	}
}

@media (max-width: 560px) {
	.sch-week-nav {
		gap: 8px;
	}
	.sch-day-picker {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		gap: 8px;
		padding-bottom: 4px; /* место под тень плашек, чтобы не обрезалась */
		scrollbar-width: thin;
	}
	.sch-day-pill {
		flex: 0 0 auto; /* больше не сжимаем — едем вбок, а не мнём текст */
		min-width: 64px;
		padding: 8px 10px;
	}
}

/* ---------- Телефон: панели управления, кнопки и инпуты в столбик ---------- */
@media (max-width: 640px) {
	.sch-page {
		padding: 150px 16px 60px;
	}

	.sch-controls {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.sch-class-select,
	.sch-input {
		width: 100%;
		box-sizing: border-box;
	}

	.sch-schedule-controls,
	.jrn-zavuch-row,
	.plan-zavuch-row {
		flex-direction: column;
		align-items: stretch;
	}

	.sch-schedule-controls .sch-btn,
	.jrn-zavuch-row .sch-btn,
	.plan-zavuch-row .sch-btn,
	.sch-bells-buttons .sch-btn {
		width: 100%;
	}

	/* кнопки — минимум 44px высотой для комфортного нажатия пальцем */
	.sch-btn,
	.sch-btn-outline,
	.sch-week-nav-btn {
		min-height: 44px;
	}

	.sch-week-nav {
		gap: 8px;
	}

	/* карточки классов — по 2 в ряд вместо мелкой сетки на весь экран */
	.jrn-classes-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.jrn-subject-row {
		flex-wrap: wrap;
		gap: 8px;
	}

	.jrn-period-row {
		flex-wrap: wrap;
	}
	.jrn-period-label {
		width: 100%;
	}

	/* строка ученика в дневнике — переносим номер урока над предметом */
	.sch-day-item {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}
	.sch-day-item-bell {
		width: auto;
	}

	.sch-bells-list {
		gap: 8px;
	}
	.sch-bell-edit-row {
		flex: 1 1 100%;
	}
}

@media (max-width: 400px) {
	.jrn-classes-grid {
		grid-template-columns: 1fr;
	}
	.sch-title {
		font-size: 21px;
	}
}

/* ---------- Панель выбора класса и управления (учитель) ---------- */

.sch-controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 24px;
}

.sch-class-select {
	font-family: 'Asap Sharp', sans-serif;
	font-size: 14px;
	font-weight: 600;
	color: var(--sch-heading);
	background: var(--sch-card-bg);
	border: 1px solid var(--sch-line);
	border-radius: 10px;
	padding: 10px 14px;
	box-shadow: var(--sch-shadow);
	cursor: pointer;
}

.sch-schedule-controls {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.sch-input {
	font-family: 'Asap Sharp', sans-serif;
	font-size: 13.5px;
	border: 1px solid var(--sch-line);
	border-radius: 10px;
	padding: 9px 12px;
	width: 130px;
}

.sch-btn {
	font-family: 'Asap Sharp', sans-serif;
	font-size: 13px;
	font-weight: 600;
	border: none;
	border-radius: 10px;
	padding: 10px 18px;
	cursor: pointer;
	color: #fff;
	background: var(--sch-accent-btn);
	transition: background-color 0.3s ease, transform 0.2s ease;
}

.sch-btn:hover {
	background: var(--sch-accent-btn-hover);
	transform: translateY(-2px);
}

.sch-btn-outline {
	background: transparent;
	color: var(--sch-accent-btn);
	border: 1px solid var(--sch-accent-btn);
}

.sch-btn-outline:hover {
	background: var(--sch-accent-soft);
}

.sch-btn-danger {
	background: #e0523f;
	color: white;
	border: #ff391f;
}

.sch-btn-danger:hover {
	background: #c23f2d;
}

/* ---------- Блок управления журналом (только завуч) ---------- */

.jrn-zavuch-controls {
	background: var(--sch-card-bg);
	border: 1px solid var(--sch-line);
	border-radius: 16px;
	box-shadow: var(--sch-shadow);
	padding: 18px 20px;
	margin-bottom: 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.jrn-zavuch-row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

.jrn-subject-cell {
	font-weight: 600;
	color: var(--sch-heading);
	white-space: nowrap;
}

.jrn-grade-input {
	width: 48px;
	text-align: center;
	font-family: 'Asap Sharp', sans-serif;
	font-size: 13px;
	border: 1px solid var(--sch-line);
	border-radius: 6px;
	padding: 6px 4px;
}

.jrn-grade-input:focus {
	outline: none;
	border-color: var(--sch-accent);
}

/* ---------- Список классов на странице Журнал ---------- */

.jrn-classes-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 12px;
}

.jrn-class-card {
	display: block;
	text-align: center;
	background: var(--sch-card-bg);
	border: 1px solid var(--sch-line);
	border-radius: 14px;
	box-shadow: var(--sch-shadow);
	padding: 20px 12px;
	text-decoration: none;
	font-family: 'Asap Sharp', sans-serif;
	font-weight: 600;
	color: var(--sch-heading);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.jrn-class-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--sch-shadow-hover);
	color: var(--sch-accent);
}

/* ---------- Хлебная крошка "назад" ---------- */

.jrn-breadcrumb {
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
	color: var(--sch-accent);
	text-decoration: none;
	margin-bottom: 14px;
}

.jrn-breadcrumb:hover {
	text-decoration: underline;
}

/* ---------- Список предметов / учеников (страница класса) ---------- */

.jrn-list {
	list-style: none;
	margin: 0 0 32px;
	padding: 0;
	background: var(--sch-card-bg);
	border: 1px solid var(--sch-line);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: var(--sch-shadow);
}

.jrn-subject-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--sch-line);
}

.jrn-subject-row:last-child {
	border-bottom: none;
}

.jrn-subject-link {
	font-weight: 600;
	color: var(--sch-heading);
	text-decoration: none;
}

.jrn-subject-link:hover {
	color: var(--sch-accent);
}

/* ---------- Границы четвертей (страница списка классов, только завуч) ---------- */

.jrn-period-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}

.jrn-period-label {
	width: 110px;
	flex-shrink: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--sch-heading);
}

/* ---------- Вкладки четвертей (страница предмета) ---------- */

.jrn-tabs {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.jrn-tab {
	font-family: 'Asap Sharp', sans-serif;
	font-size: 13px;
	font-weight: 600;
	border: 1px solid var(--sch-line);
	background: var(--sch-card-bg);
	border-radius: 10px;
	padding: 8px 14px;
	cursor: pointer;
	color: var(--sch-text-muted);
}

.jrn-tab:hover {
	background: var(--sch-accent-soft);
}

.jrn-tab.active {
	background: var(--sch-accent-btn);
	border-color: var(--sch-accent-btn);
	color: #fff;
}

/* ---------- Значение оценки с кнопкой сброса (страница предмета) ---------- */

.jrn-grade-value {
	font-weight: 600;
	color: var(--sch-heading);
}

.jrn-grade-reset {
	border: none;
	background: none;
	color: rgba(224, 82, 63, 0.7);
	font-size: 14px;
	cursor: pointer;
	margin-left: 4px;
	line-height: 1;
}

.jrn-grade-reset:hover {
	color: #e0523f;
}

/* ---------- Поля ввода прямо в ячейках таблицы (режим редактирования) ---------- */

.sch-edit-input {
	width: 100%;
	font-family: 'Asap Sharp', sans-serif;
	font-size: 13px;
	border: 1px solid var(--sch-line);
	border-radius: 6px;
	padding: 6px 8px;
	margin-bottom: 4px;
	box-sizing: border-box;
}

.sch-edit-input:focus {
	outline: none;
	border-color: var(--sch-accent);
}

.sch-edit-input-room {
	color: var(--sch-text-muted);
	font-size: 12px;
}

/* ---------- Блок редактирования времени звонков (только завуч) ---------- */

.sch-bells-controls {
	background: var(--sch-card-bg);
	border: 1px solid var(--sch-line);
	border-radius: 16px;
	box-shadow: var(--sch-shadow);
	padding: 20px 22px;
	margin-bottom: 28px;
}

.sch-bells-title {
	font-family: 'Asap Sharp', sans-serif;
	font-size: 15px;
	font-weight: 600;
	color: var(--sch-heading);
	margin: 0 0 14px;
}

.sch-bells-list {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 16px;
}

.sch-bell-edit-row {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--sch-text-muted);
	background: var(--sch-accent-soft);
	border-radius: 10px;
	padding: 8px 12px;
}

.sch-bell-edit-number {
	font-weight: 600;
	color: var(--sch-heading);
	white-space: nowrap;
}

.sch-bell-time-input {
	font-family: 'Asap Sharp', sans-serif;
	font-size: 13px;
	border: 1px solid var(--sch-line);
	border-radius: 6px;
	padding: 5px 6px;
}

.sch-bells-buttons {
	display: flex;
	gap: 10px;
}