/* Meal Prep Planner — public stylesheet (v1.0.1)
 *
 * v1.0.1 — CSS specificity hotfix:
 *   Raised `.mpp-input` / `.mpp-input--week` / `.mpp-select` to
 *   `.mpp-app input.mpp-input` / `.mpp-app input.mpp-input--week` /
 *   `.mpp-app input.mpp-select` / `.mpp-app select.mpp-select` so they
 *   beat the PenciDesign / pennews theme's `input[type="text"]` and
 *   `input[type="number"]` rules. Live QA on v1.0.0 showed 38 of 47 plugin
 *   inputs computing to 12px on that theme; v1.0.1 raises them to 14px
 *   (week grid) and 16px (grocery / batch / leftover forms). No markup
 *   change, no behavior change.
 *
 * v1.0.0 design direction: align with the released KnifeKettle plugin
 * family (Kitchen Converters v1.0.4, Baking Calculator Suite v1.0.13,
 * BudgetFlow Pro v1.3.6, Recipe Cost Calculator v1.0.4). Same indigo
 * accent #4f46e5, same slate text scale, same light slate page
 * background, same white cards with soft borders, same solid-indigo
 * active tab, same indigo-gradient result card.
 *
 * IMPORTANT — sizing:
 *   Explicit px values, not rem, because the PenciDesign theme sets
 *   html { font-size: 10px }. Using rem would shrink every element
 *   to ~60% of intended. All text meets the 13px floor; controls use
 *   16px (matches the family and prevents iOS auto-zoom on focus).
 *
 * v1.0.0 design rules:
 *   - Light theme ONLY.
 *   - Container max-width 1180px on desktop.
 *   - Page background slate-50 (#f8fafc) on the .mpp-app root.
 *   - Header is a white card with 14px radius top corners, attached
 *     to the tab strip (no border between them).
 *   - Tab strip is a white card with 1px slate-200 border; tabs use a
 *     flex-wrap pill pattern.
 *   - Active tab is solid indigo #4f46e5 with white text.
 *   - Inactive tabs are transparent with slate-600 text, slate-100
 *     on hover.
 *   - Section cards are white, 14px radius, soft shadow.
 *   - Result card uses a light indigo-50/100 gradient with indigo-900
 *     text and a soft indigo shadow.
 *   - Validation message is a soft red card #fef2f2 with #fecaca
 *     border and #991b1b text.
 *   - Mobile-first; stacks vertically below 720px.
 *   - All selectors scoped under .mpp-app.
 */

/* ---------- root container ---------- */

.mpp-app {
	background: #f8fafc;
	color: #0f172a;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 15px;
	line-height: 1.5;
	padding: 16px;
	-webkit-text-size-adjust: 100%;
}

.mpp-app *,
.mpp-app *::before,
.mpp-app *::after {
	box-sizing: border-box;
}

.mpp-app__container {
	max-width: 1180px;
	margin: 0 auto;
	background: transparent;
}

/* ---------- header card ---------- */

.mpp-app__header {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-bottom: none;
	border-top-left-radius: 14px;
	border-top-right-radius: 14px;
	padding: 20px 24px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.mpp-app__title {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 4px 0;
	color: #0f172a;
	letter-spacing: -0.01em;
}

.mpp-app__subtitle {
	font-size: 14px;
	color: #475569;
	margin: 0;
}

/* ---------- tab strip ---------- */

.mpp-app__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-bottom: none;
	padding: 8px 12px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.mpp-tab {
	appearance: none;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 10px;
	color: #475569;
	cursor: pointer;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	padding: 9px 16px;
	transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
	min-height: 38px;
}

.mpp-tab:hover {
	background: #f1f5f9;
	color: #1e293b;
}

.mpp-tab:focus-visible {
	outline: 2px solid #4f46e5;
	outline-offset: 2px;
}

.mpp-tab--active,
.mpp-tab[aria-selected="true"] {
	background: #4f46e5;
	border-color: #4f46e5;
	color: #ffffff;
}

.mpp-tab--active:hover,
.mpp-tab[aria-selected="true"]:hover {
	background: #4338ca;
	border-color: #4338ca;
	color: #ffffff;
}

/* ---------- body container ---------- */

.mpp-app__body {
	background: transparent;
}

/* ---------- panel ---------- */

.mpp-panel {
	display: block;
}

.mpp-panel[hidden] {
	display: none;
}

/* ---------- card ---------- */

.mpp-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-top: none;
	border-bottom-left-radius: 14px;
	border-bottom-right-radius: 14px;
	padding: 24px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.mpp-card__title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 4px 0;
	color: #0f172a;
}

.mpp-card__hint {
	font-size: 13px;
	color: #64748b;
	margin: 0 0 16px 0;
}

/* ---------- forms ---------- */

.mpp-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.mpp-form--inline {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 10px;
}

.mpp-form__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.mpp-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.mpp-field--grow {
	flex: 1 1 240px;
}

.mpp-field__label {
	font-size: 13px;
	font-weight: 600;
	color: #475569;
}

.mpp-app input.mpp-input,
.mpp-app input.mpp-select,
.mpp-app select.mpp-input,
.mpp-app select.mpp-select {
	appearance: none;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	color: #0f172a;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.4;
	padding: 9px 12px;
	min-height: 40px;
	transition: border-color 120ms ease, box-shadow 120ms ease;
	width: 100%;
}

.mpp-app input.mpp-input--week {
	font-size: 14px;
	min-height: 36px;
	padding: 6px 10px;
}

.mpp-input:hover,
.mpp-select:hover {
	border-color: #94a3b8;
}

.mpp-input:focus,
.mpp-select:focus {
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
	outline: none;
}

.mpp-input[aria-invalid="true"],
.mpp-select[aria-invalid="true"] {
	border-color: #dc2626;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.mpp-select {
	background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3e%3cpath d='M1 1L6 6L11 1' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 32px;
}

/* ---------- buttons ---------- */

.mpp-btn {
	appearance: none;
	background: #f1f5f9;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	color: #0f172a;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	gap: 6px;
	min-height: 40px;
	padding: 8px 16px;
	transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
	white-space: nowrap;
}

.mpp-btn:hover {
	background: #e2e8f0;
	border-color: #94a3b8;
}

.mpp-btn:focus-visible {
	outline: 2px solid #4f46e5;
	outline-offset: 2px;
}

.mpp-btn--primary {
	background: #4f46e5;
	border-color: #4f46e5;
	color: #ffffff;
}

.mpp-btn--primary:hover {
	background: #4338ca;
	border-color: #4338ca;
	color: #ffffff;
}

.mpp-btn--ghost {
	background: transparent;
	border-color: #cbd5e1;
	color: #334155;
}

.mpp-btn--ghost:hover {
	background: #f8fafc;
	border-color: #94a3b8;
}

.mpp-btn--danger {
	background: #fef2f2;
	border-color: #fecaca;
	color: #991b1b;
}

.mpp-btn--danger:hover {
	background: #fee2e2;
	border-color: #fca5a5;
	color: #7f1d1d;
}

.mpp-btn--xs {
	font-size: 13px;
	min-height: 30px;
	padding: 4px 10px;
}

.mpp-btn--file {
	position: relative;
	cursor: pointer;
}

.mpp-btn--file input[type="file"] {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	width: 100%;
	height: 100%;
}

/* ---------- validation ---------- */

.mpp-validation {
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	color: #991b1b;
	font-size: 13px;
	padding: 8px 12px;
}

.mpp-validation[hidden] {
	display: none;
}

.mpp-validation:empty {
	display: none;
}

/* ---------- result card ---------- */

.mpp-result {
	background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
	border: 1px solid #c7d2fe;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(79, 70, 229, 0.1);
	color: #312e81;
	font-size: 14px;
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.mpp-result__line {
	font-weight: 500;
}

.mpp-result__line strong {
	font-weight: 700;
}

/* ---------- weekly grid ---------- */

.mpp-week-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.mpp-week {
	border-collapse: separate;
	border-spacing: 0;
	width: 100%;
	min-width: 640px;
	font-size: 14px;
}

.mpp-week th,
.mpp-week td {
	border-bottom: 1px solid #f1f5f9;
	padding: 8px 10px;
	text-align: left;
	vertical-align: middle;
}

.mpp-week thead th {
	background: #f8fafc;
	color: #475569;
	font-size: 13px;
	font-weight: 600;
	position: sticky;
	top: 0;
	z-index: 1;
}

.mpp-week tbody th {
	background: #f8fafc;
	color: #0f172a;
	font-weight: 700;
	font-size: 13px;
	width: 60px;
	white-space: nowrap;
}

.mpp-week tbody tr:last-child th,
.mpp-week tbody tr:last-child td {
	border-bottom: none;
}

/* ---------- grocery list ---------- */

.mpp-grocery {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 16px;
}

.mpp-empty {
	color: #94a3b8;
	font-size: 14px;
	font-style: italic;
	margin: 0;
	padding: 12px 0;
}

.mpp-grocery__group {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 12px 14px;
}

.mpp-grocery__group-title {
	font-size: 13px;
	font-weight: 700;
	color: #4f46e5;
	margin: 0 0 8px 0;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.mpp-grocery__items {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.mpp-grocery__item {
	display: grid;
	grid-template-columns: 1fr auto auto auto;
	gap: 10px;
	align-items: center;
	padding: 6px 0;
	border-bottom: 1px solid #e2e8f0;
}

.mpp-grocery__item:last-child {
	border-bottom: none;
}

.mpp-grocery__name {
	color: #0f172a;
	font-size: 14px;
	font-weight: 500;
}

.mpp-grocery__qty {
	color: #312e81;
	font-size: 14px;
	font-weight: 700;
	text-align: right;
	min-width: 50px;
	font-variant-numeric: tabular-nums;
}

.mpp-grocery__unit {
	color: #64748b;
	font-size: 13px;
	min-width: 50px;
}

/* ---------- checklist ---------- */

.mpp-checklist {
	list-style: none;
	margin: 16px 0 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mpp-checklist__item {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 10px;
	align-items: center;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 10px 12px;
}

.mpp-checklist__item--done {
	opacity: 0.65;
}

.mpp-checklist__row {
	display: flex;
	gap: 10px;
	align-items: center;
	cursor: pointer;
	user-select: none;
}

.mpp-checklist__check {
	width: 18px;
	height: 18px;
	accent-color: #4f46e5;
	cursor: pointer;
}

.mpp-checklist__text {
	font-size: 14px;
	color: #0f172a;
}

.mpp-checklist__item--done .mpp-checklist__text {
	text-decoration: line-through;
	color: #64748b;
}

.mpp-checklist__progress {
	display: flex;
	gap: 12px;
	align-items: center;
	margin: 12px 0 4px 0;
}

.mpp-checklist__bar {
	background: #e2e8f0;
	border-radius: 999px;
	flex: 1;
	height: 8px;
	overflow: hidden;
}

.mpp-checklist__fill {
	background: #4f46e5;
	height: 100%;
	transition: width 200ms ease;
	width: 0;
}

.mpp-checklist__percent {
	font-size: 13px;
	font-weight: 700;
	color: #4f46e5;
	font-variant-numeric: tabular-nums;
	min-width: 50px;
	text-align: right;
}

/* ---------- footer ---------- */

.mpp-app__footer {
	background: transparent;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-top: 16px;
	padding: 0 4px;
}

.mpp-app__localstorage-note {
	flex: 1 1 100%;
	font-size: 13px;
	color: #64748b;
	margin: 0;
	padding-top: 4px;
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
	.mpp-app {
		padding: 12px;
	}

	.mpp-app__header {
		padding: 16px 18px;
	}

	.mpp-app__title {
		font-size: 20px;
	}

	.mpp-card {
		padding: 18px;
	}

	.mpp-form--inline {
		flex-direction: column;
		align-items: stretch;
	}

	.mpp-form__row {
		grid-template-columns: 1fr;
	}

	.mpp-app__tabs {
		overflow-x: auto;
		flex-wrap: nowrap;
		-webkit-overflow-scrolling: touch;
	}

	.mpp-tab {
		flex-shrink: 0;
	}

	.mpp-grocery__item {
		grid-template-columns: 1fr auto;
	}

	.mpp-grocery__qty,
	.mpp-grocery__unit {
		grid-column: 2;
		text-align: right;
	}

	.mpp-grocery__name {
		grid-column: 1;
	}
}

@media (max-width: 480px) {
	.mpp-app__header {
		padding: 14px;
	}

	.mpp-card {
		padding: 14px;
	}

	.mpp-app__title {
		font-size: 18px;
	}
}

/* ---------- admin status page ---------- */

.mpp-admin {
	max-width: 880px;
}

.mpp-admin__card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 18px 22px;
	margin: 16px 0;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.mpp-admin__card h2 {
	font-size: 15px;
	font-weight: 700;
	color: #4f46e5;
	margin: 0 0 8px 0;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.mpp-admin__card p {
	margin: 0 0 8px 0;
	font-size: 14px;
	color: #0f172a;
}

.mpp-admin__card code {
	background: #f1f5f9;
	border-radius: 4px;
	color: #312e81;
	font-size: 13px;
	padding: 2px 6px;
}

.mpp-admin__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mpp-admin__list li {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 6px 0;
	font-size: 14px;
}

.mpp-admin__ok {
	background: #dcfce7;
	border: 1px solid #86efac;
	border-radius: 4px;
	color: #166534;
	font-size: 13px;
	font-weight: 600;
	padding: 2px 8px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.mpp-admin__err {
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 4px;
	color: #991b1b;
	font-size: 13px;
	font-weight: 600;
	padding: 2px 8px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
