/*
    System Admin, neutral theme (2026-11-18): Users, AI usage, Inactivity, Cancel Assist (runs + merchants), Plaid Health,
    App Releases and the Support Desk. Loaded after every admin area sheet, so it retunes their tokens and selected
    states in one place:

    - The admin accent (--adu-violet, --sp-accent inside the Support Desk) is a graphite ink, not violet. Icons, links,
      focus rings, timeline dots and the hero wash go neutral with it.
    - Every selected item (range presets, page tabs, chart toggles, filter chips, segments, picks) is the site's
      segmented look: the translucent recess (--tx-seg-recess) with the neutral lift pill (--tx-seg-pill), or a slight
      neutral gradient on chips. No solid violet fills and no colored 1px borders on a selection. Status chips keep
      their own hue as a soft gradient.
    - Charts: one calm palette. The two model families are slate (Luna, standard) and copper (Sol, deep), other models
      sage; single-series bars, sparklines and the heat map run on slate; color for state only where it means state
      (failed red, waiting amber).
*/

:root {
    --adu-violet: #343A46;
    --adu-violet-soft: #F1F2F5;
    --adu-violet-line: #DCDFE6;
    --adu-on-accent: #FFFFFF;
    --adu-focus: 0 0 0 3px rgba(11, 15, 25, .14);
    --adu-hero-bg: linear-gradient(158deg, #EEF0F4 0%, #F6F7F9 42%, #FFFFFF 100%);
    --adu-hero-border: #E2E4EA;
    --adu-sel: linear-gradient(180deg, rgba(11, 15, 25, .075) 0%, rgba(11, 15, 25, .04) 100%);
    --adu-toast: #1C1F26;

    /* Chart palette */
    --aiu-luna: #5B6B85;
    --aiu-luna-soft: #EEF0F4;
    --aiu-luna-ink: #3F4B60;
    --aiu-sol: #C4834A;
    --aiu-sol-soft: #F8EDE3;
    --aiu-sol-ink: #8E5627;
    --aiu-other: #5A9C87;
    --aiu-answered: #5B6B85;
    --aiu-reused: #C5CCD8;
    --aiu-info: #5B6B85;
    --aiu-info-soft: #EEF0F4;
    --aiu-bar: #7A8597;
    --aiu-band-ink: #FFFFFF;
    --aiu-heat-0: #F1F2F5;
    --aiu-heat-1: #DCE0E7;
    --aiu-heat-2: #B3BBC8;
    --aiu-heat-3: #7E899B;
    --aiu-heat-4: #4B5567;
}

[data-bs-theme="dark"] {
    --adu-violet: #D4D7DE;
    --adu-violet-soft: rgba(255, 255, 255, .07);
    --adu-violet-line: rgba(255, 255, 255, .14);
    --adu-on-accent: #0B0F19;
    --adu-muted: #A8AAB2;
    --adu-focus: 0 0 0 3px rgba(255, 255, 255, .18);
    --adu-hero-bg: linear-gradient(158deg, #1D2028 0%, #15181E 45%, #0B0F19 100%);
    --adu-hero-border: rgba(255, 255, 255, .08);
    --adu-sel: linear-gradient(180deg, rgba(255, 255, 255, .12) 0%, rgba(255, 255, 255, .07) 100%);
    --adu-toast: #2A2D35;

    --aiu-luna: #8C9AB1;
    --aiu-luna-soft: rgba(140, 154, 177, .16);
    --aiu-luna-ink: #B7C2D3;
    --aiu-sol: #D0965E;
    --aiu-sol-soft: rgba(208, 150, 94, .16);
    --aiu-sol-ink: #E8BD93;
    --aiu-other: #69B29A;
    --aiu-answered: #8C9AB1;
    --aiu-reused: #3B4250;
    --aiu-info: #8C9AB1;
    --aiu-info-soft: rgba(140, 154, 177, .16);
    --aiu-bar: #8C96A8;
    --aiu-band-ink: #0B0F19;
    --aiu-heat-0: rgba(255, 255, 255, .05);
    --aiu-heat-1: #272C36;
    --aiu-heat-2: #3A414E;
    --aiu-heat-3: #5A6577;
    --aiu-heat-4: #8C9AB1;
}

/* Support Desk: its accent goes to the same ink (scoped, so the public Support pages keep theirs). */
.sd-page,
.sd-canned-sheet {
    --sp-accent: var(--adu-violet);
    --sp-accent-ink: var(--adu-violet);
    --sp-accent-soft: var(--adu-violet-soft);
    --sp-accent-line: var(--adu-violet-line);
}

/* ------------------------------------------------------------------ Segmented tracks: recess + neutral pill */

.aiu-tabs,
.aiu-presets,
.aiu-seg,
.adu-tabs,
.adr-segment,
.caa-frames,
.sd-mode {
    border-color: transparent;
    background: var(--tx-seg-recess);
}

.aiu-tab.is-active,
.aiu-preset.is-active,
.aiu-seg button.is-active,
.adu-tab.is-active,
.adr-segment-item.is-active,
.caa-frames button.is-active,
.sd-segment.is-active,
.sd-mode-btn.is-active {
    border-color: var(--tx-seg-pill-border);
    background: var(--tx-seg-pill);
    color: var(--tx-seg-selected-text);
    box-shadow: 0 2px 8px var(--tx-seg-pill-shadow);
}

.aiu-tab.is-active i,
.aiu-preset.is-active i,
.adu-tab.is-active i,
.adr-segment-item.is-active i {
    color: var(--tx-seg-selected-glyph);
}

.aiu-tab:hover,
.aiu-preset:hover {
    background: var(--tx-seg-hover);
}

.adu-tab.is-active .adu-tab-count,
.aiu-tab.is-active .aiu-tab-count {
    background: var(--adu-neutral-soft);
    color: var(--adu-text);
}

.sd-segment.is-active small {
    background: var(--adu-violet);
    color: var(--adu-on-accent);
}

/* ------------------------------------------------------------------ Chips, picks and toggles: slight neutral gradient */

.adu-chip:hover {
    border-color: var(--adu-card-border);
    color: var(--adu-text);
}

.adu-chip.is-active {
    border-color: var(--adu-card-border);
    background: var(--adu-sel);
    color: var(--adu-text);
}

.adu-chip.is-active em {
    background: var(--adu-card);
    color: var(--adu-text);
}

/* Status chips keep their hue: a soft gradient of their own color, the label in it. */
.adu-chip.is-caution.is-active,
.adu-chip.is-critical.is-active,
.adu-chip.is-positive.is-active,
.adu-chip.is-partner.is-active {
    border-color: var(--adu-card-border);
    background: linear-gradient(180deg, color-mix(in srgb, var(--chip) 18%, transparent), color-mix(in srgb, var(--chip) 9%, transparent));
    color: var(--chip);
}

.adu-chip.is-caution { --chip: var(--adu-caution); }
.adu-chip.is-critical { --chip: var(--adu-critical); }
.adu-chip.is-positive { --chip: var(--adu-positive); }
.adu-chip.is-partner { --chip: var(--adu-partner); }

.adp-inst.is-active,
.aiu-pick.is-selected,
.aiu-plan.is-add:hover,
.adu-insert:hover,
.sd-tool.is-active,
.sd-chip.is-active,
.sd-canned-nav-item.is-active {
    border-color: var(--adu-card-border);
    background: var(--adu-sel);
    color: var(--adu-text);
}

.aiu-icon-btn.is-on {
    border-color: var(--adu-card-border);
    background: var(--adu-sel);
    color: var(--adu-text);
}

.aiu-limit.is-dirty input {
    border-color: var(--adu-card-border);
    background: var(--adu-sel);
}

.sd-row.is-selected {
    background: var(--adu-sel), var(--sp-card);
    box-shadow: none;
}

.sd-tile.is-active {
    border-color: var(--sp-border);
}

/* ------------------------------------------------------------------ Ink fills keep readable text in both themes */

.adu-btn-login-as:not(:disabled):hover,
.adr-banner-update {
    color: var(--adu-on-accent);
}

.adu-batch-badge {
    background: linear-gradient(135deg, var(--adu-violet), color-mix(in srgb, var(--adu-violet) 72%, var(--adu-card)));
    color: var(--adu-on-accent);
    box-shadow: none;
}

.adu-batch-bar.is-sent,
.adu-batch-progress:not(.is-done) .adu-batch-bar.is-sent {
    background-image: linear-gradient(90deg, var(--aiu-luna) 0%, color-mix(in srgb, var(--aiu-luna) 70%, var(--adu-card)) 40%, var(--aiu-luna) 80%);
}

.adu-toast {
    background: var(--adu-toast);
}

/* No underlined links anywhere in the admin. */
.aiu-crumbs a:hover,
.adr-link:hover,
.adu-link {
    color: var(--adu-text);
    text-decoration: none;
}

/* ------------------------------------------------------------------ Charts */

.aiu-hero-spark path.is-line { stroke: var(--aiu-bar); }
.aiu-hero-spark path.is-area { fill: var(--aiu-bar); opacity: .1; }

.aiu-bar-fill .is-accent,
.aiu-dot.is-accent,
.aiu-col.is-today .aiu-col-stack::after {
    background: var(--aiu-bar);
}

.aiu-col:focus-visible .aiu-col-hit {
    box-shadow: 0 0 0 2px var(--adu-text);
}

.aiu-band-seg-label {
    color: var(--aiu-band-ink);
    text-shadow: none;
}

/* Plaid webhooks: a normal day is neutral; color only says something went wrong or is waiting. */
.adp-chart-seg.is-completed,
.adp-swatch.is-completed {
    fill: var(--aiu-luna);
    background: var(--aiu-luna);
}

.adp-chart-seg.is-skipped,
.adp-swatch.is-skipped {
    fill: var(--aiu-reused);
    background: var(--aiu-reused);
    opacity: 1;
}

/* ------------------------------------------------------------------ User avatars without a photo */

/* The initials circle (Users, Inactivity, the user sheet, AI usage people, Support Desk): a neutral glass disc with
   ink initials instead of the violet / blue-orange gradients, like the sidebar's signed-in avatar. Photos cover it. */
.adu-avatar,
.aiu-avatar {
    background: linear-gradient(135deg, #FFFFFF 0%, #ECEEF2 100%);
    box-shadow: inset 0 0 0 1px rgba(11, 15, 25, .08);
    color: #0B0F19;
}

[data-bs-theme="dark"] .adu-avatar,
[data-bs-theme="dark"] .aiu-avatar {
    background: linear-gradient(135deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .07) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
    color: #FFFFFF;
}

/* The status rings keep their meaning; they replace the hairline. */
.adu-avatar.has-ring { box-shadow: 0 0 0 2px var(--adu-card), 0 0 0 4px var(--adu-neutral); }
.adu-avatar.has-ring.is-positive { box-shadow: 0 0 0 2px var(--adu-card), 0 0 0 4px var(--adu-positive); }
.adu-avatar.has-ring.is-caution { box-shadow: 0 0 0 2px var(--adu-card), 0 0 0 4px var(--adu-caution); }
.adu-avatar.has-ring.is-critical { box-shadow: 0 0 0 2px var(--adu-card), 0 0 0 4px var(--adu-critical); }
