/* WordPress-inspired site admin — Mon Darts */

:root {
	--sa-side: #1d2327;
	--sa-side-2: #2c3338;
	--sa-accent: #2271b1;
	--sa-accent-2: #135e96;
	--sa-bg: #f0f0f1;
	--sa-panel: #fff;
	--sa-ink: #1d2327;
	--sa-muted: #646970;
	--sa-line: #c3c4c7;
	--sa-ok: #00a32a;
	--sa-warn: #dba617;
	--sa-danger: #d63638;
}

* { box-sizing: border-box; }

.sa-body {
	margin: 0;
	min-height: 100vh;
	display: grid;
	grid-template-columns: 14.5rem 1fr;
	font-family: "Segoe UI", Tahoma, sans-serif;
	background: var(--sa-bg);
	color: var(--sa-ink);
}

.sa-side {
	background: var(--sa-side);
	color: #f0f0f1;
	padding: 0.85rem 0 1.5rem;
	min-height: 100vh;
	position: sticky;
	top: 0;
	align-self: start;
}

.sa-brand {
	display: flex;
	gap: 0.65rem;
	align-items: center;
	padding: 0.4rem 1rem 1rem;
	color: inherit;
	text-decoration: none;
	font-weight: 700;
	line-height: 1.15;
}

.sa-brand img,
.sa-brand .md-logo {
	flex-shrink: 0;
}

.sa-brand img {
	width: 2.4rem;
	height: 2.4rem;
	object-fit: contain;
	border-radius: 0.3rem;
	background: #fff;
}

.sa-brand .md-logo {
	--md-logo-ink: #f2f4f6;
	font-size: 1.2rem;
}

.sa-brand small {
	font-weight: 500;
	opacity: 0.65;
	font-size: 0.72rem;
}

.sa-nav {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 0 0.5rem;
}

.sa-nav-item {
	display: block;
	width: 100%;
	text-align: left;
	border: 0;
	background: transparent;
	color: #c3c4c7;
	padding: 0.55rem 0.75rem;
	border-radius: 0.25rem;
	font: inherit;
	font-size: 0.9rem;
	cursor: pointer;
	text-decoration: none;
}

.sa-nav-item:hover,
.sa-nav-item.on {
	background: var(--sa-side-2);
	color: #fff;
}

.sa-nav-item.on {
	box-shadow: inset 4px 0 0 var(--sa-accent);
}

.sa-side-note {
	margin: 1.5rem 1rem 0;
	font-size: 0.72rem;
	opacity: 0.55;
	line-height: 1.4;
}

.sa-main {
	min-width: 0;
}

.sa-top {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.4rem;
	background: var(--sa-panel);
	border-bottom: 1px solid var(--sa-line);
}

.sa-top h1 {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 600;
}

.sa-top-actions {
	display: flex;
	gap: 0.6rem;
	align-items: center;
}

.sa-content {
	padding: 1.2rem 1.4rem 2.5rem;
}

.sa-btn {
	appearance: none;
	border: 1px solid var(--sa-accent-2);
	background: var(--sa-accent);
	color: #fff;
	border-radius: 0.2rem;
	padding: 0.4rem 0.85rem;
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
}

.sa-btn:hover { background: var(--sa-accent-2); }
.sa-btn.ghost {
	background: #fff;
	color: var(--sa-ink);
	border-color: var(--sa-line);
}
.sa-btn.danger {
	background: var(--sa-danger);
	border-color: #b32d2e;
}
.sa-btn.ok { background: var(--sa-ok); border-color: #007a20; }
.sa-btn:disabled { opacity: 0.5; cursor: default; }

.sa-status { font-size: 0.8rem; color: var(--sa-muted); }
.sa-muted { color: var(--sa-muted); font-size: 0.88rem; }

.sa-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
	gap: 0.75rem;
	margin-bottom: 1.2rem;
}

.sa-card {
	background: var(--sa-panel);
	border: 1px solid var(--sa-line);
	border-radius: 0.3rem;
	padding: 0.9rem 1rem;
}

.sa-card b {
	display: block;
	font-size: 1.5rem;
	font-variant-numeric: tabular-nums;
}

.sa-card i {
	font-style: normal;
	font-size: 0.78rem;
	color: var(--sa-muted);
}

.sa-panel {
	background: var(--sa-panel);
	border: 1px solid var(--sa-line);
	border-radius: 0.3rem;
	padding: 1rem 1.1rem;
	margin-bottom: 1rem;
}

.sa-panel h2 {
	margin: 0 0 0.75rem;
	font-size: 1rem;
}

.sa-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.88rem;
}

.sa-table th,
.sa-table td {
	text-align: left;
	padding: 0.55rem 0.45rem;
	border-bottom: 1px solid #dcdcde;
	vertical-align: top;
}

.sa-table th { color: var(--sa-muted); font-weight: 600; font-size: 0.75rem; }
.sa-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.sa-table .sa-date {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	font-size: 0.95rem;
	color: #111;
}

.sa-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem 1rem;
}

.sa-form label {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	font-size: 0.8rem;
	font-weight: 600;
}

.sa-form label.full { grid-column: 1 / -1; }

.sa-form input,
.sa-form textarea,
.sa-form select {
	font: inherit;
	font-weight: 400;
	padding: 0.45rem 0.55rem;
	border: 1px solid var(--sa-line);
	border-radius: 0.2rem;
	background: #fff;
}

.sa-form textarea { min-height: 5rem; resize: vertical; }

.sa-row-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: 0.9rem;
}

.sa-badge {
	display: inline-block;
	padding: 0.1rem 0.4rem;
	border-radius: 0.2rem;
	font-size: 0.7rem;
	font-weight: 700;
	background: #f0f0f1;
}
.sa-badge.strong { background: #d5f5e0; color: #007a20; }
.sa-badge.name { background: #e7f0f8; color: #135e96; }
.sa-badge.weak { background: #fcf0d5; color: #8a6d00; }
.sa-badge.conflict { background: #facfd2; color: #8a2424; }

.sa-check-list {
	max-height: 28rem;
	overflow: auto;
	border: 1px solid var(--sa-line);
	border-radius: 0.25rem;
}

.sa-check-item {
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 0.55rem;
	align-items: start;
	padding: 0.55rem 0.7rem;
	border-bottom: 1px solid #eee;
	font-size: 0.85rem;
}

.sa-check-item:last-child { border-bottom: 0; }
.sa-check-item .t { font-weight: 600; }
.sa-check-item .m { color: var(--sa-muted); font-size: 0.75rem; }

.sa-nav-group {
	margin: 0.85rem 0.75rem 0.25rem;
	font-size: 0.68rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #8c8f94;
	font-weight: 700;
}

.sa-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	margin-bottom: 0.85rem;
}

.sa-toolbar input[type="search"] {
	flex: 1;
	min-width: 12rem;
	padding: 0.45rem 0.6rem;
	border: 1px solid var(--sa-line);
	border-radius: 0.2rem;
	font: inherit;
}

.sa-switch {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 600;
	font-size: 0.85rem;
}

.sa-list-edit {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.sa-list-row {
	display: grid;
	grid-template-columns: 1fr 1fr auto;
	gap: 0.4rem;
	align-items: center;
	padding: 0.5rem;
	background: #f6f7f7;
	border-radius: 0.25rem;
}

.sa-list-row input {
	font: inherit;
	padding: 0.35rem 0.45rem;
	border: 1px solid var(--sa-line);
	border-radius: 0.2rem;
}

.sa-alert {
	padding: 0.75rem 0.9rem;
	border-radius: 0.25rem;
	background: #fcf0f1;
	border: 1px solid #f0b7b7;
	color: #8a2424;
	margin-bottom: 1rem;
	font-size: 0.88rem;
}

.sa-badge.warn {
	display: inline-block;
	margin: 0.15rem 0.15rem 0 0;
	padding: 0.12rem 0.4rem;
	border-radius: 0.2rem;
	background: #fcf0d8;
	color: #8a6d00;
	font-size: 0.72rem;
	font-weight: 700;
}

.sa-row-sus {
	opacity: 0.72;
	background: #faf6ef;
}

.sa-series-card {
	background: var(--sa-panel);
	border: 1px solid var(--sa-line);
	border-radius: 0.35rem;
	margin: 0 0 0.55rem;
	padding: 0.55rem 0.75rem;
}

.sa-series-card summary {
	cursor: pointer;
	list-style: none;
}

.sa-series-card summary::-webkit-details-marker {
	display: none;
}

.sa-series-reason {
	margin-top: 0.25rem;
	font-size: 0.82rem;
	color: var(--sa-muted);
}

.sa-series-events {
	margin: 0.55rem 0 0.4rem;
	padding-left: 1.1rem;
	font-size: 0.85rem;
	max-height: 14rem;
	overflow: auto;
}

.sa-series-events code {
	font-size: 0.78rem;
	background: #f0f0f1;
	padding: 0.05rem 0.3rem;
	border-radius: 0.2rem;
}

.sa-series-table-wrap {
	overflow: auto;
	background: #fff;
	border: 1px solid var(--sa-line);
	border-radius: 0.35rem;
	margin: 0.75rem 0 1.5rem;
}

.sa-series-matrix {
	border-collapse: collapse;
	font-size: 0.78rem;
	min-width: 100%;
	width: max-content;
}

.sa-series-matrix th,
.sa-series-matrix td {
	border: 1px solid #b0b8c0;
	padding: 0.3rem 0.35rem;
	text-align: center;
	white-space: nowrap;
}

.sa-series-matrix .col-num {
	background: #eef2f6;
	font-weight: 700;
	width: 2rem;
}

.sa-series-matrix .col-name {
	text-align: left;
	font-weight: 700;
	min-width: 8rem;
	background: #f7f9fb;
	position: sticky;
	left: 0;
	z-index: 1;
}

.sa-series-matrix thead .col-name {
	z-index: 2;
	background: #e8eef5;
}

.sa-series-matrix .col-total {
	font-weight: 800;
	background: #fff;
	min-width: 4.2rem;
}

.sa-btn.ok {
	background: var(--sa-ok);
	border-color: var(--sa-ok);
	color: #fff;
}

@media (max-width: 860px) {
	.sa-body { grid-template-columns: 1fr; }
	.sa-side { position: relative; min-height: 0; }
	.sa-form { grid-template-columns: 1fr; }
	.sa-list-row { grid-template-columns: 1fr; }
}
