/* VisionPb: Accounts and People (account list, account page, contacts, people). Area sheet; every rule under the VisionPb scope. */

/* ---------- Account page head: one cotton card, the name set as the record title ---------- */

.vision-theme-scope[data-vision-theme="visionpb"] .account-overview-card {
    background: var(--vpb-cotton);
    border: 0;
    border-radius: var(--vpb-radius-card);
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock);
}

.vision-theme-scope[data-vision-theme="visionpb"] .account-overview-card .mud-typography-h5 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* "Account ID: 123" is an identifier line: quiet, mono. */
.vision-theme-scope[data-vision-theme="visionpb"] .account-overview-card .mud-typography-body2.mud-secondary-text {
    color: var(--color-ink-2);
    font-family: var(--vpb-font-mono);
    font-variant-numeric: tabular-nums;
}

/* ---------- Tabs: the strip is one cotton card; the panels beneath sit on paper so sections are not cards in a card ---------- */

.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs.mud-tabs {
    background: transparent;
    box-shadow: none;
}

.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-tabs-tabbar {
    background: var(--vpb-cotton);
    border-radius: var(--vpb-radius-card);
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock);
}

.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-tabs-panels {
    background: transparent;
}

.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-tab {
    color: var(--color-ink-2);
    font-family: var(--vpb-font-body);
    transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}

.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-tab:hover {
    background: var(--vpb-paper-3);
    color: var(--color-ink);
}

.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-tab.mud-tab-active {
    color: var(--color-accent);
    font-weight: 600;
}

/* Tab count badges: a quiet blue tint with blue ink, like the portal's counts, not a solid dot. */
.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-badge .mud-badge-root,
.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-badge-root {
    background: var(--vpb-accent-soft);
    color: var(--color-accent);
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-accent) 30%, transparent);
    font-family: var(--vpb-font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

/* ---------- Section cards: cotton, lit edge, soft cast (form sections, scorecard, insights, contact cards) ---------- */

.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-tabs-panels .mud-paper.form-section,
.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-tabs-panels .mud-card,
.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-tabs-panels .pb-quickview-panel,
.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-tabs-panels .mud-expansion-panels {
    background: var(--vpb-cotton);
    border: 0;
    border-radius: var(--vpb-radius-card);
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock);
}

/* Section heads: cotton with a hairline, the title in ink at 600, the icon in the blue. */
.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .form-section-header {
    background: var(--vpb-cotton);
    border-bottom: 1px solid var(--color-rule);
}

.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .form-section-content {
    background: transparent;
}

.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .form-section-title,
.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-card .mud-typography-h6,
.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .pb-quickview-panel .mud-typography-h6 {
    color: var(--color-ink);
    font-family: var(--vpb-font-body);
    font-weight: 600;
    letter-spacing: -0.015em;
}

/* Tables inside a section are part of the section: no card of their own, quiet sentence-case heads, hairlines. */
.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-tabs-panels .mud-table,
.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-tabs-panels .mud-table-container {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-table-head .mud-table-cell {
    background: transparent;
    border-bottom: 1px solid var(--color-rule-strong);
    color: var(--color-ink-2);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-table-body .mud-table-cell {
    border-bottom: 1px solid var(--color-rule);
    font-variant-numeric: tabular-nums;
}

.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-table-body .mud-table-row:last-child .mud-table-cell {
    border-bottom: 0;
}

.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-table-body .mud-table-row:hover > .mud-table-cell {
    background: var(--vpb-paper-3);
}

/* Right-aligned cells carry money and counts. */
.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-table-body .mud-table-cell-align-right {
    font-family: var(--vpb-font-mono);
}

/* Record ids (AD…, PY…, S0…) and links read as links in the blue. */
.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-table-body .mud-link {
    color: var(--color-accent);
    font-family: var(--vpb-font-mono);
    font-variant-numeric: tabular-nums;
    text-decoration: none;
}

.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-table-body .mud-link:hover {
    color: var(--vpb-accent-2);
    text-decoration: underline;
}

.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-table-pagination {
    border-top: 1px solid var(--color-rule);
    color: var(--color-ink-2);
    font-variant-numeric: tabular-nums;
}

/* ---------- Overview: health scorecard facts as quiet label / mono value pairs ---------- */

.vision-theme-scope[data-vision-theme="visionpb"] .account-section-card .mud-typography-h3 {
    font-family: var(--vpb-font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    letter-spacing: -0.03em;
}

.vision-theme-scope[data-vision-theme="visionpb"] .account-section-card .mud-typography-subtitle2 {
    color: var(--color-ink-2);
    font-size: var(--text-sm);
    font-weight: 500;
}

.vision-theme-scope[data-vision-theme="visionpb"] .account-section-card .mud-typography-subtitle2 + .mud-typography-body2 {
    color: var(--color-ink);
    font-family: var(--vpb-font-mono);
    font-variant-numeric: tabular-nums;
}

/* Account Insights: the subtitle and secondary lines stay quiet; the search box takes the input look. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-quickview-panel .mud-typography-caption,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-quickview-panel .mud-text-secondary {
    color: var(--color-ink-2);
}

.vision-theme-scope[data-vision-theme="visionpb"] .pb-quickview-panel .pb-quickview-list-item {
    border-bottom: 1px solid var(--color-rule);
    transition: background-color var(--dur-micro) var(--ease-out);
}

.vision-theme-scope[data-vision-theme="visionpb"] .pb-quickview-panel .pb-quickview-list-item:hover {
    background: var(--vpb-paper-3);
}

/* Contact card: avatar in a blue tint instead of a solid colour block. */
.vision-theme-scope[data-vision-theme="visionpb"] .contact-card .mud-avatar {
    background: var(--vpb-accent-soft);
    color: var(--color-accent);
    font-weight: 600;
}

/* ---------- Lists (accounts, people, retention queue): one cotton sheet (the filter well is shared) ---------- */

.vision-theme-scope[data-vision-theme="visionpb"] .accounts-grid > .mud-paper,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-flat-surfaces > .mud-paper:has(> .mud-table) {
    background: var(--vpb-cotton);
    border: 0;
    border-radius: var(--vpb-radius-card);
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock);
}

.vision-theme-scope[data-vision-theme="visionpb"] .accounts-grid .mud-table,
.vision-theme-scope[data-vision-theme="visionpb"] .accounts-grid .mud-table-container,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-flat-surfaces .mud-paper > .mud-table {
    background: transparent;
    box-shadow: none;
}

.vision-theme-scope[data-vision-theme="visionpb"] .accounts-grid .mud-table-head .mud-table-cell,
.vision-theme-scope[data-vision-theme="visionpb"] .accounts-grid .mud-table-head .mud-table-cell .column-header {
    background: var(--vpb-cotton);
    color: var(--color-ink-2);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.vision-theme-scope[data-vision-theme="visionpb"] .accounts-grid .mud-table-cell {
    border-inline: 0;
    border-block-end: 1px solid var(--color-rule);
}

/* The head rule is an inset shadow so every head cell draws it, whatever its own border does. */
.vision-theme-scope[data-vision-theme="visionpb"] .accounts-grid .mud-table-head .mud-table-cell {
    border-block-end: 0;
    box-shadow: inset 0 -1px 0 var(--color-rule-strong);
}

.vision-theme-scope[data-vision-theme="visionpb"] .accounts-grid .mud-table-body .mud-table-row:hover > .mud-table-cell {
    background: var(--vpb-paper-3);
}

/* Counts (quotes, open, all, complete, invoices) are figures: mono, tabular, in the blue as links. */
.vision-theme-scope[data-vision-theme="visionpb"] .accounts-grid .account-count-link {
    color: var(--color-accent);
    font-family: var(--vpb-font-mono);
    font-variant-numeric: tabular-nums;
    text-decoration: none;
}

.vision-theme-scope[data-vision-theme="visionpb"] .accounts-grid .account-count-link:hover {
    background: var(--vpb-accent-soft);
    color: var(--vpb-accent-2);
}

.vision-theme-scope[data-vision-theme="visionpb"] .accounts-grid .text-muted {
    color: var(--color-ink-2);
}

/* ---------- People editor: the areas and roles control becomes a hairline card on cotton ---------- */

.vision-theme-scope[data-vision-theme="visionpb"] .people-access {
    background: var(--vpb-cotton);
    border-color: var(--color-rule);
    border-radius: var(--vpb-radius-card);
}

.vision-theme-scope[data-vision-theme="visionpb"] .people-access__areas {
    background: var(--vpb-paper-3);
    border-color: var(--color-rule);
}

.vision-theme-scope[data-vision-theme="visionpb"] .people-access__area:hover {
    background: var(--color-hover);
}

.vision-theme-scope[data-vision-theme="visionpb"] .people-access__area--active {
    background: var(--vpb-accent-soft);
    border-left-color: var(--color-accent);
}

.vision-theme-scope[data-vision-theme="visionpb"] .people-access__count {
    background: var(--vpb-accent-soft);
    color: var(--color-accent);
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-accent) 30%, transparent);
    font-family: var(--vpb-font-mono);
    font-weight: 500;
}

/* ---------- Focus and motion ---------- */

.vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-tab:focus-visible,
.vision-theme-scope[data-vision-theme="visionpb"] .accounts-grid :is(.mud-link, .mud-icon-button, button, a):focus-visible,
.vision-theme-scope[data-vision-theme="visionpb"] .people-access__area:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

@media (any-pointer: coarse) {
    .vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-tab {
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vision-theme-scope[data-vision-theme="visionpb"] .account-tabs .mud-tab,
    .vision-theme-scope[data-vision-theme="visionpb"] .pb-quickview-panel .pb-quickview-list-item {
        transition: none;
    }
}
