/* سامانه شیرخشک — Frontend RTL */

.mpm-frontend {
	--mpm-bg: #f8fafc;
	--mpm-surface: #ffffff;
	--mpm-ink: #0f172a;
	--mpm-muted: #64748b;
	--mpm-border: #e2e8f0;
	--mpm-accent: #0f766e;
	--mpm-accent-hover: #0d9488;
	--mpm-danger: #dc2626;
	--mpm-ok-bg: #ecfdf5;
	--mpm-ok-ink: #065f46;
	--mpm-err-bg: #fef2f2;
	--mpm-err-ink: #991b1b;
	--mpm-radius: 14px;
	font-family: Vazirmatn, Tahoma, sans-serif;
	color: var(--mpm-ink);
	line-height: 1.45;
}

.mpm-frontend *,
.mpm-frontend *::before,
.mpm-frontend *::after {
	box-sizing: border-box;
}

.mpm-shell {
	max-width: 520px;
	margin: 0 auto;
}

.mpm-shell--wide {
	max-width: 960px;
}

.mpm-panel {
	background: var(--mpm-surface);
	border: 1px solid var(--mpm-border);
	border-radius: var(--mpm-radius);
	padding: 16px 14px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.mpm-badge {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--mpm-accent);
	background: #f0fdfa;
	border: 1px solid #ccfbf1;
	border-radius: 999px;
	padding: 4px 10px;
	margin-bottom: 8px;
}

.mpm-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 800;
}

.mpm-subtitle {
	margin: 6px 0 14px;
	color: var(--mpm-muted);
	font-size: 0.86rem;
}

.mpm-kicker {
	margin: 0;
	font-size: 0.72rem;
	color: var(--mpm-muted);
}

.mpm-notice {
	border-radius: 10px;
	padding: 10px 12px;
	margin-bottom: 12px;
	font-size: 0.86rem;
}

.mpm-notice-success {
	background: var(--mpm-ok-bg);
	color: var(--mpm-ok-ink);
	border: 1px solid #a7f3d0;
}

.mpm-notice-error {
	background: var(--mpm-err-bg);
	color: var(--mpm-err-ink);
	border: 1px solid #fecaca;
}

.mpm-form {
	display: grid;
	gap: 10px;
}

.mpm-field {
	display: grid;
	gap: 4px;
}

.mpm-field span {
	font-size: 0.78rem;
	color: var(--mpm-muted);
	font-weight: 600;
}

.mpm-field input,
.mpm-field select {
	width: 100%;
	border: 1px solid var(--mpm-border);
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 0.92rem;
	font-family: inherit;
	background: #fff;
	color: var(--mpm-ink);
}

.mpm-field input:focus,
.mpm-field select:focus {
	outline: none;
	border-color: var(--mpm-accent);
	box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.mpm-topbar {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 12px;
}

.mpm-topbar-actions {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
}

.mpm-pill {
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--mpm-accent);
	background: #f0fdfa;
	border: 1px solid #99f6e4;
	border-radius: 999px;
	padding: 4px 10px;
	white-space: nowrap;
}

.mpm-btn {
	appearance: none;
	border: none;
	border-radius: 8px;
	padding: 10px 14px;
	font-size: 0.86rem;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.15s ease;
	white-space: nowrap;
}

.mpm-btn-primary {
	background: var(--mpm-accent);
	color: #fff;
}

.mpm-btn-primary:hover {
	background: var(--mpm-accent-hover);
}

.mpm-btn-ghost {
	background: #fff;
	color: var(--mpm-muted);
	border: 1px solid var(--mpm-border);
	padding: 7px 12px;
}

.mpm-btn-danger {
	background: #fff;
	color: var(--mpm-danger);
	border: 1px solid #fecaca;
}

.mpm-btn-xs {
	padding: 5px 8px;
	font-size: 0.72rem;
	line-height: 1;
	min-width: 28px;
}

.mpm-list-section h3 {
	margin: 0 0 4px;
	font-size: 0.92rem;
}

.mpm-list-hint {
	margin: 0 0 10px;
	font-size: 0.78rem;
	color: var(--mpm-muted);
}

/* Shared 4-column grid */
.mpm-grid-4 {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 8px;
}

.mpm-grid-cell {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 8px;
	border: 1px solid var(--mpm-border);
	border-radius: 10px;
	background: #fafbfc;
	min-height: 88px;
}

.mpm-grid-cell--active {
	background: #f0fdfa;
	border-color: #99f6e4;
}

.mpm-grid-cell-name {
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--mpm-ink);
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.7em;
}

.mpm-grid-cell-form {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	margin-top: auto;
}

.mpm-grid-input {
	width: 100%;
	min-width: 0;
	flex: 1;
	border: 1px solid var(--mpm-border);
	border-radius: 7px;
	padding: 6px 4px;
	font-size: 0.82rem;
	font-family: inherit;
	text-align: center;
	font-variant-numeric: tabular-nums;
	background: #fff;
}

.mpm-grid-input:focus {
	outline: none;
	border-color: var(--mpm-accent);
}

.mpm-grid-cell-delete {
	position: absolute;
	top: 4px;
	left: 4px;
	margin: 0;
}

.mpm-grid-cell-delete .mpm-btn-xs {
	padding: 2px 6px;
	font-size: 0.85rem;
	line-height: 1.1;
}

.mpm-empty {
	color: var(--mpm-muted);
	background: #f8fafc;
	border: 1px dashed var(--mpm-border);
	border-radius: 10px;
	padding: 12px;
	font-size: 0.86rem;
}

.mpm-logout-form {
	margin: 0;
}

@media (max-width: 900px) {
	.mpm-grid-4 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.mpm-grid-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mpm-topbar {
		flex-direction: column;
	}

	.mpm-topbar-actions {
		width: 100%;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}
}

@media (max-width: 400px) {
	.mpm-grid-4 {
		grid-template-columns: 1fr;
	}
}
