/*
 * Merchant dashboard only (Dashboard.razor, SessionDetail.razor and their panels).
 * Loaded by those pages through <HeadContent>, after digipay.css. Colours come from the shared
 * --ui-* tokens (ui.css), so light and dark need no separate rules except where noted.
 */

/* ----- Menu groups (rail and More sheet) ----- */
.dash-nav-heading { padding: 0 0.75rem; margin: 0.75rem 0 0.25rem; }
.dash-nav-group:first-child .dash-nav-heading { margin-top: 0.25rem; }
/* Group headings fold their group. */
.dash-nav-toggle {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
    min-height: 1.75rem; border-radius: var(--ui-radius-sm); background: transparent;
    text-align: left; cursor: pointer;
}
.dash-nav-toggle:hover { color: var(--ui-text); background: var(--ui-ghost-hover); }
.dash-nav-toggle:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 1px; }
.dash-nav-chevron { flex-shrink: 0; transition: transform 160ms ease-out; }
.dash-nav-group.is-folded .dash-nav-chevron { transform: rotate(-90deg); }
/* Folded: only the page you're on stays visible. */
.dash-nav-group.is-folded .dash-nav-list > li:not(.is-current) { display: none; }
@media (prefers-reduced-motion: reduce) { .dash-nav-chevron { transition: none; } }
.dash-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }

/* ----- Top bar (phones): the active store when there are several ----- */
.dash-topbar-name { max-width: 9rem; font-size: 0.875rem; font-weight: 600; }
.dash-topbar-store {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    max-width: 12rem;
    min-height: 44px;
    padding: 0 0.75rem;
    border: 1px solid var(--ui-border);
    border-radius: 9999px;
    background: transparent;
    color: var(--ui-text);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}
.dash-topbar-store:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; }

/* ----- Overview tiles ----- */
.dash-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.dash-stats > :first-child { grid-column: 1 / -1; }
@media (min-width: 640px) {
    .dash-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dash-stats > :first-child { grid-column: auto; }
}
@media (min-width: 1280px) { .dash-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.dash-stat { display: block; color: inherit; text-decoration: none !important; }
.dash-stat-hint { margin-top: 0.25rem; font-size: 0.75rem; color: var(--ui-text-muted); }
/* Needs action: a coloured edge and bold hint, never colour alone (the hint says so). */
.dash-stat-attention { border-left: 4px solid var(--ui-danger); }
.dash-stat-attention .dash-stat-hint { color: var(--ui-error); font-weight: 600; }
.dark .dash-stat-attention .dash-stat-hint { color: #fca5a5; }

/* ----- Getting started ----- */
.dash-progress { height: 6px; border-radius: 9999px; background: var(--ui-ghost-hover); overflow: hidden; }
.dash-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--ui-primary); transition: width var(--motion-base, 200ms) ease-out; }
.dash-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.dash-step { display: flex; align-items: flex-start; gap: 0.75rem; }
.dash-step-mark {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    border: 2px solid var(--ui-secondary-border);
    color: var(--ui-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
}
.dash-step.is-done .dash-step-mark { border-color: #059669; background: #059669; color: #fff; }
.dash-step-title { margin: 0.125rem 0 0; font-weight: 600; color: var(--ui-text); }
.dash-step.is-done .dash-step-title { color: var(--ui-text-muted); font-weight: 500; }

/* ----- Payments list ----- */
/* The filter scrolls sideways on phones instead of squeezing nine labels. */
.dash-filter { overflow-x: auto; scrollbar-width: none; }
.dash-filter::-webkit-scrollbar { display: none; }
.dash-filter .segmented-item { flex: 0 0 auto; white-space: nowrap; }
/* Whole-row links: the site's underline-every-link rule doesn't apply to them. */
.dash-row-link { text-decoration: none !important; }
.dash-fiat { font-weight: 500; font-size: 0.8125rem; color: var(--ui-text-muted); }

/* ----- Shown-once secret ----- */
.dash-once-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--ui-radius-sm);
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
}
.dark .dash-once-card { border-color: rgba(6, 95, 70, 0.4); background: rgba(6, 78, 59, 0.25); }

/* ----- Payment detail ----- */
.dash-shortfall { font-weight: 600; color: var(--ui-error); }
.dark .dash-shortfall { color: #fca5a5; }

/* Small screens: wrapped card headers keep a gap between title and buttons. */
@media (max-width: 360px) {
    .dash-filter .segmented-item { padding: 0 0.625rem; }
}

/* Payment-link currency: a button that opens the shared CurrencyPicker (the wallet's list). */
.dash-currency-btn { display: flex; align-items: center; gap: 0.5rem; text-align: left; cursor: pointer; }
.dash-currency-code { font-weight: 700; }
.dash-currency-name { flex: 1; min-width: 0; font-size: 0.8125rem; color: var(--ui-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =====================================================================================
   Collapsible rail (DashboardShell, wide screens). Collapsed, it is a 76px strip of icons;
   labels stay in the markup for screen readers and show as tooltips on hover/focus.
   ===================================================================================== */
.dp-rail-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.dp-rail-toggle { flex-shrink: 0; }
.dp-rail-store { justify-content: center; }

@media (min-width: 1024px) {
    .dp-shell { transition: grid-template-columns 220ms cubic-bezier(.22, 1, .36, 1); }
    .dp-rail-head { padding: 0.25rem 0.25rem 0.75rem 0.75rem; border-bottom: 1px solid var(--ui-border); margin-bottom: 0.25rem; }
    .dp-rail-head > .dp-brand { padding: 0; border: 0; margin: 0; }

    .dp-shell.is-rail-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
    .is-rail-collapsed .dp-rail { padding-left: 0.625rem; padding-right: 0.625rem; }
    .is-rail-collapsed .dp-rail-head { flex-direction: column; padding: 0.25rem 0 0.75rem; }
    .is-rail-collapsed .dp-rail-label,
    .is-rail-collapsed .dash-nav-heading,
    .is-rail-collapsed .dp-rail-account-text,
    .is-rail-collapsed .dp-rail-theme {
        /* Visually hidden, still read out. */
        position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
    }
    .is-rail-collapsed .dash-nav-group.is-folded .dash-nav-list > li { display: list-item; }
    /* No fold buttons in the icon strip (no invisible tab stops); lists keep their group name via aria-labelledby. */
    .is-rail-collapsed .dash-nav-toggle { display: none !important; }
    .is-rail-collapsed .dash-nav-list { padding-bottom: 0.5rem; margin-bottom: 0.5rem; border-bottom: 1px solid var(--ui-border); }
    .is-rail-collapsed .dash-nav-group:last-child .dash-nav-list { border-bottom: 0; }
    .is-rail-collapsed .dp-rail-item { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
    .is-rail-collapsed .dp-rail-item > svg:not(:first-child) { display: none; } /* external-link marks */

    /* The rail scrolls vertically, so tooltips are drawn outside it (digipay-dashboard.js). */
    .is-rail-collapsed .dp-rail { overflow-x: hidden; }
}
@media (prefers-reduced-motion: reduce) {
    .dp-shell, .dp-rail-tip { transition: none !important; }
}

/* Tooltip for the collapsed rail: one fixed element positioned next to the hovered/focused icon. */
.dp-rail-tip {
    position: fixed; z-index: 80; pointer-events: none;
    padding: 0.375rem 0.625rem; border-radius: var(--ui-radius-sm);
    background: var(--ui-text); color: var(--ui-surface);
    font-size: 0.8125rem; font-weight: 600; white-space: nowrap;
    box-shadow: var(--ui-shadow-raised);
    opacity: 0; transform: translate(-4px, -50%);
    transition: opacity 120ms ease-out, transform 120ms ease-out;
}
.dp-rail-tip.is-shown { opacity: 1; transform: translate(0, -50%); }

/* Menu footer: avatar, name and Digi-ID, a sign-out icon, then the theme at full width. */
.dp-rail-account {
    margin-top: auto;               /* pinned to the bottom of the rail */
    padding: 0.75rem 0.25rem 0.25rem;
    border-top: 1px solid var(--ui-border);
    display: flex; flex-direction: column; gap: 0.625rem;
}
.dp-rail-me { display: flex; align-items: center; gap: 0.625rem; min-width: 0; }
.dp-rail-avatar {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 2.25rem; height: 2.25rem; border-radius: 9999px;
    font-weight: 700; font-size: 0.875rem;
    color: #fff; background: linear-gradient(135deg, var(--ui-primary), color-mix(in srgb, var(--ui-primary) 55%, #7c3aed));
    box-shadow: 0 0 0 2px var(--ui-surface), 0 0 0 3px color-mix(in srgb, var(--ui-primary) 35%, transparent);
}
.dp-rail-account-text { flex: 1; min-width: 0; }
.dp-rail-name { margin: 0; font-size: 0.875rem; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-rail-address { margin: 0.125rem 0 0; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.6875rem; color: var(--ui-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-rail-signout { flex-shrink: 0; color: var(--ui-text-muted); }
.dp-rail-signout:hover { color: var(--ui-danger, #dc2626); background: color-mix(in srgb, var(--ui-danger, #dc2626) 10%, transparent); }
.dp-rail-theme-picker { width: 100%; display: flex; }
.dp-rail-theme-picker > .segmented-item { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; min-width: 0; min-height: 36px; padding: 0 0.25rem; font-size: 0.71875rem; gap: 0.25rem; }
.dp-rail-theme-picker > .segmented-item > svg { width: 0.875rem; height: 0.875rem; }
.dp-rail-theme-picker { padding: 3px; }
.dp-rail-theme-picker > .segmented-item > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (min-width: 1024px) {
    /* Tooltips are drawn outside the rail, so it never needs to scroll sideways. */
    .dp-rail { overflow-x: hidden; }
    .is-rail-collapsed .dp-rail-account { align-items: center; padding-left: 0; padding-right: 0; }
    .is-rail-collapsed .dp-rail-me { flex-direction: column; gap: 0.5rem; }
}

/* POS pairing code card (Dashboard → POS tablets). */
.dash-pair {
    margin-top: 0.5rem;
    display: flex; flex-direction: column; align-items: center; gap: 0.5rem; text-align: center;
    padding: 1.25rem 1rem;
    border-radius: var(--ui-radius);
    border: 1px solid color-mix(in srgb, #10b981 35%, transparent);
    background: color-mix(in srgb, #10b981 8%, var(--ui-surface));
    animation: dash-pair-in 260ms cubic-bezier(.22, 1, .36, 1) both;
}
.dash-pair:focus { outline: none; }
.dash-pair:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
.dash-pair.is-expired { border-color: var(--ui-border); background: var(--ui-input-bg, transparent); }
.dash-pair-eyebrow { margin: 0; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #047857; }
.dark .dash-pair-eyebrow { color: #6ee7b7; }
.dash-pair.is-expired .dash-pair-eyebrow { color: var(--ui-text-muted); }
.dash-pair-code {
    margin: 0;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: clamp(2rem, 7vw, 2.75rem); font-weight: 700; letter-spacing: 0.35em; padding-left: 0.35em;
    color: #047857; font-variant-numeric: tabular-nums; user-select: all;
}
.dark .dash-pair-code { color: #6ee7b7; }
.dash-pair-code.is-dim { color: var(--ui-text-muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.dash-pair-meter { width: min(16rem, 100%); height: 4px; border-radius: 9999px; background: color-mix(in srgb, #10b981 18%, transparent); overflow: hidden; }
.dash-pair-meter > span { display: block; height: 100%; border-radius: inherit; background: #10b981; transition: width 1s linear; }
.dash-pair-wait { margin: 0.25rem 0 0; display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; color: var(--ui-text-muted); }
.dash-pair-dot { position: relative; width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: #10b981; flex-shrink: 0; }
.dash-pair-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 9999px; background: #10b981; opacity: 0.35; animation: dash-pair-ping 1.6s cubic-bezier(0, 0, .2, 1) infinite; }
.dash-pair-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 0.25rem; }
.dash-pair-seal { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: 9999px; color: #fff; background: #10b981; animation: dash-pair-pop 380ms cubic-bezier(.34, 1.56, .64, 1) both; }
.dash-pair-title { margin: 0; font-weight: 700; font-size: 1rem; }
@keyframes dash-pair-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes dash-pair-ping { 75%, 100% { transform: scale(2); opacity: 0; } }
@keyframes dash-pair-pop { from { transform: scale(0.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .dash-pair, .dash-pair-seal, .dash-pair-dot::after { animation: none !important; }
    .dash-pair-meter > span { transition: none; }
}

/* A tablet paired before tablets were tied to one store. */
.dash-legacy-tablet {
    margin: 0.375rem 0 0; display: flex; align-items: flex-start; gap: 0.375rem;
    font-size: 0.75rem; line-height: 1.45; color: #92400e;
}
.dark .dash-legacy-tablet { color: #fbbf24; }
.dash-legacy-tablet svg { margin-top: 0.1rem; }

/* Audit log summary: wraps to at most two lines (full text in the tooltip) so the table fits its card
   instead of pushing IP and Details off to the side. */
.dash-audit-summary {
    max-width: 28rem; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* =====================================================================================
   Active-store picker (DashboardShell). A button with the store's initial, name and network;
   it opens a "Switch store" menu below it.
   ===================================================================================== */
.dash-store { position: relative; padding: 0 0.25rem 0.5rem; }
.dash-store-label { margin: 0 0 0.375rem 0.25rem; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ui-text-muted); }
.dash-store-btn, .dash-store-option {
    width: 100%; display: flex; align-items: center; gap: 0.625rem; text-align: left; color: var(--ui-text);
}
.dash-store-btn {
    padding: 0.5rem 0.625rem; border-radius: var(--ui-radius);
    border: 1px solid var(--ui-border); background: var(--ui-input-bg, transparent);
    transition: border-color 150ms, box-shadow 150ms, background-color 150ms;
}
.dash-store-btn:hover { border-color: color-mix(in srgb, var(--ui-primary) 50%, var(--ui-border)); }
.dash-store-btn:focus-visible { outline: none; border-color: var(--ui-focus); box-shadow: var(--ui-focus-ring); }
.dash-store.is-open .dash-store-btn { border-color: var(--ui-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-primary) 18%, transparent); }
.dash-store-avatar {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    width: 2.125rem; height: 2.125rem; border-radius: 0.625rem;
    font-weight: 800; font-size: 0.9375rem; color: #fff;
    background: linear-gradient(135deg, hsl(var(--hue, 210) 75% 52%), hsl(calc(var(--hue, 210) + 40) 70% 42%));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.dash-store-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.dash-store-name { font-size: 0.875rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-store-meta { font-size: 0.6875rem; color: var(--ui-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-store-caret { flex-shrink: 0; display: inline-flex; color: var(--ui-text-muted); transition: transform 160ms ease-out; }
.dash-store.is-open .dash-store-caret { transform: rotate(180deg); }

.dash-store-scrim { position: fixed; inset: 0; z-index: 40; }
.dash-store-menu {
    position: absolute; z-index: 41; left: 0.25rem; right: 0.25rem; top: calc(100% - 0.125rem);
    padding: 0.375rem; border-radius: var(--ui-radius);
    background: var(--ui-surface); border: 1px solid var(--ui-border); box-shadow: var(--ui-shadow-raised);
    max-height: 22rem; overflow-y: auto;
    animation: dash-store-in 160ms cubic-bezier(.22, 1, .36, 1) both;
}
.dash-store-menu-title { margin: 0.25rem 0.5rem 0.375rem; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ui-text-muted); }
.dash-store-option { padding: 0.5rem; border-radius: var(--ui-radius-sm); background: transparent; }
.dash-store-option .dash-store-avatar { width: 1.875rem; height: 1.875rem; font-size: 0.8125rem; border-radius: 0.5rem; }
.dash-store-option:hover, .dash-store-option:focus-visible { background: var(--ui-ghost-hover); outline: none; }
.dash-store-option.is-active { background: var(--ui-ghost-active, var(--ui-ghost-hover)); }
.dash-store-check { flex-shrink: 0; color: var(--ui-primary); }
.dash-store-manage {
    margin-top: 0.25rem; padding: 0.5rem; display: flex; align-items: center; gap: 0.5rem;
    border-top: 1px solid var(--ui-border); border-radius: 0 0 var(--ui-radius-sm) var(--ui-radius-sm);
    font-size: 0.8125rem; font-weight: 600; color: var(--ui-ghost-text); text-decoration: none;
}
.dash-store-manage:hover, .dash-store-manage:focus-visible { background: var(--ui-ghost-hover); outline: none; }
@keyframes dash-store-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .dash-store-menu { animation: none; } .dash-store-caret { transition: none; } }

/* ----- Overview: sales charts (SalesOverview, DayChart) -----
   Inline SVG drawn with the shared tokens, so light and dark follow the page theme. Series
   colours match the status badges (paid green, underpaid amber, refunded indigo …). */
:root {
    --dp-chart-line: var(--ui-primary);
    --dp-chart-fill: rgba(0, 102, 204, 0.16);
    --dp-chart-grid: rgba(100, 116, 139, 0.22);
    --dp-chart-paid: #059669;
    --dp-chart-other: #94a3b8;
    --dp-chart-open: #0066cc;
    --dp-chart-underpaid: #d97706;
    --dp-chart-expired: #94a3b8;
    --dp-chart-refunded: #6366f1;
    --dp-chart-voided: #475569;
    --dp-chart-up: #047857;
    --dp-chart-down: #b91c1c;
}
.dark {
    --dp-chart-line: #4d94ff;
    --dp-chart-fill: rgba(77, 148, 255, 0.20);
    --dp-chart-grid: rgba(148, 163, 184, 0.18);
    --dp-chart-paid: #34d399;
    --dp-chart-other: #64748b;
    --dp-chart-open: #4d94ff;
    --dp-chart-underpaid: #fbbf24;
    --dp-chart-expired: #64748b;
    --dp-chart-refunded: #a5b4fc;
    --dp-chart-voided: #cbd5e1;
    --dp-chart-up: #34d399;
    --dp-chart-down: #fca5a5;
}

.sales-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.sales-period .segmented-item { padding: 0 0.75rem; white-space: nowrap; }
.sales-window { margin: 0.25rem 0 0.75rem; font-size: 0.8125rem; }
.sales-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 0.75rem; }
.sales-kpis > :first-child { grid-column: 1 / -1; }
@media (min-width: 640px) {
    .sales-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sales-kpis > :first-child { grid-column: auto; }
}
.sales-change { margin-top: 0.375rem; display: flex; align-items: baseline; gap: 0.25rem; font-size: 0.75rem; font-weight: 600; }
.sales-change > span:first-child { font-size: 0.625rem; }
.sales-change.is-up { color: var(--dp-chart-up); }
.sales-change.is-down { color: var(--dp-chart-down); }
.sales-change.is-flat { color: var(--ui-text-muted); }

.sales-card { padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; margin-bottom: 0.75rem; }
@media (min-width: 640px) { .sales-card { padding: 1.25rem 1.5rem; } }
.sales-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.25rem 0.75rem; flex-wrap: wrap; }
.sales-card-head .dp-muted { font-size: 0.75rem; }
.sales-card-title { margin: 0; font-size: 0.9375rem; font-weight: 700; color: var(--ui-text); }
.sales-pair { display: grid; gap: 0 0.75rem; }
@media (min-width: 1280px) { .sales-pair { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }

.sales-legend { display: inline-flex; gap: 0.75rem; font-size: 0.75rem; color: var(--ui-text-muted); }
.sales-legend > span { display: inline-flex; align-items: center; gap: 0.375rem; }
.sales-swatch { display: inline-block; width: 0.625rem; height: 0.625rem; border-radius: 3px; flex-shrink: 0; background: var(--dp-chart-other); }
.sales-swatch.is-paid, .sales-split-part.is-paid { background: var(--dp-chart-paid); }
.sales-swatch.is-other { background: var(--dp-chart-other); }
.sales-swatch.is-open, .sales-split-part.is-open { background: var(--dp-chart-open); }
.sales-swatch.is-underpaid, .sales-split-part.is-underpaid { background: var(--dp-chart-underpaid); }
.sales-swatch.is-expired, .sales-split-part.is-expired { background: var(--dp-chart-expired); }
.sales-swatch.is-refunded, .sales-split-part.is-refunded { background: var(--dp-chart-refunded); }
.sales-swatch.is-voided, .sales-split-part.is-voided { background: var(--dp-chart-voided); }

.sales-split { display: flex; gap: 2px; height: 0.75rem; border-radius: 9999px; overflow: hidden; background: var(--ui-ghost-hover); }
.sales-split-part { flex: 1 1 0; min-width: 4px; background: var(--dp-chart-other); }
.sales-outcomes { list-style: none; margin: 0; padding: 0; display: grid; font-size: 0.875rem; }
.sales-outcomes li { display: flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0; border-bottom: 1px solid var(--ui-border); }
.sales-outcomes li:last-child { border-bottom: 0; }
.sales-outcome-label { flex: 1; min-width: 0; color: var(--ui-text); }
.sales-outcome-count { font-weight: 700; color: var(--ui-text); }
.sales-outcome-pct { width: 3.25rem; text-align: right; color: var(--ui-text-muted); font-size: 0.8125rem; }

/* DayChart */
.dchart { margin: 0; min-width: 0; }
.dchart-frame { position: relative; display: flex; gap: 0.5rem; }
.dchart-axis {
    position: relative; flex: 0 0 auto; min-width: 2rem; height: 10rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums;
    font-size: 0.6875rem; color: var(--ui-text-muted); text-align: right;
}
.dchart-axis > span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; line-height: 1; }
.dchart-plot { position: relative; flex: 1 1 auto; min-width: 0; height: 10rem; border-radius: 0.375rem; cursor: crosshair; }
@media (min-width: 640px) { .dchart-axis, .dchart-plot { height: 12rem; } }
.dchart-plot:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 4px; }
.dchart-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.dchart-grid { stroke: var(--dp-chart-grid); stroke-width: 1; stroke-dasharray: 3 4; }
.dchart-base { stroke: var(--ui-border); stroke-width: 1; }
.dchart-hit { fill: transparent; }
.dchart-line { fill: none; stroke: var(--dp-chart-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dchart-fill { fill: var(--dp-chart-fill); animation: dchart-fade var(--motion-slow, 360ms) var(--ease-out, ease-out) both; }
.dchart-cursor { stroke: var(--ui-text-muted); stroke-width: 1; stroke-dasharray: 2 3; }
.dchart-bar { transform-box: fill-box; transform-origin: 50% 100%; animation: dchart-grow var(--motion-slow, 360ms) var(--ease-out, ease-out) both; }
.dchart-bar-primary { fill: var(--dp-chart-paid); }
.dchart-bar-stacked { fill: var(--dp-chart-other); }
.dchart-col.is-active .dchart-bar { opacity: 0.7; }
.dchart-dot {
    position: absolute; width: 0.625rem; height: 0.625rem; border-radius: 9999px; transform: translate(-50%, -50%);
    background: var(--dp-chart-line); box-shadow: 0 0 0 2px var(--ui-surface); pointer-events: none;
}
.dchart-tip {
    position: absolute; top: -0.25rem; transform: translate(-50%, -100%); z-index: 2; pointer-events: none;
    display: flex; flex-direction: column; gap: 0.125rem; padding: 0.375rem 0.625rem; white-space: nowrap;
    border-radius: var(--ui-radius-sm); background: var(--ui-text); color: var(--ui-surface);
    box-shadow: var(--ui-shadow-raised); font-size: 0.75rem; line-height: 1.3;
}
.dchart-tip.is-start { transform: translate(-1rem, -100%); }
.dchart-tip.is-end { transform: translate(calc(-100% + 1rem), -100%); }
.dchart-tip-day { font-weight: 600; opacity: 0.8; }
.dchart-tip-value { font-weight: 700; }
.dchart-x { display: flex; justify-content: space-between; margin: 0.375rem 0 0 2.5rem; font-size: 0.6875rem; color: var(--ui-text-muted); }
.dchart-table { margin-top: 0.75rem; font-size: 0.8125rem; }
.dchart-table > summary { cursor: pointer; width: max-content; color: var(--ui-ghost-text); font-weight: 600; border-radius: 0.25rem; }
.dchart-table > summary:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
.dchart-table-wrap { margin-top: 0.5rem; max-height: 18rem; overflow: auto; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); }
.dchart-table table { width: 100%; border-collapse: collapse; }
.dchart-table th, .dchart-table td { padding: 0.375rem 0.75rem; text-align: left; border-bottom: 1px solid var(--ui-border); color: var(--ui-text); }
.dchart-table thead th { position: sticky; top: 0; background: var(--ui-surface); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ui-text-muted); }
.dchart-table tbody th { font-weight: 500; white-space: nowrap; }
.dchart-table .is-num { text-align: right; }
.dchart-table tr:last-child > * { border-bottom: 0; }
@keyframes dchart-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes dchart-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .dchart-bar, .dchart-fill { animation: none; }
}
