/**
 * Creator LMS — MAR sheet baseline styles.
 *
 * Shared by the admin builder, learner runner, and review mode.
 * Brand colors come from the plugin's Design settings via the
 * CSS variables emitted on the frontend (`--creator-lms-primary-color`
 * etc.) — admins pages inject the same vars locally.
 *
 * All rules are scoped under `.crlms-mar-sheet` so they never leak.
 */

.crlms-mar-sheet {
	--crlms-mar-border: #d0d0d0;
	--crlms-mar-border-strong: #b7b9bd;
	--crlms-mar-header-bg: #fafafa;
	--crlms-mar-surface: #ffffff;
	--crlms-mar-muted-text: #7f7f7d;
	--crlms-mar-text: #333333;

	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	color: var(--crlms-mar-text);
	background: var(--crlms-mar-surface);
	box-sizing: border-box;
	overflow-x: auto;
	max-width: 100%;
}

.crlms-mar-sheet * {
	box-sizing: border-box;
}

.crlms-mar-sheet .crlms-mar-title {
	font-size: 16px;
	font-weight: 700;
	color: #495057;
	text-align: center;
	padding: 12px 30px;
	margin: 0 0 10px;
	letter-spacing: 0.12em;
	word-spacing: 0.25em;
}

/* --- Grid core --------------------------------------------------- */

.crlms-mar-grid {
	min-width: max-content;
	border-bottom: 1px solid var(--crlms-mar-border);
}

.crlms-mar-row {
	display: flex;
}

.crlms-mar-cell {
	border: 1px solid var(--crlms-mar-border);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	font-size: 12px;
	color: var(--crlms-mar-text);
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.crlms-mar-cell-header {
	background: var(--crlms-mar-header-bg);
	color: var(--crlms-mar-muted-text);
	font-size: 12px;
	font-weight: 500;
}

/* --- Front sheet dimensions -------------------------------------- */

.crlms-mar-cell-med-heading,
.crlms-mar-cell-hour-heading,
.crlms-mar-cell-day-heading {
	height: 22px;
}

.crlms-mar-cell-med-heading { width: 200px; }
.crlms-mar-cell-hour-heading { width: 72px; }
.crlms-mar-cell-day-heading { width: 60px; }

.crlms-mar-cell-medication {
	width: 200px;
	height: 192px;
	font-size: 11px;
	line-height: 1.3;
	padding: 8px;
}

.crlms-mar-cell-hour {
	width: 72px;
	height: 48px;
	font-size: 11px;
}

.crlms-mar-cell-day {
	width: 60px;
	height: 48px;
	font-size: 11px;
}

.crlms-mar-body-column {
	display: flex;
	flex-direction: column;
}

.crlms-mar-body-column-med { width: 200px; }
.crlms-mar-body-column-hour { width: 72px; }
.crlms-mar-body-column-day { width: 60px; }

/* --- Front bottom section --------------------------------------- */

.crlms-mar-bottom {
	border-bottom: 1px solid var(--crlms-mar-border);
}

.crlms-mar-bottom-row {
	display: flex;
	height: 48px;
	border-bottom: 1px solid var(--crlms-mar-border);
}

.crlms-mar-bottom-group {
	display: flex;
	flex: 1;
	border-top: 1px solid var(--crlms-mar-border);
}

.crlms-mar-bottom-label {
	background: var(--crlms-mar-header-bg);
	width: 100px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-left: 1px solid var(--crlms-mar-border);
	border-right: 1px solid var(--crlms-mar-border);
	font-size: 10px;
	color: var(--crlms-mar-muted-text);
	text-align: center;
	padding: 4px;
	line-height: 1.15;
}

.crlms-mar-bottom-value {
	background: var(--crlms-mar-surface);
	flex: 1;
	border-right: 1px solid var(--crlms-mar-border);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	font-size: 11px;
	min-height: 48px;
}

.crlms-mar-patient-row {
	display: flex;
	height: 50px;
	border-top: 1px solid var(--crlms-mar-border);
}

.crlms-mar-patient-label {
	background: var(--crlms-mar-header-bg);
	width: 80px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-left: 1px solid var(--crlms-mar-border);
	border-right: 1px solid var(--crlms-mar-border);
	font-size: 10px;
	color: var(--crlms-mar-muted-text);
}

.crlms-mar-patient-cell {
	background: var(--crlms-mar-surface);
	border-right: 1px solid var(--crlms-mar-border);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	font-size: 11px;
	min-height: 50px;
}

/* --- Back sheet ------------------------------------------------- */

.crlms-mar-back {
	display: flex;
	gap: 0;
}

.crlms-mar-back-left {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.crlms-mar-back-right {
	width: 300px;
	display: flex;
	flex-direction: column;
	border-top: 1px solid var(--crlms-mar-border);
}

.crlms-mar-section-title {
	background: var(--crlms-mar-surface);
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--crlms-mar-border);
	border-bottom: none;
	color: var(--crlms-mar-muted-text);
	font-size: 14px;
}

.crlms-mar-table-header {
	display: flex;
	height: 45px;
	background: var(--crlms-mar-header-bg);
}

.crlms-mar-data-row {
	display: flex;
	height: 45px;
}

.crlms-mar-data-row .crlms-mar-cell,
.crlms-mar-table-header .crlms-mar-cell {
	font-size: 11px;
}

/* --- Builder / runner / review mode overlays (added later) ------ */

.crlms-mar-sheet.is-builder-mode [data-cell] {
	cursor: pointer;
}

.crlms-mar-sheet [data-cell].is-dropzone {
	outline: 2px solid var(--creator-lms-primary-color, #6e42d3);
	outline-offset: -2px;
	background: rgba(var(--creator-lms-primary-color-rgb, 110, 66, 211), 0.06);
}

.crlms-mar-sheet [data-cell].is-drag-over {
	background: rgba(var(--creator-lms-primary-color-rgb, 110, 66, 211), 0.18);
}

.crlms-mar-sheet [data-cell].is-correct {
	background: #eefbf2;
	box-shadow: inset 0 0 0 2px #2f9e44;
}

.crlms-mar-sheet [data-cell].is-incorrect {
	background: #fdecec;
	box-shadow: inset 0 0 0 2px #c92a2a;
}
