/* Reset / base */
body {
	margin: 0;
	font-family: var(--font-family-body);
	background: #fff;
	color: #1f2933;
}

/* Page shell */
.page-shell {
	max-width: 1840px;
	margin: 0 auto;
	padding: 18px 12px 36px;
}

.page-shell h1 {
	margin: 0 0 8px;
	font-family: var(--font-family-body);
	font-size: 2.1rem;
}

.page-shell p {
	margin: 0 0 16px;
	line-height: 1.5;
}

/* Panel & form */
.scheduler-panel {
	background: #fff;
	border: 1px solid #d3d8de;
	padding: 16px;
	margin: 0 3rem 5rem 3rem; 
}

.scheduler-form {
	overflow-x: auto;
	overflow-y: hidden;
}

/* Top layout */
.scheduler-top {
	display: flex;
	gap: 12px;
	min-width: 76rem;
	align-items: flex-start;
}

.scheduler-filters {
	flex: 0 0 56%;
}

.scheduler-key {
	flex: 1 1 44%;
	min-width: 22rem;
}

/* Select row */
.select-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 8px;
	font-size: 13px;
}

.select-row label {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-weight: 400;
}

.select-row select {
	min-width: 10rem;
	margin-left: 0;
	padding: 3px 4px;
	border: 1px solid #767676;
	background: #fff;
	font-size: 13px;
}

/* Filter grid */
.filter-grid {
	width: 98%;
	border: 0;
	border-collapse: collapse;
	margin-top: 0.5rem;
}

.filter-grid td {
	padding: 10px;
	vertical-align: top;
	border-bottom: 0;
	border-right: 1px solid #d6dbe1;
}

.filter-grid td:last-child {
	border-right: 0;
}

/* Mini grid */
.mini-grid {
	width: 100%;
	border-collapse: collapse;
}

.mini-grid td {
	border: 0;
	padding: 4px 6px 4px 0;
	font-size: 13px;
}

.mini-grid .heading-cell {
	font-weight: 700;
	padding-bottom: 6px;
}

.mini-grid select {
	width: 100%;
	padding: 2px 4px;
	border: 1px solid #767676;
	background: #fff;
	font-size: 13px;
}

/* Buttons */
.button-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	width: 98%;
	margin-top: 12px;
}

.button-row button {
	min-width: 8rem;
	border: 0;
	padding: 8px 16px;
	background: #01579c;
	color: #fff;
	text-decoration: underline;
	cursor: pointer;
	font-size: 13px;
}

/* Misc small items */
.helper-text {
	margin: 12px 0 6px;
	font-size: 12px;
}

.total-row {
	margin: 0;
	font-weight: 700;
}

.scheduler-status {
	min-height: 1.2em;
	margin-top: 8px;
	color: #8d2b0b;
	font-weight: 700;
}

/* Key card */
.key-card {
	min-width: 30rem;
}

.key-title {
	margin: 0 0 8px;
	background: #7eb5e0;
	color: #fff;
	padding: 2px 6px;
	font-size: 15px;
}

.key-grid {
	display: grid;
	grid-template-columns: 0.85fr 0.85fr 0.95fr 1.1fr 1.1fr;
	gap: 12px;
	padding-left: 0.4rem;
	font-size: 0.8rem;
	line-height: 1.24;
	align-items: start;
}

.key-grid p {
	margin: 0 0 6px;
}

.key-list div {
	margin-bottom: 2px;
}

/* Table wrapper */
.table-wrap {
	max-height: 72vh;
	overflow-y: auto;
	overflow-x: auto;
	margin-top: 10px;
	border: 1px solid #d3d8de;
	background: #fff;
}

/* Table defaults (let content size columns) */
.schedule-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: auto;
	/* allow columns to size to content so description can push neighbors */
}

/* Table cells styling */
.schedule-table th,
.schedule-table td {
	padding: 4px 6px;
	border-bottom: 1px solid #e4e7eb;
	text-align: left;
	vertical-align: top;
	font-size: 0.76rem;
	line-height: 1.15;
}

.schedule-table th {
	border-bottom: none;
	vertical-align: middle !important;
}

/* Sticky header */
.schedule-table th {
	position: sticky;
	top: 0;
	z-index: 2;
	background: #0b4f6c;
	color: #fff;
	cursor: pointer;
}

.schedule-table th.sort-asc::after {
	content: ' ▲';
	font-size: 0.75rem;
}

.schedule-table th.sort-asc {
	white-space: nowrap;
}

.schedule-table th.sort-desc::after {
	content: ' ▼';
	font-size: 0.75rem;
}

.schedule-table th[data-sort-key="endDate"] {
	padding-left: 10px;
	padding-right: 24px;
}

.schedule-table tbody tr:nth-child(even) {
	background: #f8fafc;
}

/* Course link: show full single line and allow expansion to push neighbors */
.course-link {
	display: inline-block;
	/* allow measurement and expansion (inline-block is best here) */
	white-space: nowrap;
	/* single line */
	overflow: visible;
	/* allow it to expand beyond its own inline box */
	text-overflow: clip;
	/* no ellipsis */
	color: #01579c;
	text-decoration: underline;
	background: transparent;
	border: 0;
	padding: 0;
	font: inherit;
	cursor: pointer;
	max-width: none;
}

/* Column baselines (min-widths) to keep table readable when content short */
.column-class-section {
	min-width: 7.5rem;
}

.column-description {
	min-width: 15rem;
}

/* baseline, not enforced width */
.column-session {
	min-width: 8rem;
}

.column-time {
	min-width: 4.75rem;
	white-space: nowrap;
}

.column-instructor {
	min-width: 11rem;
}

.column-gened {
	min-width: 8rem;
}

.column-low-cost {
	min-width: 6rem;
	text-align: center;
}

/* Explicit override for description (5th column) — allow it to expand and ignore inline widths */
#tablelist th:nth-child(5),
#tablelist td:nth-child(5),
.schedule-table th:nth-child(5),
.schedule-table td:nth-child(5) {
	width: auto !important;
	/* neutralize inline width attributes on <th> */
	white-space: nowrap;
	/* keep description on one line so it pushes neighbors */
	overflow: visible;
	/* allow content to expand the column */
	box-sizing: border-box;
	vertical-align: top;
}

/* Course modal and details (restored from original) */
.modal-backdrop {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(15, 23, 42, 0.55);
	z-index: 20;
}

.modal-backdrop.is-visible {
	display: flex;
}

.course-modal {
	width: min(56rem, 100%);
	max-height: 85vh;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #d3d8de;
	box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

.course-modal-footer {
	display: flex;
	justify-content: flex-end;
	padding: 10px 16px 0;
}

.course-modal-body {
	padding: 8px 18px 12px;
	font-size: 0.95rem;
	line-height: 1.45;
}

.course-modal-title {
	margin: 0;
	color: #2fb457;
	font-size: 1.5rem;
	line-height: 1.25;
}

.btn-close {
	border: 0;
	background: transparent;
	color: #52606d;
	font-size: 1.8rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

.btn-close::before {
	content: '×';
}

.course-modal-description,
.course-modal-text,
.course-modal-instructor {
	margin: 0 0 14px;
}

/* course modal table */
.course-modal-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 14px;
}

.course-modal-table th,
.course-modal-table td {
	border: 1px solid #000;
	padding: 8px 10px;
	text-align: left;
	vertical-align: top;
	font-size: 0.95rem;
	white-space: normal;
}

.course-modal-table th {
	font-weight: 700;
}

/* hide empty modal sections */
.course-modal-notes:empty,
.course-modal-text.is-empty,
.course-modal-instructor.is-empty,
.course-modal-table-wrap.is-empty {
	display: none;
}

.course-modal-note {
	margin-bottom: 10px;
}

.course-modal-note p {
	margin: 0;
	white-space: pre-line;
}

/* modal actions */
.course-modal-actions {
	display: inline-block;
	border: 1px solid #0d6efd;
	background: #0d6efd;
	color: #fff;
	padding: 7px 18px;
	font-size: 0.95rem;
	cursor: pointer;
}

/* Responsive: stack key and filters, allow wrapping on small screens */
@media (max-width: 1100px) {
	.scheduler-top {
		flex-direction: column;
	}

	.scheduler-filters,
	.scheduler-key {
		flex: 1 1 auto;
		width: 100%;
	}

	.key-card {
		min-width: 0;
	}

	/* small adjustment to column baseline widths */
	.column-description {
		min-width: 14rem;
	}
}

/* Small-screen layout */
@media (max-width: 780px) {
	.select-row {
		flex-direction: column;
		align-items: stretch;
	}

	.select-row label {
		display: flex;
		flex-direction: column;
		gap: 4px;
	}

	.select-row select {
		min-width: 0;
		margin-left: 0;
	}

	.key-grid {
		grid-template-columns: 1fr;
		padding-left: 0;
	}

	.course-modal {
		width: 100%;
	}

	.course-modal-table {
		font-size: 0.88rem;
	}

	/* revert description behavior on narrow screens so layout remains usable */
	#tablelist th:nth-child(5),
	#tablelist td:nth-child(5),
	.course-link {
		white-space: normal;
		overflow: hidden;
		text-overflow: ellipsis;
	}
}

.schedule-table td {
	padding: 8px 8px;
	/* larger vertical + horizontal padding */
	vertical-align: middle !important;
	/* center vertically in each cell */
	line-height: 1.35;
	/* good vertical spacing for multi-line text */
	box-sizing: border-box;
}

/* ticket 279606 - start */
.column-class-section {
	width: fit-content;
	min-width: unset;
}

@media (max-width: 1100px) {
	.filter-grid > tbody > tr > td:first-child > .mini-grid > tbody {
		display: flex;
	}

	.filter-grid > tbody > tr > td:first-child > .mini-grid > tbody tr:nth-of-type(2),
	.filter-grid > tbody > tr > td:first-child > .mini-grid > tbody tr:nth-of-type(3) {
		display: flex;
		flex-direction: column;
	}

	.filter-grid > tbody > tr > td:first-child > .mini-grid > tbody tr:nth-of-type(2) {
		margin-right: 12px;
	}

	.filter-grid > tbody > tr > td:first-child {
		max-width: 100px;
	}

	.filter-grid > tbody > tr > td:first-child > .mini-grid > tbody {
		flex-wrap: wrap;
	}

	.filter-grid > tbody > tr > td:first-child > .mini-grid > tbody tr:first-child {
		flex: 0 0 100%;
	}
}

@media (max-width: 780px) {

	.select-row,
	.select-row label {
		align-items: start;
	}

	.filter-grid > tbody > tr:first-child {
		display: flex;
		flex-direction: column;
	}

	.filter-grid>tbody>tr>td {
		border: none;
		border-bottom: 1px solid #d6dbe1;
	}

	.filter-grid td,
	.filter-grid > tbody > tr > td:first-child,
	.key-grid p {
		max-width: unset;
		width: 254px;
	}

	.filter-grid > tbody > tr > td:first-child > .mini-grid > tbody tr:nth-of-type(2),
	.filter-grid > tbody > tr > td:first-child > .mini-grid > tbody tr:nth-of-type(3) {
		display: inline;
	}

	.scheduler-panel {
		margin: 0 1rem 3rem; 
	}
}

/* ticket 279606 - end */