/*
 * Rodocodo Soft-UI theme for the admin app (and game auth screens that use UI::addHead).
 * Source of truth for tokens and component styles: keep in sync with admin/ui-kit.html.
 * Loaded after Bootstrap 4.6.2 and style.css from UI::addHead() via Config::ADMIN_HOME_URL.
 * Applies to all admin screens (family and school). Do not split into family/school CSS.
 */

:root {
	/* Brand Colors */
	--brand-primary: #0d6efd;
	--brand-primary-hover: #0b5ed7;

	/* Backgrounds */
	--bg-app: #f4f5f7;
	--bg-card: #ffffff;

	/* Text Colors */
	--text-main: #212529;
	--text-muted: #6c757d;

	/* Shapes */
	--radius-card: 1rem;
	--radius-btn: 0.5rem;
	--radius-pill: 50rem;

	/* Soft Shadows */
	--shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
	--shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);

	/* Borders */
	--border-subtle: 1px solid #e5e7eb;
}

body {
	background-color: var(--bg-app);
	font-family: 'Inter', sans-serif;
	font-size: 0.875rem;
	color: var(--text-main);
}

/* Keep sticky footer from style.css; sit it on the same white as the nav */
footer {
	margin-top: auto;
	background-color: var(--bg-card);
	border-top: var(--border-subtle);
	min-height: 3.5rem;
	padding: 0 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

footer p {
	margin-bottom: 0;
	font-size: 0.75rem;
	font-weight: 500;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
	font-weight: 700;
}

/* Small Capitals for Labels & Subheadings */
label,
.text-caps {
	font-size: 0.75rem;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--text-muted);
	margin-bottom: 0.5rem;
	display: block;
}

/* Page heading with optional school/context eyebrow (e.g. classes.php) */
.page-heading .text-caps {
	font-weight: 700;
	letter-spacing: 0.7px;
}

/* Cards */
.soft-card {
	background-color: var(--bg-card);
	border-radius: var(--radius-card);
	box-shadow: var(--shadow-soft);
	border: var(--border-subtle);
	padding: 2rem;
	margin-bottom: 1.5rem;
}

/* Numbered form sections (e.g. public teacher quote) */
.section-header {
	display: flex;
	align-items: center;
	margin-top: 1.75rem;
	margin-bottom: 1.25rem;
	padding-top: 1.5rem;
	border-top: var(--border-subtle);
}

.section-header.section-header-first {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}

.section-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.625rem;
	height: 1.625rem;
	border-radius: 50%;
	background-color: rgba(13, 110, 253, 0.1);
	color: var(--brand-primary);
	font-size: 0.8rem;
	font-weight: 700;
	margin-right: 0.65rem;
	flex-shrink: 0;
}

.field-hint {
	font-size: 0.75rem;
	color: var(--text-muted);
	margin-top: 0.35rem;
}

.dashboard-card {
	width: 100%;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	height: 100%;
	padding: 1.5rem;
	margin-bottom: 0;
}

.dashboard-card:hover {
	box-shadow: var(--shadow-hover);
	transform: translateY(-2px);
	text-decoration: none;
}

.dashboard-card.border-primary {
	border-color: var(--brand-primary);
}

/* Compact metric tiles (e.g. classes.php summary row) */
.stat-card {
	background-color: var(--bg-card);
	border: var(--border-subtle);
	border-radius: var(--radius-btn);
	box-shadow: var(--shadow-soft);
	padding: 1.5rem 1.5rem;
	height: 100%;
	margin-bottom: 0;
	min-height: 7.5rem;
	display: flex;
	flex-direction: column;
}

.stat-footer {
	margin-top: auto;
}

.stat-label {
	color: var(--text-muted);
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 0.35rem;
}

.stat-value {
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--text-main);
}

.stat-value-muted {
	color: var(--text-muted);
	font-weight: 600;
}

.stat-meta {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	color: var(--text-muted);
	font-size: 0.7rem;
}

.stat-meta i {
	font-size: 0.8rem;
	line-height: 1;
}

.stat-meta-bolt {
	color: #f5b400;
}

.stat-meta-check {
	color: #22c55e;
}

.stat-card .progress.stat-progress {
	height: 0.25rem;
	border-radius: var(--radius-pill);
	background-color: #e9edf2;
	margin-top: 1.1rem;
	margin-bottom: 0.55rem;
	overflow: hidden;
}

.stat-footer > .stat-meta {
	margin-top: 0.65rem;
}

.stat-card .progress.stat-progress .progress-bar {
	background-color: var(--brand-primary);
	border-radius: var(--radius-pill);
}

.stat-progress-label {
	color: var(--text-muted);
	font-size: 0.7rem;
}

.stat-icon {
	width: 2.5rem;
	height: 2.5rem;
	border-radius: var(--radius-btn);
	background: #edf5ff;
	color: var(--brand-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.1rem;
	flex-shrink: 0;
}

.stat-icon-students {
	background: var(--brand-primary);
	color: #fff;
}

.stat-icon-classes {
	background: #e8f1ff;
	color: #3b82f6;
}

.stat-icon-activity {
	background: #f3e8ff;
	color: #7c3aed;
}

/* Slightly tighter than the old 12rem course selects on classes.php */
.course-select-compact {
	width: 9.5rem;
	max-width: 100%;
	box-sizing: border-box;
}

/* Class course setting (students.php) — soft-card with primary accent */
.course-selector {
	border-left: 4px solid var(--brand-primary);
	padding: 1.25rem 1.5rem;
}

.course-selector .text-caps {
	display: inline;
	margin-bottom: 0;
}

.course-selector-control {
	max-width: 24rem;
	font-weight: 600;
}

/* Compact students count link in class tables — sized like Soft-UI .btn.btn-sm */
.student-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.3rem;
	background: #edf5ff;
	color: var(--brand-primary);
	border: 1px solid transparent;
	border-radius: var(--radius-btn);
	padding: 0.5rem 0.75rem;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1.5;
	white-space: nowrap;
	text-decoration: none !important;
	box-sizing: border-box;
}

.student-count:hover {
	background: #dcecff;
	color: var(--brand-primary-hover);
}

/* Row “more” menu (e.g. classes.php) */
.soft-card.soft-card-overflow-visible {
	overflow: visible;
}

.soft-card.soft-card-overflow-visible .table-responsive {
	overflow: visible;
}

.dropdown-menu.soft-dropdown {
	border: var(--border-subtle);
	border-radius: var(--radius-btn);
	box-shadow: var(--shadow-hover);
	font-size: 0.875rem;
	padding: 0.35rem;
	min-width: 11rem;
}

.dropdown-menu.soft-dropdown .dropdown-item {
	border-radius: 0.35rem;
	padding: 0.5rem 0.75rem;
	font-weight: 500;
}

.dropdown-menu.soft-dropdown .dropdown-item i {
	width: 1.15rem;
	margin-right: 0.4rem;
	color: var(--text-muted);
}

.dropdown-menu.soft-dropdown .dropdown-item.text-danger i {
	color: inherit;
}

.dropdown-menu.soft-dropdown .dropdown-divider {
	border-top-color: #edf0f4;
	margin: 0.35rem 0;
}

/* Details Box (Login Details) */
.details-box {
	border: 1px solid var(--border-subtle);
	border-radius: var(--radius-btn);
}

/* Breadcrumbs — kit §2; emitted by UI::addBreadcrumb as .breadcrumb-box */
.breadcrumb-box {
	background-color: var(--bg-card);
	border-radius: var(--radius-btn);
	box-shadow: var(--shadow-soft);
	border: var(--border-subtle);
	padding: 0.65rem 1.25rem;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	width: 100%;
	margin-bottom: 1.5rem;
	row-gap: 0.25rem;
}

.breadcrumb-box a {
	color: var(--brand-primary);
	text-decoration: none;
	font-weight: 500;
	font-size: 0.875rem;
	line-height: 1.25;
}

.breadcrumb-box a:hover {
	color: var(--brand-primary-hover);
	text-decoration: underline;
}

.breadcrumb-box .separator {
	color: #adb5bd;
	margin: 0 0.5rem;
	font-size: 0.75rem;
	line-height: 1;
	display: inline-flex;
	align-items: center;
}

.breadcrumb-box .current {
	color: var(--text-muted);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.25;
}

/* Forms */
.form-check-label {
	font-size: 0.875rem;
	letter-spacing: normal;
	text-transform: none;
	font-weight: 400;
	color: var(--text-main);
	margin-bottom: 0;
	display: inline;
}

.form-control {
	border-radius: var(--radius-btn);
	padding: 0.6rem 1rem;
	height: auto;
	border-color: #ced4da;
	font-size: 0.875rem;
}

.form-control:focus {
	border-color: var(--brand-primary);
	box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

/* Buttons */
.btn {
	border-radius: var(--radius-btn);
	font-size: 0.875rem;
	font-weight: 600;
	padding: 0.5rem 0.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.3rem;
	white-space: nowrap;
}

.btn-primary {
	background-color: var(--brand-primary);
	border-color: var(--brand-primary);
}

.btn-primary:hover {
	background-color: var(--brand-primary-hover);
	border-color: var(--brand-primary-hover);
}

/* Soft-UI .btn is flex-aligned; keep badge optically level with the label */
.btn .badge {
	position: relative;
	top: 1px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	padding-top: 0.35em;
	padding-bottom: 0.35em;
	margin-left: 0;
}

.btn-icon-only {
	padding: 0.4rem 0.6rem;
	color: var(--text-muted);
	background: transparent;
	border: none;
	font-size: 1.25rem;
}

.btn-icon-only:hover {
	color: var(--text-main);
	background: var(--bg-app);
}

/* Table Dynamic Action Button */
.btn-action-dynamic {
	min-width: 130px;
	width: 9.25rem;
	text-align: center;
	box-sizing: border-box;
}

/* Notices & Alerts */
.alert {
	border-radius: var(--radius-btn);
	border: none;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.plan-change-notice {
	background-color: #fff8e1;
	border: 1px solid #f3e2a4;
	border-radius: var(--radius-btn);
	padding: 1rem;
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
}

.plan-change-notice .title {
	color: #9a6b00;
	font-weight: 700;
	margin-bottom: 0.25rem;
}

.callout-info {
	background-color: #e7f3fb;
	border-radius: var(--radius-btn);
	padding: 0.9rem 1rem;
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	text-align: left;
}

.callout-info .title {
	font-weight: 700;
	margin-bottom: 0.25rem;
}

/* Login instructions (students.php) — quiet dashed helper, not an alert */
.login-helper {
	background-color: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: var(--radius-btn);
	padding: 0.9rem 1rem;
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	color: #475569;
	font-size: 0.875rem;
	line-height: 1.5;
	text-align: left;
}

.login-helper > .bi {
	color: var(--text-muted);
	font-size: 1.25rem;
	margin-top: 0.1rem;
	flex-shrink: 0;
}

.login-helper .title {
	font-weight: 700;
	margin-bottom: 0.25rem;
}

.login-helper a {
	color: var(--brand-primary);
	font-weight: 600;
}

.success-icon,
.error-icon,
.info-icon {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 2.5rem;
}

.success-icon {
	background-color: rgba(40, 167, 69, 0.15);
	color: #28a745;
}

.error-icon {
	background-color: rgba(220, 53, 69, 0.12);
	color: #dc3545;
}

.info-icon {
	background-color: transparent;
	color: var(--brand-primary);
	font-size: 2.75rem;
	width: auto;
	height: auto;
	border-radius: 0;
}

/* Inset tip on information pages (kit §9) — should read clearly against the card */
.info-notice {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	background-color: #eef1f4;
	border: 1px solid #e0e4ea;
	border-radius: var(--radius-btn);
	padding: 1rem 1.15rem;
	color: var(--text-main);
	font-size: 0.875rem;
	line-height: 1.45;
	text-align: left;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.info-notice .bi {
	color: var(--brand-primary);
	font-size: 1.25rem;
	margin-top: 0.05rem;
	flex-shrink: 0;
}

.game-address-box {
	background-color: #e7f3fb;
	border-radius: var(--radius-btn);
	padding: 0.75rem 1rem;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	text-decoration: none !important;
	color: inherit;
}

.game-address-box:hover {
	background-color: #dcf0fc;
}

/* Tables & Avatars */
.table-soft th {
	background-color: #f8f9fb;
	border-top: none;
	border-bottom: 2px solid #f1f3f5;
	color: var(--text-muted);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-weight: 600;
}

.table-soft td {
	vertical-align: middle;
	border-top: 1px solid var(--bg-app);
	padding: 1rem 0.75rem;
	white-space: nowrap;
}

/* Soft row hover for all admin tables (layers over cell backgrounds / stripes) */
.table tbody tr:hover > td,
.table tbody tr:hover > th {
	background-image: linear-gradient(rgba(33, 37, 41, 0.055), rgba(33, 37, 41, 0.055));
}

/* Tight packing for multi-column row actions (e.g. classes.php) */
.table-soft td.classes-action-cell {
	padding-left: 0.2rem;
	padding-right: 0.2rem;
}

.table-soft td.classes-action-cell.classes-action-start {
	padding-left: 0.75rem;
}

/* Sticky leading columns inside .table-responsive (e.g. schools list) */
.table-soft th.sticky-col,
.table-soft td.sticky-col {
	position: sticky;
	z-index: 2;
	background-color: #ffffff;
}

.table-soft thead th.sticky-col {
	background-color: #f8f9fb;
	z-index: 3;
}

.table-soft .sticky-col-id {
	left: 0;
}

.table-soft .sticky-col-name {
	left: 4.5rem;
	min-width: 12rem;
	box-shadow: 6px 0 8px -6px rgba(33, 37, 41, 0.18);
}

.table-date-note {
	font-size: 0.6rem;
}

.avatar-circle {
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-weight: 700;
	font-size: 0.875rem;
	flex-shrink: 0;
}

.badge-soft {
	padding: 0.35rem 0.75rem;
	border-radius: var(--radius-pill);
	font-weight: 600;
	font-size: 0.75rem;
}

.badge-soft-success {
	background-color: #e7f6ee;
	color: #1b7a45;
}

.badge-soft-secondary {
	background-color: #eef0f3;
	color: #5c6570;
}

.badge-soft-warning {
	background-color: #fff4e5;
	color: #b86e00;
}

.badge-soft-primary {
	background-color: #edf5ff;
	color: var(--brand-primary);
}

/* Pricing Table — keep --plan-count for variable column counts */
.plan-table {
	display: grid;
	grid-template-columns: repeat(var(--plan-count, 3), minmax(0, 1fr));
	border: 1px solid #e4e7ee;
	border-radius: var(--radius-card);
	overflow: hidden;
	background: #fff;
	box-shadow: var(--shadow-soft);
}

.plan-table .plan-col {
	display: flex;
	flex-direction: column;
	padding: 2rem;
	border-left: 1px solid #e4e7ee;
}

.plan-table .plan-col:first-child {
	border-left: 0;
}

.plan-table .plan-col.is-current {
	background: #f4f7fb;
}

.plan-table .plan-kicker {
	font-size: 1.1rem;
	font-weight: 600;
	margin-bottom: 0.5rem;
	text-align: center;
}

.plan-table .plan-meta {
	color: var(--text-muted);
	font-size: 0.875rem;
}

.plan-table .plan-note {
	color: var(--text-muted);
	font-size: 0.875rem;
}

.soft-card.pricing-card {
	height: 100%;
	margin-bottom: 0;
	padding: 2rem;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.soft-card.pricing-card:hover {
	box-shadow: var(--shadow-hover);
	transform: translateY(-2px);
}

.soft-card.pricing-card .price {
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.1;
	color: var(--text-main);
}

.soft-card.pricing-card .price-period,
.soft-card.pricing-card .plan-meta {
	color: var(--text-muted);
	font-size: 0.875rem;
}

.plan-table .price {
	font-size: 2.5rem;
	font-weight: 700;
	line-height: 1.1;
	text-align: center;
	color: var(--text-main);
}

.plan-table .price-period {
	color: var(--text-muted);
	text-align: center;
	font-size: 0.875rem;
	margin-bottom: 1rem;
}

.plan-table .plan-save-pill {
	display: inline-block;
	background: #22c55e;
	color: #fff;
	border-radius: var(--radius-pill);
	font-size: 0.75rem;
	font-weight: 700;
	padding: 0.4rem 0.7rem;
	text-align: center;
	margin: 0 auto 1.5rem auto;
}

.plan-features {
	list-style: none;
	padding: 0;
	margin: 0 0 2rem;
	text-align: left;
}

.plan-features li {
	display: flex;
	gap: 0.5rem;
	align-items: flex-start;
	margin-bottom: 0.5rem;
	font-size: 0.875rem;
	color: var(--text-main);
}

.plan-features .bi-check2 {
	color: #6c757d;
	font-size: 1.1rem;
	margin-top: -0.1rem;
}

@media (max-width: 767.98px) {
	.plan-table {
		grid-template-columns: 1fr;
	}

	.plan-table .plan-col {
		border-left: 0;
		border-top: 1px solid #e4e7ee;
	}

	.plan-table .plan-col:first-child {
		border-top: 0;
	}
}

/* Progress Accordion Tables */
.progress-accordion-btn {
	background-color: #e2e6ea;
	color: var(--text-main);
	border: none;
	padding: 1rem 1.5rem;
	width: 100%;
	text-align: left;
	font-weight: 600;
	border-radius: var(--radius-card);
	display: flex;
	align-items: center;
	justify-content: space-between;
	transition: background-color 0.2s;
}

.progress-accordion-btn:focus,
.progress-accordion-btn:hover {
	background-color: #d3d9df;
	outline: none;
	text-decoration: none;
}

.progress-accordion-btn[aria-expanded="true"] {
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
}

.progress-accordion-btn i {
	transition: transform 0.2s;
}

.progress-accordion-btn[aria-expanded="true"] i {
	transform: rotate(180deg);
}

.progress-accordion-body {
	border: 1px solid var(--border-subtle);
	border-top: none;
	border-bottom-left-radius: var(--radius-card);
	border-bottom-right-radius: var(--radius-card);
	padding: 0;
	background: #ffffff;
}

.table-progress {
	margin-bottom: 0;
}

.table-progress th {
	border-top: none;
	border-bottom: 2px solid #f1f3f5;
	color: var(--text-muted);
	font-size: 0.75rem;
	font-weight: 600;
	padding: 1rem 1.5rem;
	white-space: nowrap;
}

.table-progress td {
	vertical-align: middle;
	border-top: 1px solid var(--bg-app);
	padding: 1rem 1.5rem;
	font-size: 0.875rem;
	white-space: nowrap;
}

/* School progress matrix: starter / year / final zoning
   Corner radius lives on the cells (not overflow:hidden) so sticky headers still work. */
.sticky-table.progress-matrix thead tr:first-child th:first-child {
	border-top-left-radius: var(--radius-card);
}

.sticky-table.progress-matrix thead tr:first-child th:last-child {
	border-top-right-radius: var(--radius-card);
}

.sticky-table.progress-matrix tbody tr:last-child td:first-child {
	border-bottom-left-radius: var(--radius-card);
}

.sticky-table.progress-matrix tbody tr:last-child td:last-child {
	border-bottom-right-radius: var(--radius-card);
}

/* Body + unit titles: near-white column tint from the progress mockup */
.sticky-table.progress-matrix .progress-zone-starter {
	background-color: #f9fbff;
}

.sticky-table.progress-matrix .progress-zone-year {
	background-color: #ffffff;
}

.sticky-table.progress-matrix .progress-zone-final {
	background-color: #faf9ff;
}

/* Category row: slightly stronger zone colour */
.sticky-table.progress-matrix thead tr.progress-zone-head th.progress-zone-starter {
	background-color: #ecf2fb;
}

.sticky-table.progress-matrix thead tr.progress-zone-head th.progress-zone-year {
	background-color: #edf2f7;
}

.sticky-table.progress-matrix thead tr.progress-zone-head th.progress-zone-final {
	background-color: #f0f0fb;
}

.sticky-table.progress-matrix .progress-name-head,
.sticky-table.progress-matrix .progress-name-cell {
	background-color: #ffffff;
}

.sticky-table.progress-matrix thead th.progress-name-head,
.sticky-table.progress-matrix tbody td.progress-name-cell {
	position: sticky;
	left: 0;
	padding-right: 0.8rem;
}

.sticky-table.progress-matrix tbody td.progress-name-cell {
	z-index: 2;
}

/* Temporary class while measuring natural one-line name width */
.sticky-table.progress-matrix.progress-zones-measuring thead th.progress-name-head,
.sticky-table.progress-matrix.progress-zones-measuring tbody td.progress-name-cell {
	white-space: nowrap;
	width: 1%;
}

/* Collapsed zones: fill the card; name column = largest name only; leftover grows into units */
.sticky-table.progress-matrix.progress-zones-collapsed {
	width: 100%;
	table-layout: fixed;
}

.sticky-table.progress-matrix.progress-zones-collapsed thead th.progress-name-head,
.sticky-table.progress-matrix.progress-zones-collapsed tbody td.progress-name-cell {
	width: var(--progress-name-col-width, auto);
	max-width: var(--progress-name-col-width, none);
	white-space: nowrap;
}

.sticky-table.progress-matrix.progress-zones-collapsed thead tr.progress-unit-head th.progress-unit-title {
	min-width: 0;
}

.sticky-table.progress-matrix thead tr.progress-zone-head th.progress-name-head {
	z-index: 6;
}

.sticky-table.progress-matrix thead tr.progress-unit-head th.progress-name-head {
	z-index: 5;
}

.sticky-table.progress-matrix thead tr.progress-zone-head th {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #5f6368;
	white-space: nowrap;
	vertical-align: middle;
	padding: 0.45rem 0.5rem;
	border-bottom: 1px solid #dadce0;
	top: 0;
	z-index: 4;
}

.sticky-table.progress-matrix thead tr.progress-zone-head th.progress-zone-toggle {
	cursor: pointer;
	user-select: none;
}

.sticky-table.progress-matrix thead tr.progress-zone-head th.progress-zone-toggle:hover,
.sticky-table.progress-matrix thead tr.progress-zone-head th.progress-zone-toggle:focus {
	filter: brightness(0.97);
	outline: none;
}

.sticky-table.progress-matrix .progress-zone-toggle-inner {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	line-height: 1;
}

.sticky-table.progress-matrix .progress-zone-icon {
	font-size: 0.85rem;
	line-height: 1;
	opacity: 0.85;
}

.sticky-table.progress-matrix .progress-zone-chevron {
	font-size: 0.75rem;
	line-height: 1;
}

.sticky-table.progress-matrix .progress-zone-help {
	font-size: 0.65rem;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	cursor: help;
}

.sticky-table.progress-matrix thead tr.progress-unit-head th {
	/* Matches measured zone-head height; -1px closes subpixel gaps while stuck */
	top: calc(var(--progress-zone-head-height, 2.25rem) - 1px);
	z-index: 3;
}

.sticky-table.progress-matrix thead th.progress-unit-title {
	font-size: 0.72rem;
	font-weight: 500;
	color: #9aa0a6;
	line-height: 1.25;
}

/* Collapsed zone: one slim stub column; zone label spans both header rows */
.sticky-table.progress-matrix.progress-zone-collapsed-starter thead tr.progress-unit-head th[data-zone="starter"],
.sticky-table.progress-matrix.progress-zone-collapsed-starter tbody td[data-zone="starter"]:not([data-zone-lead]),
.sticky-table.progress-matrix.progress-zone-collapsed-year thead tr.progress-unit-head th[data-zone="year"],
.sticky-table.progress-matrix.progress-zone-collapsed-year tbody td[data-zone="year"]:not([data-zone-lead]),
.sticky-table.progress-matrix.progress-zone-collapsed-final thead tr.progress-unit-head th[data-zone="final"],
.sticky-table.progress-matrix.progress-zone-collapsed-final tbody td[data-zone="final"]:not([data-zone-lead]) {
	display: none;
}

.sticky-table.progress-matrix .progress-zone-collapsed-summary {
	display: none;
}

.sticky-table.progress-matrix.progress-zone-collapsed-starter tbody td[data-zone="starter"][data-zone-lead] > *:not(.progress-zone-collapsed-summary),
.sticky-table.progress-matrix.progress-zone-collapsed-year tbody td[data-zone="year"][data-zone-lead] > *:not(.progress-zone-collapsed-summary),
.sticky-table.progress-matrix.progress-zone-collapsed-final tbody td[data-zone="final"][data-zone-lead] > *:not(.progress-zone-collapsed-summary) {
	display: none;
}

.sticky-table.progress-matrix.progress-zone-collapsed-starter tbody td[data-zone="starter"][data-zone-lead] > .progress-zone-collapsed-summary,
.sticky-table.progress-matrix.progress-zone-collapsed-year tbody td[data-zone="year"][data-zone-lead] > .progress-zone-collapsed-summary,
.sticky-table.progress-matrix.progress-zone-collapsed-final tbody td[data-zone="final"][data-zone-lead] > .progress-zone-collapsed-summary {
	display: block;
	font-size: 0.65rem;
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.02em;
	white-space: nowrap;
}

.sticky-table.progress-matrix.progress-zone-collapsed-starter .progress-zone-toggle[data-zone="starter"],
.sticky-table.progress-matrix.progress-zone-collapsed-year .progress-zone-toggle[data-zone="year"],
.sticky-table.progress-matrix.progress-zone-collapsed-final .progress-zone-toggle[data-zone="final"] {
	width: 2.5rem;
	min-width: 2.5rem;
	max-width: 2.75rem;
	padding: 0.6rem 0.25rem;
	vertical-align: middle;
	writing-mode: vertical-rl;
	text-orientation: mixed;
	transform: rotate(180deg);
	overflow: hidden;
	box-sizing: border-box;
}

.sticky-table.progress-matrix.progress-zone-collapsed-starter .progress-zone-toggle[data-zone="starter"] .progress-zone-chevron,
.sticky-table.progress-matrix.progress-zone-collapsed-year .progress-zone-toggle[data-zone="year"] .progress-zone-chevron,
.sticky-table.progress-matrix.progress-zone-collapsed-final .progress-zone-toggle[data-zone="final"] .progress-zone-chevron {
	transform: rotate(180deg);
}

.sticky-table.progress-matrix.progress-zone-collapsed-starter tbody td[data-zone="starter"][data-zone-lead],
.sticky-table.progress-matrix.progress-zone-collapsed-year tbody td[data-zone="year"][data-zone-lead],
.sticky-table.progress-matrix.progress-zone-collapsed-final tbody td[data-zone="final"][data-zone-lead] {
	width: 2.5rem;
	min-width: 2.5rem;
	max-width: 2.75rem;
	padding: 0.25rem;
	overflow: hidden;
	box-sizing: border-box;
	vertical-align: middle;
}

/* Override mastery inline colours so collapsed stubs keep the zone tint */
.sticky-table.progress-matrix.progress-zone-collapsed-starter tbody td[data-zone="starter"][data-zone-lead] {
	background-color: #f9fbff !important;
}

.sticky-table.progress-matrix.progress-zone-collapsed-year tbody td[data-zone="year"][data-zone-lead] {
	background-color: #ffffff !important;
}

.sticky-table.progress-matrix.progress-zone-collapsed-final tbody td[data-zone="final"][data-zone-lead] {
	background-color: #faf9ff !important;
}

/* Medals / Stars */
.medal {
	display: inline-block;
	border: 2px solid white;
}

.medal-lg {
	width: 32px;
	height: 32px;
	border-radius: 50%;
}

.medal-sm {
	width: 16px;
	height: 16px;
}

.medal-bronze {
	background-color: #C98A4A;
}

.medal-silver {
	background-color: #C9CED6;
}

.medal-gold {
	background-color: #E6C14F;
}

.progress-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	align-items: center;
}

.progress-accordion-group {
	margin-bottom: 1rem;
}

.legend-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--text-main);
}

/* Soften sheet modals already used in admin */
.modal.is-sheet .modal-dialog {
	max-width: 440px;
}

.modal.is-sheet .modal-content {
	border: none;
	border-radius: var(--radius-card);
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
	max-height: calc(100vh - 2rem);
	overflow-y: auto;
}

.modal.is-sheet.is-choose .modal-dialog {
	max-width: 520px;
}

.modal.invite-teachers-modal .modal-dialog {
	max-width: 520px;
}

.modal.invite-teachers-modal .modal-content {
	border: none;
	border-radius: var(--radius-card);
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.invite-teachers-modal .invite-section + .invite-section {
	margin-top: 1.25rem;
}

.invite-teachers-modal .invite-link-panel {
	background: #e7f3fb;
	border-radius: var(--radius-btn);
	padding: 1rem;
}

.invite-teachers-modal .invite-link-panel .form-control {
	background: var(--bg-card);
	min-width: 0;
}

.invite-teachers-modal .invite-link-panel .input-group {
	flex-wrap: nowrap;
}

.invite-teachers-modal .invite-join-code {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.85rem;
}

.invite-teachers-modal .invite-action {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-top: 1rem;
}

.invite-teachers-modal .invite-action + .invite-action {
	margin-top: 1rem;
	border-top: var(--border-subtle);
}

.invite-teachers-modal .invite-action .btn {
	flex-shrink: 0;
}

.invite-or-divider {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 1.5rem 0 0;
	color: var(--text-muted);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
}

.invite-or-divider::before,
.invite-or-divider::after {
	content: "";
	flex: 1;
	border-top: var(--border-subtle);
}

@media (max-width: 575.98px) {
	.invite-teachers-modal .invite-action {
		flex-direction: column;
		align-items: stretch;
	}

	.invite-teachers-modal .invite-action .btn {
		width: 100%;
	}
}

.modal-header,
.modal-footer {
	border: none;
}

/* Change-plan child picker in confirm sheet */
.selected-pill {
	display: inline-block;
	background: #eef1f4;
	color: #6b7280;
	border-radius: var(--radius-pill);
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.15rem 0.6rem;
	white-space: nowrap;
}

.selected-pill.is-full {
	background: #d8f5e8;
	color: #157347;
}

.child-choice {
	display: flex;
	align-items: center;
	border-radius: var(--radius-btn);
	border: 1px solid #e6e8ec;
	background: #f3f4f6;
	padding: 0.7rem 0.8rem;
	margin-bottom: 0.45rem;
}

.child-choice.is-kept {
	background: #e7f8f3;
	border-color: #b7ead9;
}

.child-choice.is-dropped {
	background: #f3f4f6;
	border-color: #e6e8ec;
}

.child-choice .custom-control {
	flex: 1 1 auto;
	min-width: 0;
}

.child-choice .custom-control-label {
	width: 100%;
}

.child-choice.is-dropped .custom-control-label {
	color: #6b7280;
}

.downgrade-badge {
	margin-left: 0.75rem;
	background: #e5e7eb;
	color: #6b7280;
	border-radius: var(--radius-pill);
	font-size: 0.75rem;
	font-weight: 600;
	padding: 0.2rem 0.55rem;
	white-space: nowrap;
}

.choice-list {
	max-height: 320px;
	overflow-y: auto;
}

/* Children hub (subscription + login help + table) */
.children-board {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 2rem;
}

.children-board > .soft-card {
	margin-bottom: 0;
}

.children-board .children-section {
	order: 2;
}

.children-board .login-help-card {
	order: 3;
	display: flex;
	flex-direction: column;
}

.children-board .login-help-actions {
	margin-top: auto;
}

.soft-card-footer {
	border-top: var(--border-subtle);
	color: var(--text-muted);
	font-size: 0.875rem;
	padding: 0.75rem 1.5rem;
}

.plan-name {
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.2;
}

.plan-compare {
	display: flex;
	flex-direction: column;
}

.plan-arrow {
	color: #9aa0a6;
	margin: 0.35rem 0;
}

@media (min-width: 992px) {
	.children-board.has-login-help {
		display: grid;
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
		grid-template-areas:
			"subscription help"
			"children children";
		align-items: stretch;
	}

	.children-board.has-login-help .subscription-card {
		grid-area: subscription;
		order: 0;
	}

	.children-board.has-login-help .login-help-card {
		grid-area: help;
		order: 0;
		height: 100%;
	}

	.children-board.has-login-help .children-section {
		grid-area: children;
		order: 0;
	}
}

/* CSV import: source switch, drop zone, compact example table */
.import-switch {
	display: inline-flex;
	flex-wrap: wrap;
	background-color: var(--bg-app);
	border-radius: var(--radius-btn);
	padding: 0.25rem;
	gap: 0.25rem;
}

.import-switch .nav-item {
	margin-bottom: 0;
}

.import-switch .nav-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	border-radius: var(--radius-btn);
	font-weight: 600;
	font-size: 0.875rem;
	color: var(--text-muted);
	padding: 0.45rem 0.85rem;
}

.import-switch .nav-link.active,
.import-switch .show > .nav-link {
	background-color: var(--brand-primary);
	color: #fff;
}

.import-switch .nav-link:not(.active):hover {
	background-color: #e9ecef;
	color: var(--text-main);
}

.dropzone {
	position: relative;
	border: 2px dashed #ced4da;
	border-radius: var(--radius-card);
	background-color: var(--bg-app);
	padding: 2.25rem 1.5rem;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dropzone.is-dragover,
.dropzone:hover {
	border-color: var(--brand-primary);
	background-color: #e7f1ff;
}

.dropzone.is-invalid {
	border-color: #dc3545;
}

.dropzone-icon {
	width: 3.25rem;
	height: 3.25rem;
	border-radius: 50%;
	background-color: #e5e7eb;
	color: var(--brand-primary);
	margin: 0 auto 0.85rem;
	font-size: 1.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.csv-file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
	pointer-events: none;
}

.table-soft.table-compact th,
.table-soft.table-compact td {
	padding: 0.45rem 0.55rem;
	font-size: 0.75rem;
}

@media (min-width: 768px) {
	.plan-compare {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
		align-items: start;
	}

	.plan-leading {
		display: flex;
		align-items: flex-start;
		min-width: 0;
	}

	.plan-arrow {
		flex: 1 1 auto;
		display: flex;
		justify-content: center;
		margin: 1.35rem 0 0;
	}
}
