/* LMS Registration Manager — Frontend Portal Styles */

.lms-rm-portal {
	max-width: 100%;
	width: 100%;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Force full width — break out of Elementor/theme containers */
.lms-rm-portal {
	box-sizing: border-box;
}

/* On portal pages: prevent MasterStudy float menu from pushing main content */
body:has(.lms-rm-portal) {
	padding-left: 0 !important;
	margin-left: 0 !important;
}

body:has(.lms-rm-portal) .container,
body:has(.lms-rm-portal) .pages-template,
body:has(.lms-rm-portal) .page-content,
body:has(.lms-rm-portal) .entry-content {
	max-width: 100% !important;
	width: 100% !important;
	margin-left: 0 !important;
	padding-left: 15px !important;
	padding-right: 15px !important;
}

/* The float menu adds padding/margin to body or a wrapper — override it */
body:has(.lms-rm-portal).stm_lms_float_menu_opened,
body:has(.lms-rm-portal).stm-lms-float-menu,
body:has(.lms-rm-portal)[class*="float_menu"],
body:has(.lms-rm-portal)[style*="padding-left"],
body:has(.lms-rm-portal)[style*="margin-left"] {
	padding-left: 0 !important;
	margin-left: 0 !important;
}

/* Override any inline style the float menu JS sets on body */
body:has(.lms-rm-portal) #wrapper,
body:has(.lms-rm-portal) .wrapper,
body:has(.lms-rm-portal) > .site,
body:has(.lms-rm-portal) > div:first-of-type {
	margin-left: 0 !important;
	padding-left: 0 !important;
}

/* Portal fills its parent widget container naturally */
.elementor-shortcode:has(.lms-rm-portal),
.elementor-widget-container:has(.lms-rm-portal) {
	width: 100% !important;
	max-width: 100% !important;
}

/* Set portal container width */
.e-con-boxed:has(.lms-rm-portal) > .e-con-inner {
	max-width: 1366px !important;
}

.lms-rm-portal-header {
	background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
	color: #fff;
	padding: 20px 30px;
	border-radius: 8px 8px 0 0;
}

.lms-rm-portal-header h2 {
	margin: 0;
	font-size: 22px;
	color: #fff;
}

/* Tab navigation */
.lms-rm-portal-tabs {
	display: flex;
	flex-wrap: wrap;
	background: #f8f9fa;
	border-bottom: 2px solid #0073aa;
	padding: 0 10px;
}

.lms-rm-tab {
	display: inline-block;
	padding: 12px 18px;
	text-decoration: none;
	color: #555;
	font-size: 14px;
	font-weight: 500;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	transition: all 0.2s;
}

.lms-rm-tab:hover {
	color: #0073aa;
	background: rgba(0, 115, 170, 0.05);
}

.lms-rm-tab.active {
	color: #0073aa;
	border-bottom-color: #0073aa;
	font-weight: 600;
}

/* Portal content area */
.lms-rm-portal-content {
	background: #fff;
	padding: 25px 30px;
	border: 1px solid #ddd;
	border-top: none;
	border-radius: 0 0 8px 8px;
	min-height: 400px;
}

/* Stats grid */
.lms-rm-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 15px;
	margin-bottom: 30px;
}

.lms-rm-stat-card {
	background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
	border: 1px solid #e0e5ec;
	border-radius: 10px;
	padding: 22px 20px;
	text-align: center;
	transition: box-shadow 0.2s, transform 0.2s;
}

.lms-rm-stat-card:hover {
	box-shadow: 0 4px 12px rgba(0, 115, 170, 0.12);
	transform: translateY(-2px);
}

.lms-rm-stat-number {
	font-size: 36px;
	font-weight: 800;
	color: #0073aa;
	line-height: 1;
}

.lms-rm-stat-label {
	font-size: 12px;
	color: #666;
	margin-top: 6px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 500;
}

/* Admin company switcher bar */
.lms-rm-admin-bar {
	display: flex;
	align-items: stretch;
	background: linear-gradient(135deg, #1B4F72 0%, #2874A6 100%);
	border-radius: 10px;
	padding: 0;
	margin-bottom: 25px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(27, 79, 114, 0.2);
}

.lms-rm-admin-bar-section {
	padding: 14px 20px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
	flex: 1;
}

.lms-rm-admin-bar-section:first-child {
	flex: 1.2;
}

.lms-rm-admin-bar-divider {
	width: 1px;
	background: rgba(255, 255, 255, 0.2);
	margin: 10px 0;
}

.lms-rm-admin-bar-label {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: rgba(255, 255, 255, 0.7);
	font-weight: 600;
}

.lms-rm-admin-bar-select {
	background: #fff;
	border: 1px solid rgba(255, 255, 255, 0.5);
	color: #1B4F72;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	width: 100%;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3e%3cpath fill='%231B4F72' d='M6 8L0 0h12z'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 10px;
	padding-right: 32px;
}

.lms-rm-admin-bar-select option {
	color: #1B4F72;
	background: #fff;
	font-weight: 500;
}

.lms-rm-admin-bar-form {
	display: flex;
	gap: 8px;
}

.lms-rm-admin-bar-input {
	background: #fff;
	border: 1px solid rgba(255, 255, 255, 0.5);
	color: #1B4F72;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	flex: 1;
	min-width: 0;
}

.lms-rm-admin-bar-input::placeholder {
	color: #7a99b3;
	font-weight: 400;
}

.lms-rm-admin-bar-input:focus,
.lms-rm-admin-bar-select:focus {
	outline: 2px solid #fff;
	outline-offset: 1px;
}

.lms-rm-admin-bar-btn {
	background: #fff;
	color: #1B4F72;
	border: none;
	padding: 8px 18px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.2s, transform 0.1s;
}

.lms-rm-admin-bar-btn:hover {
	background: #e8f4fd;
	transform: translateY(-1px);
}

.lms-rm-admin-bar-btn span {
	font-size: 16px;
	font-weight: 800;
}

@media (max-width: 768px) {
	.lms-rm-admin-bar {
		flex-direction: column;
	}
	.lms-rm-admin-bar-divider {
		width: auto;
		height: 1px;
		margin: 0 10px;
	}
}

/* Dashboard section headings */
.lms-rm-dashboard h3 {
	font-size: 18px;
	color: #1B4F72;
	margin: 25px 0 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid #e9ecef;
}

/* Forms */
.lms-rm-portal .lms-rm-form-row {
	display: flex;
	gap: 10px;
	margin-bottom: 8px;
	align-items: center;
}

.lms-rm-portal input[type="text"],
.lms-rm-portal input[type="email"],
.lms-rm-portal select,
.lms-rm-portal textarea {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
}

.lms-rm-portal .btn {
	display: inline-block;
	padding: 10px 20px;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
}

.lms-rm-portal .btn-primary {
	background: #0073aa;
	color: #fff;
}

.lms-rm-portal .btn-primary:hover {
	background: #005177;
}

.lms-rm-portal .btn-secondary {
	background: #f0f0f0;
	color: #333;
	border: 1px solid #ddd;
}

.lms-rm-portal .btn-danger {
	background: #dc3545;
	color: #fff;
}

/* Tables */
.lms-rm-portal table {
	width: 100%;
	border-collapse: collapse;
	margin: 15px 0;
	table-layout: fixed;
}

.lms-rm-portal th,
.lms-rm-portal td {
	padding: 8px 10px;
	text-align: left;
	border-bottom: 1px solid #eee;
	vertical-align: middle;
	font-size: 13px;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.lms-rm-portal th {
	background: #f8f9fa;
	font-weight: 600;
	font-size: 12px;
	color: #555;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	white-space: nowrap;
	position: sticky;
	top: 0;
	z-index: 1;
}

.lms-rm-portal tr:hover td {
	background: #f8f9fa;
}

/* Progress table specific column widths */
#lms-rm-progress-table {
	table-layout: fixed;
}
#lms-rm-progress-table th:nth-child(1),
#lms-rm-progress-table td:nth-child(1) { width: 12%; } /* Student */
#lms-rm-progress-table th:nth-child(2),
#lms-rm-progress-table td:nth-child(2) { width: 18%; font-size: 12px; } /* Email */
#lms-rm-progress-table th:nth-child(3),
#lms-rm-progress-table td:nth-child(3) { width: 12%; } /* Specialty */
#lms-rm-progress-table th:nth-child(4),
#lms-rm-progress-table td:nth-child(4) { width: 10%; } /* Location */
#lms-rm-progress-table th:nth-child(5),
#lms-rm-progress-table td:nth-child(5) { width: 18%; } /* Course */
#lms-rm-progress-table th:nth-child(6),
#lms-rm-progress-table td:nth-child(6) { width: 12%; } /* Progress */
#lms-rm-progress-table th:nth-child(7),
#lms-rm-progress-table td:nth-child(7) { width: 8%; text-align: center; } /* Status */
#lms-rm-progress-table th:nth-child(8),
#lms-rm-progress-table td:nth-child(8) { width: 10%; font-size: 12px; } /* Started */

/* Zebra striping for readability */
.lms-rm-portal tbody tr:nth-child(even) td {
	background: #fafbfc;
}
.lms-rm-portal tbody tr:hover td {
	background: #eef4fa;
}

/* Matrix in portal */
.lms-rm-portal #matrix-container {
	border: 1px solid #ddd;
	border-radius: 4px;
	overflow: auto;
}

/* Handsontable lives inside .lms-rm-portal which has global td/th padding rules.
   Those leak in and make the frozen (left) table rows taller than the scrolling
   (right) table rows — the two drift out of sync and checkboxes no longer sit
   on the same baseline as their labels. Override everything back to a tight,
   uniform 32px row and let Handsontable's rowHeights match. */
.lms-rm-portal #matrix-container .handsontable td,
.lms-rm-portal #matrix-container .handsontable th {
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	padding: 0 8px !important;
	height: 32px !important;
	line-height: 32px !important;
	box-sizing: border-box !important;
	vertical-align: middle !important;
	font-size: 13px !important;
}

/* Checkbox columns: click anywhere to toggle (handled in JS) — show the pointer */
.lms-rm-portal #matrix-container .handsontable td.htCenter.htMiddle {
	cursor: pointer;
	text-align: center;
}

.lms-rm-portal #matrix-container .handsontable td.htCenter.htMiddle:hover {
	background: #eef4fa !important;
}

.lms-rm-portal #matrix-container .handsontable td.lmsRmRepeatCell {
	color: #b0b8c0;
	font-style: italic;
}

.lms-rm-portal #matrix-container .handsontable td.lmsRmPlaceholderRow {
	background: #fff9e6 !important;
	color: #8a6d3b !important;
	font-style: italic;
}

/* Status messages */
.lms-rm-status {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 3px;
	font-size: 13px;
}

.lms-rm-status.success {
	background: #d4edda;
	color: #155724;
}

.lms-rm-status.error {
	background: #f8d7da;
	color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
	.lms-rm-portal-tabs {
		flex-direction: column;
	}
	.lms-rm-tab {
		border-bottom: none;
		border-left: 3px solid transparent;
	}
	.lms-rm-tab.active {
		border-left-color: #0073aa;
		border-bottom-color: transparent;
	}
}

/* ─── Hierarchical course-picker tree (Enroller) ──────────── */
.lms-rm-enroller-admin {
	background: #fff8e1;
	border: 1px solid #ffd54f;
	border-radius: 8px;
	padding: 18px 22px;
	margin: 15px 0;
}

.lms-rm-enroller-admin h4 {
	margin: 0 0 8px;
	color: #856404;
	font-size: 16px;
}

.lms-rm-enroller-admin > p {
	color: #856404;
	margin: 0 0 12px;
}

.lms-rm-tree-controls {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.lms-rm-tree {
	background: #fff;
	border: 1px solid #e9ecef;
	border-radius: 6px;
	padding: 12px 14px;
	max-height: 480px;
	overflow-y: auto;
}

.lms-rm-tree-node {
	margin: 0;
}

.lms-rm-tree-row {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px 0;
	line-height: 1.5;
}

.lms-rm-tree-row label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	font-size: 14px;
	color: #1B4F72;
	user-select: none;
}

.lms-rm-tree-toggle {
	width: 20px;
	height: 20px;
	padding: 0;
	background: transparent;
	border: none;
	color: #6c757d;
	cursor: pointer;
	font-size: 11px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.lms-rm-tree-toggle:hover {
	color: #1B4F72;
}

.lms-rm-tree-spacer {
	width: 20px;
	display: inline-block;
}

.lms-rm-tree-children {
	margin-left: 26px;
	border-left: 1px dashed #d0d7de;
	padding-left: 10px;
}

.lms-rm-tree-top > .lms-rm-tree-row label {
	font-weight: 700;
}

.lms-rm-tree-sub > .lms-rm-tree-row label {
	font-weight: 500;
	color: #2874A6;
}

.lms-rm-tree-leaf > .lms-rm-tree-row label {
	font-weight: 400;
	color: #333;
}

.lms-rm-tree-badge {
	color: #28a745;
	font-size: 11px;
	margin-left: 6px;
}

.lms-rm-tree-submit {
	margin-top: 14px;
}

/* Tri-state checkbox visual: indeterminate gets a dash overlay */
.lms-rm-tree-cb:indeterminate {
	opacity: 0.85;
}

/* ─── Active-instance bar + bootstrap card (Matrix tab) ─── */
.lms-rm-instance-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	background: #eef4fa;
	border: 1px solid #c3d8ec;
	border-left: 4px solid #0073aa;
	border-radius: 6px;
	padding: 10px 14px;
	margin: 10px 0 16px;
	flex-wrap: wrap;
}

.lms-rm-instance-label {
	color: #555;
	font-size: 13px;
	margin-right: 6px;
}

.lms-rm-instance-meta {
	color: #777;
	font-size: 12px;
	margin-left: 8px;
	font-style: italic;
}

.lms-rm-instance-resync .btn-small {
	padding: 6px 12px;
	font-size: 12px;
}

.lms-rm-instance-bootstrap {
	background: #fff8e1;
	border: 1px solid #ffd54f;
	border-radius: 8px;
	padding: 18px 22px;
	margin: 15px 0;
}

.lms-rm-instance-bootstrap h4 {
	margin: 0 0 8px;
	color: #856404;
}

.lms-rm-instance-bootstrap p {
	color: #856404;
	margin: 0 0 12px;
}

.lms-rm-instance-form {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
}

.lms-rm-instance-form select {
	min-width: 280px;
}
