/* VisionPb: Reports, Business Opportunities and the Home dashboard tabs beyond Home. Area sheet; every rule under the VisionPb scope.
   The Home tab strip is home.css's; these rules style the panels' content and the report pages. */

/* ---- Report tab strip (Sales / Customer growth, Pipeline / Follow-up): labels on a rule, not a boxed bar ---- */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-tabs-tabbar.mud-paper-outlined {
    background-color: transparent;
    border: 0;
    border-bottom: var(--rule-width) solid var(--color-rule);
    border-radius: 0;
    box-shadow: none;
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-tabs-tabbar.mud-paper-outlined .mud-tab {
    font-family: var(--vpb-font-body);
    text-transform: none;
    letter-spacing: 0;
    color: var(--color-ink-2);
}

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

.vision-theme-scope[data-vision-theme="visionpb"] .mud-tabs-tabbar.mud-paper-outlined .mud-tab.mud-tab-active {
    background-color: transparent;
    color: var(--color-ink);
    font-weight: 600;
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-tabs-tabbar.mud-paper-outlined .mud-tab-slider {
    background-color: var(--color-accent);
}

/* ---- Report tables: hairline rows, quiet heads, figures in columns ---- */
.vision-theme-scope[data-vision-theme="visionpb"] .report-table-frame .mud-table {
    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"] .report-table-frame .mud-table-head .mud-table-cell {
    background: var(--vpb-cotton);
    color: var(--color-ink-2);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    border-block-end: 1px solid var(--color-rule-strong);
}

.vision-theme-scope[data-vision-theme="visionpb"] .report-table-frame .mud-table-body .mud-table-cell {
    border-inline: 0;
    border-block-end: 1px solid var(--color-rule);
    font-variant-numeric: tabular-nums;
}

.vision-theme-scope[data-vision-theme="visionpb"] .report-table-frame .mud-table-body .mud-table-row:last-child .mud-table-cell {
    border-block-end: 0;
}

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

/* Right-aligned cells are the money and count columns: set them in mono. */
.vision-theme-scope[data-vision-theme="visionpb"] .report-table-frame .mud-table-body .mud-table-cell.mud-table-cell-align-right {
    font-family: var(--vpb-font-mono);
}

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

/* Pinned columns: the warm rule replaces the grey cast the page sheet draws. */
.vision-theme-scope[data-vision-theme="visionpb"] .report-table-frame .mud-table-cell.sticky-left {
    box-shadow: inset -1px 0 0 var(--color-rule);
}

.vision-theme-scope[data-vision-theme="visionpb"] .report-table-frame .mud-table-cell.sticky-right {
    box-shadow: inset 1px 0 0 var(--color-rule);
}

/* ---- Stat tiles on Business Opportunities pages: quiet label over a mono figure ---- */
.vision-theme-scope[data-vision-theme="visionpb"] .mud-paper.h-100 > .mud-typography-caption:first-child {
    color: var(--color-ink-2);
    font-size: var(--text-sm);
    letter-spacing: 0;
    text-transform: none;
}

.vision-theme-scope[data-vision-theme="visionpb"] .mud-paper.h-100 > .mud-typography-caption + .mud-typography-h6 {
    font-family: var(--vpb-font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

/* ---- Overview "What needs attention" tiles: cotton cards; urgency is the figure's colour only ---- */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-dashboard-tabs .cockpit-tile {
    background-color: var(--vpb-cotton);
    border: 0;
    border-radius: var(--vpb-radius-card);
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock);
    transition: background-color var(--dur-micro) var(--ease-out);
}

.vision-theme-scope[data-vision-theme="visionpb"] .pb-dashboard-tabs .cockpit-tile:hover {
    background-color: var(--vpb-paper-3);
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock);
    transform: none;
}

.vision-theme-scope[data-vision-theme="visionpb"] .pb-dashboard-tabs .cockpit-tile .cockpit-tile__title {
    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"] .pb-dashboard-tabs .cockpit-tile .cockpit-tile__value {
    font-family: var(--vpb-font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.vision-theme-scope[data-vision-theme="visionpb"] .pb-dashboard-tabs .cockpit-tile--critical .cockpit-tile__value {
    color: var(--vpb-state-bad);
}

/* ---- Manager and Sales dashboards: stat cards read like the portal's stat row ---- */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-dashboard-tabs .mud-card-content > .mud-typography-h6 {
    color: var(--color-ink-2);
    font-size: var(--text-sm);
    font-weight: 500;
}

.vision-theme-scope[data-vision-theme="visionpb"] .pb-dashboard-tabs .mud-card-content > .mud-typography-h4 {
    font-family: var(--vpb-font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    /* Mono runs wider than the sans it replaces; a smaller size keeps $ totals on one line. */
    font-size: 1.25rem;
    line-height: 1.3;
}

/* Order-status counts and similar figure rows. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-dashboard-tabs .mud-link.mud-typography-body1,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-dashboard-tabs .mud-chip {
    font-variant-numeric: tabular-nums;
}

/* ---- Focus and reduced motion ---- */
.vision-theme-scope[data-vision-theme="visionpb"] .report-table-frame :is(.mud-link, .mud-icon-button, button, a):focus-visible,
.vision-theme-scope[data-vision-theme="visionpb"] .mud-tabs-tabbar.mud-paper-outlined .mud-tab:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .vision-theme-scope[data-vision-theme="visionpb"] .pb-dashboard-tabs .cockpit-tile {
        transition: none;
    }
}

/* ---- Touch: 44px targets in report tables ---- */
@media (any-pointer: coarse) {
    .vision-theme-scope[data-vision-theme="visionpb"] .report-table-frame .mud-icon-button {
        min-width: var(--tap-target, 44px);
        min-height: var(--tap-target, 44px);
    }
}
