/* -------------------------------------------------------------------------
   Solana Asset Tracker — Dashboard
   Colors injected as CSS custom properties via wp_add_inline_style.
   ------------------------------------------------------------------------- */

.sat-dashboard {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: var(--sat-text, #111827);
	box-sizing: border-box;
}

.sat-dashboard *,
.sat-dashboard *::before,
.sat-dashboard *::after {
	box-sizing: inherit;
}

/* ---- Cards ---- */

.sat-card {
	background: var(--sat-card-bg, #ffffff);
	border-radius: 12px;
	padding: 20px;
}

/* ---- Top row: distribution + portfolio value ---- */

.sat-top-row {
	display: grid;
	grid-template-columns: 1fr 1.6fr;
	gap: 16px;
	margin-bottom: 16px;
}

@media (max-width: 680px) {
	.sat-top-row {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.sat-table th:last-child,
	.sat-table td:last-child {
		display: none;
	}
}

/* ---- Distribution panel ---- */

.sat-distribution .sat-card-title {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--sat-muted, #6b7280);
	margin: 0 0 14px;
}

.sat-donut-legend-wrap {
	display: flex;
	align-items: center;
	gap: 16px;
}

.sat-donut-wrap {
	position: relative;
	flex: 0 0 160px;
	height: 160px;
}

.sat-donut-wrap canvas {
	width: 100% !important;
	height: 100% !important;
}

.sat-legend {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
	align-items: flex-end;
}

.sat-legend-item {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	white-space: nowrap;
}

.sat-legend-dot {
	flex: 0 0 10px;
	height: 10px;
	border-radius: 50%;
}

.sat-legend-pct {
	color: var(--sat-muted, #6b7280);
}

.sat-legend-symbol {
	font-weight: 600;
}

/* ---- Portfolio value panel ---- */

.sat-portfolio-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
	flex-wrap: wrap;
}

.sat-portfolio-header .sat-card-title {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--sat-muted, #6b7280);
	margin: 0;
}

.sat-range-tabs {
	display: flex;
	gap: 4px;
}

.sat-range-btn {
	padding: 3px 10px;
	border-radius: 6px;
	border: 1px solid var(--sat-border, #e5e7eb);
	background: transparent;
	cursor: pointer;
	font-size: 12px;
	font-weight: 600;
	color: var(--sat-muted, #6b7280);
	transition: background 0.15s, color 0.15s;
}

.sat-range-btn.active {
	background: var(--sat-line-color, var(--sat-accent, #9945FF));
	border-color: var(--sat-line-color, var(--sat-accent, #9945FF));
	color: #fff;
}

.sat-sol-price {
	margin-left: auto;
	font-size: 12px;
	color: var(--sat-muted, #6b7280);
}

.sat-sol-price strong {
	color: var(--sat-text, #111827);
}

.sat-line-wrap {
	position: relative;
	height: 180px;
}

.sat-line-wrap canvas {
	width: 100% !important;
	height: 100% !important;
}

.sat-no-history {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 180px;
	font-size: 13px;
	color: var(--sat-muted, #6b7280);
	text-align: center;
	padding: 0 20px;
}

/* ---- Holdings table ---- */

.sat-holdings-title {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--sat-muted, #6b7280);
	margin: 0 0 14px;
}

.sat-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.sat-table th {
	text-align: left;
	padding: 8px 12px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--sat-muted, #6b7280);
	background: var(--sat-table-header-bg, #f9fafb);
	border-bottom: 1px solid var(--sat-border, #e5e7eb);
}

.sat-table th:not(:first-child),
.sat-table td:not(:first-child) {
	text-align: right;
}

.sat-table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--sat-border, #e5e7eb);
	vertical-align: middle;
}

.sat-table tbody tr:last-child td {
	border-bottom: none;
}

.sat-table tbody tr:hover td {
	background: var(--sat-row-hover, #f9fafb);
}

.sat-token-cell {
	display: flex;
	align-items: center;
	gap: 10px;
}

.sat-token-logo-wrap {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
	background: var(--sat-border, #e5e7eb);
}

.sat-token-logo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sat-token-logo-placeholder {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--sat-accent, #9945FF);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	flex-shrink: 0;
}

.sat-token-ticker {
	font-size: 10px;
	font-weight: 500;
	color: var(--sat-muted, #6b7280);
	margin-left: 4px;
}

.sat-token-name {
	font-size: 11px;
	color: var(--sat-muted, #6b7280);
	font-family: monospace;
}

.sat-token-symbol {
	font-weight: 600;
}

.sat-weight-bar-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	justify-content: flex-end;
}

.sat-weight-bar-track {
	width: 60px;
	height: 4px;
	background: var(--sat-border, #e5e7eb);
	border-radius: 2px;
	overflow: hidden;
}

.sat-weight-bar-fill {
	height: 100%;
	border-radius: 2px;
	background: var(--sat-accent, #9945FF);
}

/* ---- Loading / error states ---- */

.sat-dashboard-loading {
	padding: 40px;
	text-align: center;
	color: var(--sat-muted, #6b7280);
	font-size: 14px;
}

.sat-dashboard-error {
	padding: 20px;
	border-radius: 8px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
	font-size: 13px;
}

.sat-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid var(--sat-border, #e5e7eb);
	border-top-color: var(--sat-accent, #9945FF);
	border-radius: 50%;
	animation: sat-spin 0.7s linear infinite;
	vertical-align: middle;
	margin-right: 8px;
}

@keyframes sat-spin {
	to { transform: rotate(360deg); }
}
