/* Latbit Silver Alpha — scoped styles (prefijo .latbit-, sin conflictos con el tema) */

/* ── Overview grid ─────────────────────────────────────────────────────────── */

.latbit-overview {
	font-family: inherit;
}

.latbit-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
}

@media (min-width: 768px) {
	.latbit-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
	.latbit-grid { grid-template-columns: repeat(4, 1fr); }
}

.latbit-card {
	border-radius: 1rem;
	padding: 1.75rem;
	display: flex;
	flex-direction: column;
}

.latbit-card--wide { grid-column: span 1; }

@media (min-width: 768px) {
	.latbit-card--wide { grid-column: span 2; }
}

.latbit-card__title {
	font-size: 1.25rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	line-height: 1.3;
	margin: 0 0 1rem;
}

.latbit-card__desc {
	font-size: 0.875rem;
	line-height: 1.6;
	flex: 1;
	margin: 0 0 1.5rem;
}

.latbit-card__stats {
	margin-bottom: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.latbit-stat { display: flex; flex-direction: column; }

.latbit-stat__value { font-size: 1.75rem; line-height: 1.2; }

.latbit-stat__label { font-size: 0.8125rem; }

.latbit-btn {
	display: inline-block;
	border: 1px solid;
	border-radius: 9999px;
	padding: 0.5rem 1.25rem;
	font-size: 0.875rem;
	font-weight: 500;
	text-decoration: none;
	background: transparent;
	transition: background-color 0.15s ease, color 0.15s ease;
	cursor: pointer;
}

/* ── Fund detail (combined) ────────────────────────────────────────────────── */

.latbit-fund-detail {
	font-family: inherit;
	display: flex;
	flex-direction: column;
	gap: 2.5rem;
}

.latbit-fund-header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1.5rem;
}

.latbit-fund-header__name {
	font-size: 1.5rem;
	font-weight: 700;
	color: #545566;
	margin: 0 0 0.25rem;
}

.latbit-fund-header__isin {
	font-size: 0.8125rem;
	color: #9ca3af;
	margin: 0 0 0.75rem;
}

.latbit-fund-header__desc {
	font-size: 0.875rem;
	line-height: 1.65;
	color: #6b7280;
	max-width: 38rem;
	margin: 0;
}

.latbit-fund-header__kpis { display: flex; gap: 1.5rem; }

.latbit-kpi { text-align: right; display: flex; flex-direction: column; }

.latbit-kpi__value { font-size: 1.5rem; font-weight: 700; color: #545566; }

.latbit-kpi__label { font-size: 0.75rem; color: #9ca3af; }

/* ── Chart card ────────────────────────────────────────────────────────────── */

.latbit-chart-card {
	border: 1px solid #e5e7eb;
	border-radius: 1rem;
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.latbit-chart-stats {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
}

.latbit-chart-stats__label { font-size: 0.875rem; color: #6b7280; margin: 0 0 0.25rem; }

.latbit-chart-stats__nav { font-size: 1.875rem; font-weight: 700; color: #111827; margin: 0; }

.latbit-chart-stats__date { font-size: 0.75rem; color: #9ca3af; margin: 0.25rem 0 0; }

.latbit-chart-stats__right { text-align: right; }

.latbit-chart-stats__return { font-size: 1.5rem; font-weight: 600; margin: 0; }

.latbit-chart-stats__since { font-size: 0.75rem; color: #9ca3af; margin: 0.25rem 0 0; }

/* Period selector */
.latbit-period-selector { display: flex; flex-wrap: wrap; gap: 0.25rem; }

.latbit-period-btn {
	padding: 0.25rem 0.75rem;
	border-radius: 0.25rem;
	font-size: 0.75rem;
	font-weight: 500;
	border: none;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
	background-color: #f3f4f6;
	color: #6b7280;
}

.latbit-period-btn--active,
.latbit-period-btn:hover {
	background-color: #545566;
	color: #fff;
}

/* Chart canvas */
.latbit-chart-wrap { position: relative; height: 18rem; width: 100%; }

/* Download */
.latbit-download-row { display: flex; justify-content: flex-end; }

.latbit-download-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	border: 1px solid #e5e7eb;
	border-radius: 0.375rem;
	padding: 0.375rem 0.75rem;
	font-size: 0.75rem;
	font-weight: 500;
	color: #4b5563;
	text-decoration: none;
	background: #fff;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.latbit-download-btn:hover {
	background-color: #f9fafb;
	border-color: #d1d5db;
	color: #1f2937;
}

.latbit-download-btn svg { width: 0.875rem; height: 0.875rem; flex-shrink: 0; }

/* ── Sections & tables ─────────────────────────────────────────────────────── */

.latbit-section { display: flex; flex-direction: column; gap: 1rem; }

.latbit-section__title { font-size: 1.25rem; font-weight: 700; color: #545566; margin: 0 0 0.25rem; }

.latbit-section__sub { font-size: 0.875rem; color: #9ca3af; margin: 0; }

.latbit-two-col {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
}

@media (min-width: 768px) {
	.latbit-two-col { grid-template-columns: repeat(2, 1fr); }
}

.latbit-table-wrap {
	overflow-x: auto;
	border: 1px solid #e5e7eb;
	border-radius: 0.75rem;
}

.latbit-table-note { font-size: 0.75rem; color: #9ca3af; margin: 0; }

.latbit-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

.latbit-table__th {
	padding: 0.75rem 1.25rem;
	font-weight: 600;
	color: #545566;
	border-bottom: 1px solid #f3f4f6;
}

.latbit-table__th--left   { text-align: left; }
.latbit-table__th--right  { text-align: right; }
.latbit-table__th--center { text-align: center; }

.latbit-table__row {
	border-bottom: 1px solid #f9fafb;
	transition: background-color 0.1s;
}

.latbit-table__row:last-child { border-bottom: none; }

.latbit-table__row:hover { background-color: #f9fafb; }

.latbit-table__td { padding: 0.75rem 1.25rem; color: #545566; }

.latbit-table__td--left   { text-align: left; font-weight: 500; }
.latbit-table__td--right  { text-align: right; }
.latbit-table__td--center { text-align: center; }

/* ── Horizontal table → vertical on mobile ─────────────────────────────────── */

@media (max-width: 767px) {
	.latbit-table--h thead { display: none; }

	.latbit-table--h tbody tr {
		display: block;
		border-bottom: 1px solid #e5e7eb;
	}

	.latbit-table--h tbody tr:last-child { border-bottom: none; }

	.latbit-table--h tbody td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0.65rem 1.25rem;
		border-bottom: 1px solid #f9fafb;
		text-align: right;
	}

	.latbit-table--h tbody td:last-child { border-bottom: none; }

	.latbit-table--h tbody td::before {
		content: attr(data-label);
		font-weight: 600;
		color: #545566;
		text-align: left;
		margin-right: 1rem;
		flex-shrink: 0;
	}
}

/* ── Return colours ────────────────────────────────────────────────────────── */

.latbit-return--pos     { color: #059669; font-weight: 500; }
.latbit-return--neg     { color: #dc2626; font-weight: 500; }
.latbit-return--neutral { color: #9ca3af; }

/* ── Footer & errors ───────────────────────────────────────────────────────── */

.latbit-footer {
	border-top: 1px solid #f3f4f6;
	padding: 1.25rem 0 0.5rem;
	text-align: center;
	font-size: 0.75rem;
	color: #9ca3af;
}

.latbit-error { color: #dc2626; font-size: 0.875rem; }
