:root {
	--bg: #f6f7f9;
	--panel: #ffffff;
	--text: #1d2330;
	--muted: #667085;
	--line: #e3e6eb;
	--accent: #2f6fde;
	--accent-text: #ffffff;
	--ok: #1f8a4c;
	--warn: #b7791f;
	--info: #2f6fde;
	--off: #8a94a6;
	--danger: #c0392b;
	--bar: #2f6fde;
	--bar2: #f4a63b;
	--radius: 10px;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #12151b;
		--panel: #1b2029;
		--text: #e6e9ef;
		--muted: #98a2b3;
		--line: #2c3340;
		--accent: #6b9cff;
		--accent-text: #0d1117;
		--ok: #4cc38a;
		--warn: #e0a84a;
		--info: #6b9cff;
		--off: #7d8799;
		--danger: #ef6b5b;
		--bar: #6b9cff;
		--bar2: #f4b860;
		color-scheme: dark;
	}
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
	background: var(--bg);
	color: var(--text);
	font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }
a { color: var(--accent); }
h1 { font-size: 1.35rem; margin: 0 0 12px; }
h2 { font-size: 1.1rem; margin: 20px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono { font-family: ui-monospace, Consolas, monospace; word-break: break-all; }

.topbar {
	position: sticky; top: 0; z-index: 5;
	display: flex; align-items: center; gap: 12px;
	padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; }
.who { margin-left: auto; color: var(--muted); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; }

.layout { display: flex; min-height: calc(100vh - 50px); }
.sidenav {
	width: 210px; flex: none; padding: 12px; border-right: 1px solid var(--line); background: var(--panel);
	display: flex; flex-direction: column; gap: 2px;
}
.sidenav a { padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.sidenav a.active { background: var(--accent); color: var(--accent-text); }
.main { flex: 1; min-width: 0; padding: 20px; max-width: 1200px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .v { font-size: 1.6rem; font-weight: 650; }
.stat .k { color: var(--muted); font-size: 0.85rem; }

form.stack { display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; }
label.inline { flex-direction: row; align-items: center; gap: 6px; }
input, select, button { font: inherit; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], select {
	padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); min-width: 0;
}
button {
	padding: 8px 14px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
	cursor: pointer;
}
button.secondary { background: transparent; color: var(--accent); }
button:disabled { opacity: 0.55; cursor: default; }
.link-btn { background: none; border: none; color: var(--accent); padding: 4px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.error { color: var(--danger); }
.notice { color: var(--ok); }
.center-box { max-width: 420px; margin: 40px auto; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; color: #fff; white-space: nowrap; }
.badge.released { background: var(--ok); }
.badge.coming_soon { background: var(--warn); }
.badge.scheduled { background: var(--info); }
.badge.hidden { background: var(--off); }
.badge.new { background: var(--danger); }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td input[type=number] { width: 72px; }

.carousel { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; }
.tile {
	flex: none; width: 92px; min-height: 92px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg);
	display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
	padding: 6px; font-size: 0.72rem; position: relative;
}
.tile .big { font-size: 1.6rem; line-height: 1; }
.tile.soon { border-style: dashed; border-color: var(--warn); }
.tile .star { position: absolute; top: 2px; right: 6px; color: var(--danger); font-size: 1rem; }

.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .bar { fill: var(--bar); }
.chart .bar2 { fill: var(--bar2); }
.chart .axis { stroke: var(--line); }
.legend { display: flex; gap: 12px; font-size: 0.8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.legend i.c1 { background: var(--bar); }
.legend i.c2 { background: var(--bar2); }

.qr { width: 220px; height: 220px; background: #fff; border-radius: 8px; padding: 6px; }
.acct { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.audit-detail { font-size: 0.8rem; color: var(--muted); }

@media (max-width: 760px) {
	.menu-btn { display: inline-block; background: none; color: var(--text); border: 1px solid var(--line); padding: 4px 10px; }
	.brand { font-size: 0.95rem; }
	.who { display: none; }
	.layout { display: block; }
	.sidenav { width: auto; border-right: none; border-bottom: 1px solid var(--line); }
	.sidenav.collapsed { display: none; }
	.main { padding: 14px 16px; }
	.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	/* Catálogo como tarjetas en el celular */
	table.cat thead { display: none; }
	table.cat tr { display: block; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 6px; }
	table.cat td { display: flex; justify-content: space-between; gap: 8px; border: none; padding: 4px 6px; }
	table.cat td::before { content: attr(data-label); color: var(--muted); font-size: 0.8rem; }
}
td.mono { word-break: normal; white-space: nowrap; }
