/* VisionPb: Field operations, time, tasks, tech, chat, notifications, search and support. Area sheet; every rule under the VisionPb scope. */

/* ---------- Time records ---------- */

/* The hero (pay period) and the table panel are cotton sheets with the lit edge and soft cast. */
.vision-theme-scope[data-vision-theme="visionpb"] .tw-time-hero,
.vision-theme-scope[data-vision-theme="visionpb"] .tw-time-panel {
    background: var(--vpb-cotton);
    border-radius: var(--vpb-radius-card);
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock);
}

/* The "Pay period" label is a quiet sentence-case caption, not tracked capitals. */
.vision-theme-scope[data-vision-theme="visionpb"] .tw-time-label {
    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"] .tw-availability-text {
    color: var(--color-ink-2);
}

/* Secondary buttons (period arrows, grid scrolling): outlined cotton like every Outlined button.
   !important only to beat the Tailwind rules in tailwind.css, which are themselves !important. */
.vision-theme-scope[data-vision-theme="visionpb"] :is(.tw-glass-button, .tw-fab-mint) {
    background-color: var(--vpb-cotton) !important;
    border-color: transparent !important;
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock) !important;
}

.vision-theme-scope[data-vision-theme="visionpb"] :is(.tw-glass-button, .tw-fab-mint):hover:not(:disabled) {
    background-color: var(--vpb-accent-soft) !important;
}

/* The grid: quiet heads and hairlines on the panel's cotton; the sticky head takes cotton too. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-timerecords-table.mud-table,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-timerecords-table .mud-table-container {
    background: transparent;
    box-shadow: none;
}

.vision-theme-scope[data-vision-theme="visionpb"] .pb-timerecords-table .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;
}

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

/* Hours are figures: Geist Mono, tabular. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-timerecords-table .mud-table-cell {
    font-variant-numeric: tabular-nums;
}

/* ---------- Global search ---------- */

/* The search card and the results card are cotton sheets (the page's scoped CSS draws literal shadows). */
.vision-theme-scope[data-vision-theme="visionpb"] .global-search-page .global-search-card,
.vision-theme-scope[data-vision-theme="visionpb"] .global-search-page .global-search-results-card {
    background: var(--vpb-cotton);
    border: 0;
    border-radius: var(--vpb-radius-card);
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock);
}

/* Result rows: a faint warm wash on hover, in the dropdown, the palette and the page. */
.vision-theme-scope[data-vision-theme="visionpb"] .global-search-item {
    border-radius: var(--vpb-radius-input);
    transition: background-color var(--dur-micro) var(--ease-out);
}

.vision-theme-scope[data-vision-theme="visionpb"] .global-search-item:hover {
    background-color: var(--vpb-paper-3);
}

/* ---------- Chat ---------- */

/* The chat page reads its colours from --pb-chat-* variables set on .pb-chat-page; re-pointing them at
   the VisionPb stock restyles panels, rows, banners and popovers in one place. Shadows use the stock cast. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-chat-page {
    --pb-chat-surface: var(--vpb-cotton);
    --pb-chat-surface-subtle: var(--color-surface-2);
    --pb-chat-surface-hover: var(--vpb-paper-3);
    --pb-chat-border: var(--color-rule);
    --pb-chat-text: var(--color-ink);
    --pb-chat-text-muted: var(--color-ink-2);
    --pb-chat-text-faint: var(--color-ink-3);
    --pb-chat-avatar-bg: var(--vpb-accent-soft);
    --pb-chat-primary: var(--color-accent);
    --pb-chat-primary-soft: var(--vpb-accent-soft);
    --pb-chat-primary-strong: color-mix(in oklab, var(--color-accent) 20%, var(--vpb-cotton));
    --pb-chat-primary-contrast: var(--color-accent-ink);
    --pb-chat-secondary: var(--color-accent);
    --pb-chat-success: var(--color-success);
    --pb-chat-warning: var(--vpb-state-warn);
    --pb-chat-warning-soft: var(--color-warning-wash);
    --pb-chat-error: var(--color-error);
    --pb-chat-error-soft: var(--color-error-wash);
    --pb-chat-info: var(--color-accent);
    --pb-chat-info-soft: var(--vpb-accent-soft);
    --pb-chat-shadow: var(--vpb-cast-stock);
    --pb-chat-shadow-strong: var(--vpb-edge-stock), var(--vpb-cast-stock);
    --pb-chat-shadow-popover: var(--vpb-edge-stock), var(--vpb-cast-stock-lift);
    font-family: var(--vpb-font-body);
}

/* The three panes (channels, conversation, details) are cotton cards with a lit edge. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-chat-sidebar,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-chat-main,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-chat-detail {
    border: 0;
    border-radius: var(--vpb-radius-card);
    box-shadow: var(--vpb-edge-stock), var(--vpb-cast-stock);
}

/* Each message is a small cotton card on the pane; the hover keeps the accent edge. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-chat-message {
    background: var(--vpb-cotton);
    border-radius: var(--vpb-radius-card);
    box-shadow: var(--vpb-edge-stock);
}

/* Each message sits inside a MudMenu (right-click menu) that shrink-wraps it; let the wrapper fill the thread. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-chat-message-list > .mud-menu,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-chat-message-list > .mud-menu > .mud-menu-activator {
    display: block;
    align-self: stretch;
    width: auto;
}

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

/* Own messages take a soft accent tint. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-chat-message.is-me,
.vision-theme-scope[data-vision-theme="visionpb"] .pb-chat-message.is-me:hover {
    background: var(--vpb-accent-soft);
}

/* The day separator and empty state sit on the pane's cotton. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-chat-empty {
    border-radius: var(--vpb-radius-card);
}

/* Times and counts in the thread are figures. */
.vision-theme-scope[data-vision-theme="visionpb"] .pb-chat-message-meta {
    font-variant-numeric: tabular-nums;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .vision-theme-scope[data-vision-theme="visionpb"] .global-search-item {
        transition: none;
    }
}
