/* =============================================================
   View Client Header V2 — identity shell (2026)
   -------------------------------------------------------------
   Mirrors the kenny-breadcrumbs-v3 recipe (app.css:560-699):
   gradient border shell + dark panel fill + radial glow.
   Uses a rectangular radius (20px) instead of 999px so it can
   hold structured content rather than a navigation pill.
   Active color is driven by the current client status via an
   inline --vch-active-color custom property on .vch-shell.
   Inner panel border mirrors MarketAssetCardV2 (1px white-7%).
   ============================================================= */

.vch-shell {
    --vch-dim: color-mix(in srgb, #00000000 45%, transparent);
    --vch-active-color: var(--mud-palette-secondary);
    /*--vch-active-glow: color-mix(in srgb, var(--vch-active-color) 22%, transparent);*/
    --vch-radius: 20px;

    position: relative;
    border-radius: var(--vch-radius);
    padding: 2px;
    background: linear-gradient(
        180deg,
        var(--vch-active-color) 0%,
        var(--vch-dim) 50%,
        var(--vch-dim) 100%
    );
}

.vch-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(
        circle at 15% 20%,
        var(--vch-active-glow),
        transparent 38%
    );
    filter: blur(22px);
    opacity: .3;
    border-radius: var(--vch-radius);
}

.vch-panel {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: calc(var(--vch-radius) - 1px);
    background-color: #1a1c1e;
    /*backdrop-filter: blur(80px);*/
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Hero row — avatar + identity (FullName + Id) hug the left,
   live selectors (Status + AssignedTo) sit immediately to the
   right of the FullName rather than the far edge of the panel */
.vch-hero {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 20px;
    align-items: center;
}

.vch-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--vch-active-color);
    background: color-mix(in srgb, var(--vch-active-color) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--vch-active-color) 45%, transparent);
    text-transform: uppercase;
    user-select: none;
}

.vch-hero-identity {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    min-width: 0;
}

.vch-hero-title {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--mud-palette-text-primary);
    cursor: pointer;
    user-select: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color .18s ease;
    min-width: 0;
}

.vch-hero-title:hover {
    color: var(--vch-active-color);
}

.vch-sub-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: #c8d1dc;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .06);
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.vch-sub-chip:hover {
    background: color-mix(in srgb, var(--mud-palette-secondary) 10%, transparent);
    border-color: color-mix(in srgb, var(--mud-palette-secondary) 30%, transparent);
    color: var(--mud-palette-text-primary);
}

.vch-sub-chip--static {
    cursor: default;
}

.vch-sub-chip--static:hover {
    background: rgba(255, 255, 255, .04);
    border-color: rgba(255, 255, 255, .06);
    color: #c8d1dc;
}

.vch-hero-actions {
    grid-column: 3;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    min-width: 0;
    max-width: 420px;
}

.vch-hero-actions > * {
    flex: 1 1 0;
    min-width: 110px;
}

/* Soft horizontal divider between sections */
.vch-divider {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, .12) 50%,
        transparent 100%
    );
}

/* Meta grid — icon + label + value triples */
.vch-meta-grid {
    display: grid;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 10px 16px;
}

.vch-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .02);
    border: 1px solid rgba(255, 255, 255, .05);
    transition: background-color .18s ease, border-color .18s ease;
    min-width: 0;
}

.vch-meta:hover {
    background: color-mix(in srgb, var(--mud-palette-secondary) 6%, transparent);
    border-color: color-mix(in srgb, var(--mud-palette-secondary) 22%, transparent);
}

.vch-meta__row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}

.vch-meta__row--clickable {
    cursor: pointer;
}

.vch-meta__icon {
    color: #7d8895;
    flex: 0 0 auto;
}

.vch-meta__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

.vch-meta__label {
    font-size: 11px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #7d8895;
    line-height: 1.4;
}

.vch-meta__value {
    font-size: 14px;
    color: var(--mud-palette-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.vch-meta__trailing {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

/* Spoiler — blurs the value until the row is hovered.
   Used for sensitive fields (e.g. phone) to keep PII out
   of casual over-the-shoulder view. */
.vch-spoiler {
    filter: blur(4px);
    user-select: none;
    transition: filter .25s ease;
}

.vch-meta:hover .vch-spoiler,
.vch-spoiler:focus,
.vch-spoiler:focus-within {
    filter: none;
    user-select: text;
}

/* Inline selector pill used for Status + Assigned Manager */
.vch-select .mud-input-outlined-border {
    border-radius: 999px !important;
}

.vch-select.vch-select--status .mud-select-input {
    color: var(--vch-active-color);
    font-weight: 600;
}

/* Leverage editor section — remove MudExpansionPanel chrome
   so it sits flush inside the panel */
.vch-leverage .mud-expansion-panels {
    background: transparent !important;
    box-shadow: none !important;
}

.vch-leverage .mud-expand-panel {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
}

/* Responsive collapse */
@media (max-width: 960px) {
    .vch-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: unset;
        grid-auto-flow: row;
        grid-auto-columns: auto;
    }

    .vch-hero {
        grid-template-columns: auto 1fr;
    }

    .vch-hero-identity {
        flex-wrap: wrap;
    }

    .vch-hero-actions {
        grid-column: 1 / -1;
        grid-row: 2;
        flex-wrap: wrap;
    }

    .vch-hero-actions > * {
        flex: 1 1 180px;
        min-width: 0;
    }
}

@media (max-width: 600px) {
    .vch-meta-grid {
        grid-template-columns: 1fr;
        grid-template-rows: unset;
        grid-auto-flow: row;
        grid-auto-columns: auto;
    }

    .vch-panel {
        padding: 16px;
    }

    .vch-avatar {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }

    .vch-hero-title {
        font-size: 18px;
    }

    .vch-hero-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .vch-hero-actions > * {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }
}
