.mosaico {
	display: grid;
	grid-template-columns: 2fr 1fr;
	grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
	gap: 12px;
	padding: 12px;
	height: calc(100vh - 60px);
	box-sizing: border-box;
}

.tile {
	background: #1c1c1c;
	border-radius: 8px;
	overflow: hidden;
	position: relative;
	color: #eee;
}

.tile-mapa {
	grid-row: span 5;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* ── map tab bar ── */
.map-tabs {
	flex: 0 0 auto;
	display: flex;
	background: #111;
	border: 2px solid #04AA6D;
	border-radius: 6px 6px 0 0;
	overflow: hidden;
	box-shadow: 0 0 10px rgba(4, 170, 109, 0.35);
}

.map-tab {
	flex: 1;
	padding: 13px 14px;
	background: #222;
	color: #777;
	border: none;
	border-bottom: 3px solid transparent;
	cursor: pointer;
	font-size: 0.92em;
	font-weight: bold;
	font-family: inherit;
	letter-spacing: 0.02em;
	transition: color 0.15s, background 0.15s;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.map-tab + .map-tab {
	border-left: 1px solid #333;
}

.map-tab:hover {
	color: #fff;
	background: #2a2a2a;
}

.map-tab.active {
	color: #04AA6D;
	border-bottom-color: #04AA6D;
	background: #1c1c1c;
}

/* ── panel contenedor (uno por pestaña) ── */
.map-panel {
	flex: 1 1 auto;
	position: relative;
	min-height: 0;
	overflow: hidden;
}

/* ── mundo panel embebido: layout flex columna propio ── */
#tab-mundo {
	display: flex;
	flex-direction: column;
}

#tab-mundo #map {
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
}

#tab-mundo #year-nav {
	flex: 0 0 auto;
}

#tab-mundo #timeline-wrap {
	flex: 0 0 160px;
}

.tile-mapa .mapa-ordenes-wrap {
	height: 100%;
	width: 100%;
	max-width: 100%;
	min-height: 300px;
}

.tile-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 48px 16px 16px;
	background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.85));
	pointer-events: none;
}

.tile-overlay a {
	pointer-events: all;
	color: #04AA6D;
	font-size: 14px;
	text-decoration: none;
	font-weight: bold;
}

.tile-overlay a:hover {
	text-decoration: underline;
}

.tile-overlay h3 {
	margin: 0 0 6px;
	font-size: 15px;
	color: #fff;
}

.tile-header {
	padding: 10px 14px 8px;
	font-size: 13px;
	font-weight: bold;
	color: #04AA6D;
	border-bottom: 1px solid #333;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.tile-header a {
	color: inherit;
	text-decoration: none;
}

.tile-header a:hover {
	text-decoration: underline;
}

.tile-body {
	padding: 14px;
}

/* stats fragment */
.stats-asn {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.stats-asn-fila {
	display: flex;
	gap: 8px;
	justify-content: space-around;
}

.stats-asn-item {
	text-align: center;
	flex: 1;
}

.stats-asn-num {
	font-size: 2.2em;
	font-weight: bold;
	color: #e74c3c;
	line-height: 1;
}

.stats-asn-num-menor {
	font-size: 1.6em;
	color: #e67e22;
}

.stats-asn-lbl {
	font-size: 0.7em;
	color: #aaa;
	margin-top: 4px;
}

/* tile de descripcion */
.tile-desc-logo {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}

.tile-desc-logo img {
	height: 40px;
	opacity: 0.9;
}

.tile-desc h2 {
	margin: 0 0 8px;
	font-size: 1em;
	color: #fff;
}

.tile-desc p {
	margin: 0 0 10px;
	font-size: 0.8em;
	color: #aaa;
	line-height: 1.5;
}

.tile-links {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.tile-link {
	display: block;
	padding: 6px 10px;
	background: #2a2a2a;
	border-radius: 4px;
	color: #04AA6D;
	text-decoration: none;
	font-size: 0.8em;
	border-left: 3px solid #04AA6D;
	transition: background 0.15s;
}

.tile-link:hover {
	background: #333;
}

/* kpi economico */
.tile-kpi {
	background: linear-gradient(135deg, #7a5800, #c9960c, #ffd700);
	color: #1a1000;
}

.tile-kpi .tile-header {
	color: #1a1000;
	border-bottom-color: rgba(0,0,0,0.2);
}

.kpi-eco-nombre {
	font-size: 0.72em;
	font-style: italic;
	color: rgba(0,0,0,0.6);
	padding: 0 14px 8px;
}

.kpi-eco-row {
	display: flex;
	gap: 6px;
	justify-content: space-around;
	padding: 0 6px;
}

.kpi-eco-item {
	text-align: center;
	flex: 1;
}

.kpi-eco-val {
	font-size: 1.4em;
	font-weight: bold;
	line-height: 1.1;
}

.kpi-eco-gana     { color: #003300; }
.kpi-eco-arriesga { color: #4a0000; }
.kpi-eco-delta    { color: #000; }

.kpi-eco-lbl {
	font-size: 0.65em;
	color: rgba(0,0,0,0.65);
	margin-top: 3px;
}

/* ── culpables tile ── */
.culpables-top-cards {
	display: flex;
	gap: 8px;
}

.culpable-card {
	flex: 1;
	background: #2a2a2a;
	border-radius: 6px;
	padding: 10px 8px;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-width: 0;
}

.culpable-card-info {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	flex: 1;
	min-width: 0;
	text-align: center;
}

.culpable-card img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 50%;
	border: 2px solid #444;
	flex-shrink: 0;
}

.culpable-nombre {
	color: #eee;
	font-size: 0.72em;
	font-weight: bold;
	line-height: 1.3;
	word-break: break-word;
}

@media (max-width: 768px) {
	.culpables-top-cards {
		flex-direction: column;
	}
}

/* ── tile suicidios ── */
.tile-suicidios {
	background: linear-gradient(150deg, #6b0000, #c0392b);
	color: #fff;
}

.tile-suicidios .tile-header {
	color: #ffcccc;
	border-bottom-color: rgba(255,255,255,0.2);
}

.suicidios-body {
	display: flex;
	align-items: stretch;
	gap: 0;
}

.suicidios-panel {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 8px 4px;
	gap: 4px;
}

.suicidios-separador {
	width: 1px;
	background: rgba(255,255,255,0.25);
	margin: 4px 0;
	flex-shrink: 0;
}

.suicidios-panel-lbl {
	font-size: 0.72em;
	color: rgba(255,255,255,0.7);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.suicidios-panel-num {
	font-size: 2.4em;
	font-weight: bold;
	color: #fff;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	letter-spacing: -1px;
}

.suicidios-panel-izq .suicidios-panel-num {
	color: #ffcccc;
}

.suicidios-countdown-num {
	color: #fff;
}

.suicidios-panel-sub {
	font-size: 0.68em;
	color: rgba(255,255,255,0.55);
}

/* cookie banner */
#cookie-banner {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: #1a1a1a;
	color: #eee;
	padding: 18px 24px;
	z-index: 9999;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	box-shadow: 0 -2px 8px rgba(0,0,0,0.4);
}

#cookie-banner p { margin: 0; flex: 1 1 300px; line-height: 1.5; }
#cookie-banner a { color: #4db8ff; text-decoration: underline; }

.cookie-btns { display: flex; gap: 10px; flex-wrap: wrap; }

#cookie-banner button {
	padding: 8px 18px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: bold;
}

#btn-aceptar  { background: #04AA6D; color: white; }
#btn-rechazar { background: #555;    color: white; }
#btn-aceptar:hover  { background: #038a58; }
#btn-rechazar:hover { background: #333; }

@media (max-width: 768px) {
	.mosaico {
		grid-template-columns: 1fr;
		grid-template-rows: auto;
		height: auto;
	}

	.tile-mapa {
		grid-row: span 1;
		min-height: 400px;
		display: flex;
		flex-direction: column;
		overflow: hidden;
	}

	#tab-mundo #timeline-wrap {
		flex: 0 0 120px;
	}

	.tile-mapa .mapa-ordenes-wrap {
		height: 350px;
	}
}
