/* ===== na_exception_losses_html (HTML form, scoped) =====
   Loaded eagerly from anvil.yaml native_deps.head_html. The form's rules live here because
   Anvil's server strips a <style> block out of an HTML template.

   .na-exception-card is the form root, so its rule stays a BARE class and outranks the
   :where()-scoped rules below it. It gets no `flex: 1 0 auto` and no `position: relative`: those
   belong to a screen root, and this is a dashboard section that sits as a plain block child of the
   shell's section wrapper. Its own `overflow: hidden` is this card's rounded-corner clip and
   carries over.

   :where(.na-exception-card) adds zero specificity, so it cannot change which rule wins; it only
   stops these names reaching another screen now that the sheet is app-wide.
   [data-theme="dark"] is on <html>, an ancestor OUTSIDE this root, so it stays on the left of the
   scope and is never itself wrapped: [data-theme="dark"] :where(.na-exception-card)
   .na-exception-kpi keeps today's (0,2,0).

   Tie audit: this form styles no .px-* class, and .na-exception-table is not .px-table, so no rule
   here can tie with theme.css or with the dependency's runtime-injected sheet. themed-scrollbar on
   .na-exception-body is the dependency's own class and this file declares nothing for it.
   No @keyframes, no url(), no @font-face.

   .na-exception-empty { display: none } hides the empty-state line on the canvas as well as at
   runtime. This leaf carries no live class of its own to gate on. */

.na-exception-card {
    background: var(--px-bg-card);
    border: 1px solid var(--px-border);
    border-radius: 16px;
    box-shadow: var(--px-shadow);
    overflow: hidden;
}

:where(.na-exception-card) .na-exception-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--px-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

:where(.na-exception-card) .na-exception-title {
    font-family: var(--px-font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--px-text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

:where(.na-exception-card) .na-exception-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--px-danger);
    border-radius: 2px;
}

:where(.na-exception-card) .na-exception-kpi {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(220, 38, 38, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(220, 38, 38, 0.15);
}

[data-theme="dark"] :where(.na-exception-card) .na-exception-kpi {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.2);
}

:where(.na-exception-card) .na-exception-kpi-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--px-danger);
}

:where(.na-exception-card) .na-exception-kpi-value {
    font-family: var(--px-font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--px-danger);
}

:where(.na-exception-card) .na-exception-body {
    padding: 0;
    overflow-x: auto;
}

:where(.na-exception-card) .na-exception-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--px-font-display);
    font-size: 0.85rem;
}

:where(.na-exception-card) .na-exception-table th {
    position: sticky;
    top: 0;
    background: var(--px-bg-elevated);
    padding: 0.75rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--px-text-muted);
    border-bottom: 1px solid var(--px-border-strong);
    white-space: nowrap;
}

:where(.na-exception-card) .na-exception-table td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--px-border);
    color: var(--px-text-primary);
    vertical-align: middle;
}

:where(.na-exception-card) .na-exception-table tbody tr:hover {
    background: var(--px-bg-elevated);
}

:where(.na-exception-card) .na-exception-table tbody tr:last-child td {
    border-bottom: none;
}

:where(.na-exception-card) .na-exception-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
}

:where(.na-exception-card) .na-exception-table .loss {
    color: var(--px-danger);
}

:where(.na-exception-card) .na-exception-table .profit {
    color: var(--px-success-ink);
    font-weight: 600;
}

:where(.na-exception-card) .na-exception-empty {
    display: none;
    padding: 2rem;
    text-align: center;
    color: var(--px-text-muted);
    font-size: 0.9rem;
}
