/* Data Charts cards (core/DataCharts.php). Works on public pages and in the admin preview. */
.dc-list { display: grid; gap: 18px; }
.dc-list--home { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); margin: 0 0 32px; }
.dc-card { --dc-blue: #1d3f7a; background: var(--np-surface, #fff); color: var(--np-text, #212529); border: 1px solid var(--np-line, #e5e7eb); border-radius: 4px; padding: 18px 18px 12px; box-shadow: var(--np-shadow-sm, 0 1px 2px rgba(0,0,0,.04)); min-width: 0; font-size: 15px; }
[data-bs-theme="dark"] .dc-card { --dc-blue: #8fb4ff; }
.dc-card__title { font-size: 1.15rem; line-height: 1.25; font-weight: 700; color: var(--dc-blue) !important; margin: 0; text-transform: none !important; }
.dc-card__brand { font-weight: 700; opacity: .85; white-space: nowrap; }
.dc-card__refreshed { margin-top: 8px; font-size: .85rem; color: var(--np-muted, #6b7280); }
.dc-card__refreshed time { color: var(--dc-blue); }
.dc-card__sub { margin: 16px 0 4px; font-size: .95rem; font-weight: 600; color: var(--np-muted, #6b7280); }
.dc-table { width: 100%; margin-top: 12px; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.dc-table th, .dc-table td { padding: 7px 8px; border: 0; }
.dc-table thead th { background: rgba(29, 63, 122, .09); color: var(--np-ink, #111); font-weight: 600; }
.dc-table tbody tr:nth-child(even) { background: rgba(47, 158, 68, .09); }
.dc-table tbody th { font-weight: 500; color: var(--np-ink, #111); }
.dc-table tbody tr:last-child { border-bottom: 1px solid var(--np-line, #e5e7eb); }
.dc-table .text-end { text-align: right; white-space: nowrap; }
.dc-up { color: #2f9e44; font-size: .8em; }
.dc-down { color: #e03131; font-size: .8em; }
.dc-flat { color: #adb5bd; font-size: .6em; vertical-align: middle; }
.dc-stats { display: grid; gap: 12px; margin-top: 12px; }
.dc-stat { border-left: 3px solid var(--dc-color); padding-left: 10px; }
.dc-stat__label { font-weight: 700; color: var(--np-muted, #6b7280); font-size: .95rem; }
.dc-stat__value { color: var(--np-muted, #6b7280); font-size: .95rem; margin-top: 2px; }
.dc-stat__value strong { font-size: 1.35rem; color: var(--np-ink, #111); }
.dc-chart { position: relative; height: 210px; margin-top: 10px; }
.dc-list--home .dc-chart { height: 230px; }
.dc-card__note { margin: 10px 0 0; font-size: .78rem; line-height: 1.45; color: var(--np-muted, #6b7280); }
.dc-card__foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--np-line, #e5e7eb); }
.dc-card__logo { height: 22px; width: auto; max-width: 120px; object-fit: contain; flex: 0 0 auto; }
.dc-card__logoText { font-size: .85rem; }
.dc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 0; padding: 0; flex: 1; font-size: .85rem; color: var(--np-text, #374151); }
.dc-legend li { display: inline-flex; align-items: center; gap: 6px; }
.dc-legend span { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.dc-card__csv { color: var(--np-muted, #6b7280); text-decoration: none; padding: 4px 6px; border-radius: 4px; }
.dc-card__csv:hover { background: rgba(0, 0, 0, .06); color: var(--np-ink, #111); }

/* Responsive: every part adapts to the card's own width (phone, tablet, narrow sidebar). */
.dc-card { container-type: inline-size; overflow: hidden; }
.dc-chart { width: 100%; min-width: 0; }
.dc-chart canvas { display: block; width: 100% !important; max-width: 100%; }
.dc-table { table-layout: auto; }
.dc-card__foot { flex-wrap: wrap; }
.dc-legend { min-width: 0; }
@container (max-width: 420px) {
	.dc-card__title { font-size: 1.05rem; }
	.dc-card__brand { white-space: normal; }
	.dc-table { font-size: .86rem; }
	.dc-table th, .dc-table td { padding: 6px 5px; }
	.dc-table td.dc-v .dc-up, .dc-table td.dc-v .dc-down, .dc-table td.dc-v .dc-flat { display: none; } /* arrow stays in the Change column */
	.dc-chart, .dc-list--home .dc-chart { height: 190px; }
	.dc-stat__value strong { font-size: 1.2rem; }
}
@container (max-width: 300px) {
	.dc-table { font-size: .8rem; }
	.dc-table th, .dc-table td { padding: 5px 3px; }
	.dc-table thead th { font-size: .75rem; }
	.dc-chart, .dc-list--home .dc-chart { height: 170px; }
	.dc-card__logo { height: 18px; }
}
@media (max-width: 420px) {
	.dc-card { padding: 14px 12px 10px; }
}
