/* ============================================================
   MRT HQ Customer Portal Styles
   ============================================================ */

.mrt-hq-customer-portal {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	max-width: 900px;
	margin: 0 auto;
	color: #1e293b;
}

/* ---- Navigation ---- */
.mrt-portal-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	list-style: none;
	padding: 0;
	margin: 0 0 24px 0;
	border-bottom: 2px solid #e2e8f0;
}

.mrt-portal-nav li a {
	display: block;
	padding: 10px 18px;
	font-size: 0.9rem;
	font-weight: 500;
	color: #64748b;
	text-decoration: none;
	border-radius: 6px 6px 0 0;
	transition: all .2s;
}

.mrt-portal-nav li a:hover,
.mrt-portal-nav li.active a {
	color: #2563eb;
	background: #eff6ff;
	border-bottom: 2px solid #2563eb;
	margin-bottom: -2px;
}

/* ---- Cards ---- */
.mrt-portal-card {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 28px;
	margin-bottom: 20px;
	box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.mrt-portal-card h3 {
	margin: 0 0 20px;
	font-size: 1.25rem;
	color: #0f172a;
}

.mrt-portal-card h4 {
	font-size: 1rem;
	color: #334155;
	margin: 20px 0 12px;
}

.mrt-learner-card,
.mrt-kit-card,
.mrt-shipment-row {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 16px;
}

.mrt-learner-name {
	font-size: 1.1rem;
	font-weight: 600;
	margin-bottom: 8px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.mrt-learner-meta {
	font-size: 0.85rem;
	color: #64748b;
	margin-bottom: 14px;
}

/* ---- Tables ---- */
.mrt-portal-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.mrt-portal-table th {
	text-align: left;
	color: #64748b;
	font-weight: 500;
	padding: 8px 12px 8px 0;
	width: 35%;
	vertical-align: top;
}

.mrt-portal-table td {
	padding: 8px 0;
	color: #1e293b;
}

.mrt-table-wrap {
	overflow-x: auto;
}

.mrt-table-wrap .mrt-portal-table th,
.mrt-table-wrap .mrt-portal-table td {
	padding: 10px 14px;
	width: auto;
}

.mrt-table-wrap thead {
	background: #f1f5f9;
}

/* ---- Badges ---- */
.mrt-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: .02em;
}

.mrt-badge-green  { background: #dcfce7; color: #166534; }
.mrt-badge-red    { background: #fee2e2; color: #991b1b; }
.mrt-badge-orange { background: #ffedd5; color: #9a3412; }
.mrt-badge-yellow { background: #fef9c3; color: #854d0e; }
.mrt-badge-blue   { background: #dbeafe; color: #1e40af; }
.mrt-badge-grey   { background: #f1f5f9; color: #475569; }
.mrt-badge-gold   { background: #fef08a; color: #713f12; }

/* ---- Buttons ---- */
.mrt-portal-btn {
	display: inline-block;
	padding: 10px 20px;
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	border: none;
	text-align: center;
	transition: all .2s;
}

.mrt-btn-primary  { background: #2563eb; color: #fff; }
.mrt-btn-primary:hover { background: #1d4ed8; }
.mrt-btn-secondary { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; }
.mrt-btn-secondary:hover { background: #e2e8f0; }
.mrt-btn-danger   { background: #ef4444; color: #fff; }
.mrt-btn-danger:hover { background: #dc2626; }
.mrt-btn-ghost    { background: transparent; color: #64748b; border: 1px solid #e2e8f0; }
.mrt-btn-ghost:hover { background: #f8fafc; }

.mrt-portal-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 20px;
}

/* ---- Notices ---- */
.mrt-portal-notice {
	padding: 14px 18px;
	border-radius: 8px;
	margin-bottom: 16px;
	font-size: 0.9rem;
	line-height: 1.6;
}

.mrt-notice-info    { background: #eff6ff; border-left: 4px solid #3b82f6; color: #1e3a8a; }
.mrt-notice-warning { background: #fffbeb; border-left: 4px solid #f59e0b; color: #78350f; }
.mrt-notice-error   { background: #fee2e2; border-left: 4px solid #ef4444; color: #7f1d1d; }

/* ---- Support Grid ---- */
.mrt-support-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px;
	margin-top: 16px;
}

.mrt-support-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	padding: 18px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	text-decoration: none;
	color: #1e293b;
	transition: all .2s;
}

.mrt-support-card:hover {
	border-color: #2563eb;
	background: #eff6ff;
}

.mrt-support-icon { font-size: 1.5rem; }
.mrt-support-card strong { font-size: 0.95rem; }
.mrt-support-card span   { font-size: 0.8rem; color: #64748b; }

/* ---- Modal ---- */
.mrt-modal {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.5);
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mrt-modal-inner {
	background: #fff;
	border-radius: 16px;
	padding: 40px;
	max-width: 480px;
	width: 90%;
	box-shadow: 0 20px 50px rgba(0,0,0,.2);
}

.mrt-modal-inner h3 {
	margin: 0 0 16px;
	font-size: 1.2rem;
}

.mrt-modal-inner p {
	color: #475569;
	line-height: 1.6;
	margin: 0 0 24px;
}

.mrt-muted {
	color: #94a3b8;
	font-size: 0.875rem;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
	.mrt-portal-nav ul { gap: 2px; }
	.mrt-portal-nav li a { padding: 8px 12px; font-size: 0.8rem; }
	.mrt-portal-card { padding: 18px; }
	.mrt-support-grid { grid-template-columns: 1fr 1fr; }
	.mrt-subject-progress-grid { grid-template-columns: 1fr; }
}

/* ---- Subject Progress Grid (My Children tab) ---- */
.mrt-subject-progress-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-top: 16px;
}

.mrt-subject-card {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.mrt-subject-card.mrt-subject-active {
	border-color: #bfdbfe;
	background: #eff6ff;
}

.mrt-subject-card.mrt-subject-locked {
	opacity: .75;
}

.mrt-subject-header {
	font-size: 1rem;
	font-weight: 600;
}

.mrt-subject-level {
	font-size: 0.8rem;
	color: #334155;
}

.mrt-progress-bar-wrap {
	height: 6px;
	background: #e2e8f0;
	border-radius: 99px;
	overflow: hidden;
}

.mrt-progress-bar {
	height: 100%;
	background: #2563eb;
	border-radius: 99px;
	transition: width 0.4s ease;
}

.mrt-progress-pct {
	font-size: 0.75rem;
	color: #64748b;
}

.mrt-lesson-hint {
	font-size: 0.78rem;
	color: #64748b;
	font-style: italic;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mrt-subject-card .mrt-portal-btn {
	margin-top: auto;
	font-size: 0.82rem;
	padding: 8px 12px;
	text-align: center;
}

/* ---- Pack 6C: Config Error card state ---- */
.mrt-subject-card.mrt-subject-config-error {
	border: 1px dashed #fca5a5;
	background: #fff5f5;
	opacity: 1;
}

.mrt-config-error-hint {
	font-size: 0.78rem;
	color: #ef4444;
	line-height: 1.5;
}

/* ---- Pack 6C: Shared Account notice ---- */
.mrt-notice-shared-account {
	background: #f0f9ff;
	border-left: 4px solid #0ea5e9;
	color: #0c4a6e;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 12px;
	font-size: 0.85rem;
	line-height: 1.6;
}

.mrt-notice-shared-account .mrt-notice-icon {
	flex-shrink: 0;
	font-size: 1.1rem;
	margin-top: 1px;
}

.mrt-notice-shared-account .mrt-notice-body {
	flex: 1;
}

/* ---- Error notice link colour ---- */
.mrt-notice-error a {
	color: #991b1b;
	font-weight: 600;
}

.mrt-notice-error a:hover {
	text-decoration: underline;
}

/* ---- Assessment hint on ready card ---- */
.mrt-assessment-hint {
	font-size: 0.78rem;
	color: #475569;
	line-height: 1.5;
	border-top: 1px solid #e2e8f0;
	padding-top: 6px;
}
