/**
 * Mustvee — Statistika kaart
 * Avalik kuvamine + frontend inline-redigeerija.
 */

/* ── Kaart (avalik vaade) ───────────────────────────────────────────── */
.mv-stat-list {
	position: relative;
	background: #EAF1F9;
	border-radius: 12px;
	padding: 26px 28px 18px;
	margin-bottom: 16px;
}

.mv-stat-list__head {
	border-bottom: 2px solid var(--wp--preset--color--mv-tekst, #1A2838);
	padding-bottom: 14px;
	margin-bottom: 8px;
}

.mv-stat-list__title,
.mv-stat-list__date {
	font-family: "Fraunces", Georgia, serif;
	font-size: 27px;
	line-height: 1.12;
	font-weight: 600;
	color: var(--wp--preset--color--mv-tekst, #1A2838);
}

.mv-stat-list__rows {
	padding-top: 6px;
}

.mv-stat-list__row {
	padding: 13px 2px;
	border-bottom: 1px solid rgba(26, 40, 56, .10);
	font-size: 16px;
	line-height: 1.4;
	color: var(--wp--preset--color--mv-tekst, #1A2838);
}

.mv-stat-list__row:last-child {
	border-bottom: 0;
}

.mv-stat-list__label {
	font-weight: 600;
	color: var(--wp--preset--color--mv-sinine-hele, #185FA5);
}

.mv-stat-list__label::after {
	content: ":";
}

.mv-stat-list__row.is-highlight .mv-stat-list__label {
	font-weight: 700;
	color: var(--wp--preset--color--mv-tekst, #1A2838);
}

.mv-stat-list__value {
	font-weight: 400;
	color: var(--wp--preset--color--mv-tekst, #1A2838);
}

.mv-stat-list__label + .mv-stat-list__value {
	margin-left: .35em;
}

/* ── Redigeerimisnupp (ainult sisseloginud adminile) ─────────────────── */
.mv-stat-list__editbtn {
	position: absolute;
	top: 14px;
	right: 14px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	padding: 6px 11px;
	color: #fff;
	background: var(--wp--preset--color--mv-sinine-hele, #185FA5);
	border: 0;
	border-radius: 6px;
	cursor: pointer;
	z-index: 2;
}

.mv-stat-list__editbtn:hover,
.mv-stat-list__editbtn:focus-visible {
	background: var(--wp--preset--color--mv-sinine, #04213E);
}

/* ── Inline-redigeerija vorm ─────────────────────────────────────────── */
.mv-stat-edit {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.mv-stat-edit__group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mv-stat-edit__lbl {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--wp--preset--color--mv-tekst-muted, #5A6975);
}

.mv-stat-edit input[type="text"] {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	font-family: inherit;
	font-size: 14px;
	color: var(--wp--preset--color--mv-tekst, #1A2838);
	background: #fff;
	border: 1px solid #c5d4e6;
	border-radius: 6px;
}

.mv-stat-edit input[type="text"]:focus {
	outline: 2px solid var(--wp--preset--color--mv-sinine-hele, #185FA5);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--mv-sinine-hele, #185FA5);
}

.mv-stat-edit__rows {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.mv-stat-edit__row {
	display: flex;
	flex-direction: column;
	gap: 6px;
	background: #fff;
	border: 1px solid #dbe5f2;
	border-radius: 8px;
	padding: 8px;
}

.mv-stat-edit__ctrls {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.mv-stat-edit__hl {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	color: var(--wp--preset--color--mv-tekst, #1A2838);
	margin-right: auto;
	cursor: pointer;
}

.mv-stat-edit__iconbtn {
	width: 30px;
	height: 30px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	line-height: 1;
	color: var(--wp--preset--color--mv-tekst, #1A2838);
	background: #eef3fa;
	border: 1px solid #d3deee;
	border-radius: 6px;
	cursor: pointer;
}

.mv-stat-edit__iconbtn:hover {
	background: #dfe9f6;
}

.mv-stat-edit__iconbtn--del:hover {
	background: #f6dede;
	border-color: #e3b6b6;
}

.mv-stat-edit__iconbtn:disabled {
	opacity: .4;
	cursor: default;
}

.mv-stat-edit__add {
	align-self: flex-start;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	padding: 8px 12px;
	color: var(--wp--preset--color--mv-sinine-hele, #185FA5);
	background: #fff;
	border: 1px dashed var(--wp--preset--color--mv-sinine-hele, #185FA5);
	border-radius: 7px;
	cursor: pointer;
}

.mv-stat-edit__add:hover {
	background: #eef3fa;
}

.mv-stat-edit__actions {
	display: flex;
	gap: 8px;
	margin-top: 4px;
}

.mv-stat-edit__btn {
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	padding: 9px 16px;
	border-radius: 7px;
	border: 0;
	cursor: pointer;
}

.mv-stat-edit__btn--save {
	color: #fff;
	background: var(--wp--preset--color--mv-sinine-hele, #185FA5);
}

.mv-stat-edit__btn--save:hover {
	background: var(--wp--preset--color--mv-sinine, #04213E);
}

.mv-stat-edit__btn--save:disabled {
	opacity: .6;
	cursor: default;
}

.mv-stat-edit__btn--cancel {
	color: var(--wp--preset--color--mv-tekst, #1A2838);
	background: #e3eaf3;
}

.mv-stat-edit__btn--cancel:hover {
	background: #d3deee;
}

/* Teade */
.mv-stat-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%) translateY(12px);
	z-index: 99999;
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	border-radius: 8px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}

.mv-stat-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.mv-stat-toast--success {
	background: #2F8F5E;
}

.mv-stat-toast--error {
	background: #B23A48;
}
