/* BHBOP - Carbon/BOP Operations Design System
 * IBM Carbon-inspired foundations adapted to Blazor/MudBlazor.
 * Neutral layers, compact controls, crisp borders, and focused blue interactions.
 */

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
    /* Carbon/BOP Neutral Palette */
    --bop-primary: #0F62FE;
    --bop-primary-dark: #0353E9;
    --bop-primary-deep: #002D9C;
    --bop-primary-soft: #EDF5FF;
    --bop-primary-whisper: #F8FBFF;
    --bop-secondary: #393939;
    --bop-secondary-dark: #262626;
    --bop-secondary-deep: #161616;
    --bop-secondary-soft: #F4F4F4;
    --bop-tertiary: #0072C3;
    --bop-tertiary-dark: #00539A;
    --bop-tertiary-deep: #003A6D;
    --bop-tertiary-soft: #E5F6FF;
    --bop-accent-warm: #FF832B;
    --bop-accent-warm-soft: #FFF2E8;
    --bop-brand-red: var(--bop-primary);
    --bop-brand-red-dark: var(--bop-primary-dark);
    --bop-brand-red-deep: var(--bop-primary-deep);
    --bop-brand-red-soft: var(--bop-primary-soft);
    --bop-brand-blue: var(--bop-secondary);
    --bop-brand-blue-dark: var(--bop-secondary-dark);
    --bop-brand-blue-deep: var(--bop-secondary-deep);
    --bop-brand-blue-soft: var(--bop-secondary-soft);
    --bop-brand-rose: var(--bop-brand-red);
    --bop-brand-rose-dark: var(--bop-brand-red-dark);
    --bop-brand-rose-deep: var(--bop-brand-red-deep);
    --bop-brand-rose-soft: var(--bop-brand-red-soft);
    --bop-brand-magenta: var(--bop-brand-red);
    --bop-brand-magenta-dark: var(--bop-brand-red-dark);
    --bop-brand-magenta-deep: var(--bop-brand-red-deep);
    --bop-brand-magenta-soft: var(--bop-brand-red-soft);
    --bop-background: #F4F4F4;
    --bop-background-cool: #F4F4F4;
    --bop-background-blush: #FAFAFA;
    --bop-app-gradient: #F4F4F4;
    --bop-surface: #FFFFFF;
    --bop-surface-raised: #FFFFFF;
    --bop-surface-muted: #F4F4F4;
    --bop-sidebar-bg: #161616;
    --bop-sidebar-bg-2: #262626;
    --bop-text-primary: #161616;
    --bop-text-secondary: #525252;
    --bop-text-tertiary: #6F6F6F;
    --bop-divider: #E0E0E0;
    --bop-divider-strong: #8D8D8D;
    --bop-disabled: #C6C6C6;
    --bop-hover: #E8E8E8;
    --bop-hover-strong: #DCDCDC;
    --bop-input-bg: #F4F4F4;
    --bop-focus-border: var(--bop-primary);

    /* Semantic Colors (restrained) */
    --bop-success: #24A148;
    --bop-success-soft: #DEFBE6;
    --bop-warning: #F1C21B;
    --bop-warning-soft: #FCF4D6;
    --bop-error: #DA1E28;
    --bop-error-soft: #FFF1F1;
    --bop-info: #0F62FE;
    --bop-info-soft: #EDF5FF;

    /* Spacing Scale */
    --bop-space-tight: 8px;
    --bop-space-base: 12px;
    --bop-space-comfortable: 16px;
    --bop-space-generous: 24px;
    --bop-space-spacious: 32px;

    /* Legacy spacing aliases */
    --bop-space-xs: 4px;
    --bop-space-sm: 8px;
    --bop-space-md: 16px;
    --bop-space-lg: 24px;
    --bop-space-xl: 32px;
    --bop-space-xxl: 48px;

    /* Typography */
    --bop-font-family: 'IBM Plex Sans', 'Inter', 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;

    /* Border Radius Scale */
    --bop-radius-sm: 2px;
    --bop-radius-md: 4px;
    --bop-radius-lg: 8px;
    --bop-radius-xl: 8px;
    --bop-radius-pill: 999px;

    /* Elevation Scale */
    --bop-shadow-1: 0 1px 2px rgba(22, 22, 22, 0.05);
    --bop-shadow-2: 0 2px 6px rgba(22, 22, 22, 0.08);
    --bop-shadow-3: 0 12px 32px rgba(22, 22, 22, 0.16);
    --bop-shadow-focus: 0 0 0 3px rgba(15, 98, 254, 0.18);
    --bop-glass-border: var(--bop-divider);
    --bop-ease-standard: cubic-bezier(0.32, 0.72, 0, 1);
    --bop-transition-fast: 140ms var(--bop-ease-standard);
    --bop-transition: 220ms var(--bop-ease-standard);

    /* Layout */
    --bop-sidebar-width: 260px;
    --bop-sidebar-margin: 0px;

    /* Carbon role aliases for migration docs and one-off page upgrades. */
    --bop-carbon-blue-60: #0F62FE;
    --bop-carbon-blue-70: #0353E9;
    --bop-carbon-blue-80: #002D9C;
    --bop-carbon-gray-10: #F4F4F4;
    --bop-carbon-gray-20: #E0E0E0;
    --bop-carbon-gray-60: #6F6F6F;
    --bop-carbon-gray-80: #393939;
    --bop-carbon-gray-100: #161616;
    --bop-carbon-layer-01: var(--bop-surface);
    --bop-carbon-layer-02: var(--bop-surface-muted);
    --bop-carbon-border-subtle: var(--bop-divider);
    --bop-carbon-border-strong: var(--bop-divider-strong);
}

/* ============================================
   Dashboard Brand Overrides
   Keep the dashboard accent aligned with the calm blue sidebar.
   ============================================ */
body.dashboard-active .overview-card--active,
body.dashboard-active .pcw-fab,
body.dashboard-active .pcw-phone-quick-call,
body.dashboard-active .pcw-phone-connect-btn,
body.dashboard-active .pcw-phone-dial-btn,
body.dashboard-active .pcw-phone-keypad-btn--primary {
    background: var(--bop-sidebar-bg) !important;
}

body.dashboard-active .overview-trend,
body.dashboard-active .bh-post-focus-pill,
body.dashboard-active .pcw-phone-soft-badge,
body.dashboard-active .pcw-phone-state-pill {
    background: var(--bop-tertiary-soft) !important;
    color: var(--bop-sidebar-bg) !important;
}

body.dashboard-active .overview-card--active .overview-trend {
    background: rgba(255, 255, 255, 0.22) !important;
    color: #FFFFFF !important;
}

body.dashboard-active .bh-feed-focus-kicker,
body.dashboard-active .pcw-panel__eyebrow,
body.dashboard-active .pcw-panel__tab--active,
body.dashboard-active .pcw-panel__tab--active .mud-icon-root,
body.dashboard-active .pcw-phone-muted-action,
body.dashboard-active .pcw-phone-section-title {
    color: var(--bop-brand-blue) !important;
}

body.dashboard-active .bh-post--focused {
    border-color: rgba(15, 98, 254, 0.24) !important;
    box-shadow: 0 12px 32px rgba(22, 22, 22, 0.08),
                0 0 0 1px rgba(15, 98, 254, 0.14) !important;
}

body.dashboard-active .pcw-fab {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18) !important;
}

body.dashboard-active .pcw-fab:hover {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22) !important;
}

body.dashboard-active .pcw-fab:focus-visible,
body.dashboard-active .pcw-panel__minimize-btn:focus-visible,
body.dashboard-active .pcw-panel__tab:focus-visible {
    outline-color: var(--bop-brand-blue) !important;
}

body.dashboard-active .pcw-fab::before {
    border-color: rgba(15, 98, 254, 0.28) !important;
}

body.dashboard-active .pcw-fab__status-dot,
body.dashboard-active .pcw-panel__title::before,
body.dashboard-active .pcw-phone-status-dot {
    background: var(--bop-sidebar-bg-2) !important;
    box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.18) !important;
}

body.dashboard-active .pcw-panel__tab--active {
    box-shadow: 0 1px 2px rgba(22, 22, 22, 0.06),
                0 2px 8px rgba(15, 98, 254, 0.14) !important;
}

/* ============================================
   Base Reset & Typography
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--bop-font-family);
    background: var(--bop-app-gradient);
    color: var(--bop-text-primary);
    line-height: 1.5;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
}

::selection {
    background: rgba(15, 98, 254, 0.16);
    color: var(--bop-text-primary);
}

/* ============================================
   Calm Global MudBlazor Surface Layer
   ============================================ */
.mud-typography,
.mud-input,
.mud-button,
.mud-table,
.mud-list,
.mud-menu,
.mud-popover,
.mud-dialog {
    font-family: var(--bop-font-family) !important;
}

.mud-paper,
.mud-card {
    background-color: var(--bop-surface) !important;
    color: var(--bop-text-primary) !important;
    border-radius: var(--bop-radius-lg) !important;
    border-color: var(--bop-divider) !important;
}

.mud-elevation-1,
.mud-elevation-2,
.mud-elevation-3,
.mud-elevation-4,
.mud-elevation-6,
.mud-elevation-8 {
    box-shadow: var(--bop-shadow-1) !important;
}

.mud-menu,
.mud-popover,
.mud-picker,
.mud-tooltip {
    border-radius: var(--bop-radius-md) !important;
}

.mud-popover,
.mud-menu {
    border: 1px solid var(--bop-divider);
    box-shadow: var(--bop-shadow-2) !important;
    overflow: hidden;
}

.mud-list-item {
    border-radius: var(--bop-radius-sm) !important;
    color: var(--bop-text-secondary) !important;
    transition: background-color var(--bop-transition-fast), color var(--bop-transition-fast), transform var(--bop-transition-fast);
}

.mud-list-item:hover,
.mud-list-item:focus-visible {
    background: var(--bop-hover) !important;
    color: var(--bop-text-primary) !important;
}

.mud-icon-root {
    color: currentColor;
}

.mud-divider {
    border-color: var(--bop-divider) !important;
}

.mud-alert {
    border-radius: var(--bop-radius-md) !important;
    box-shadow: none !important;
    border: 1px solid transparent;
}

.mud-alert-filled-info,
.mud-alert-outlined-info {
    background: var(--bop-info-soft) !important;
    color: var(--bop-primary-deep) !important;
    border-color: rgba(15, 98, 254, 0.18) !important;
}

.mud-alert-filled-success,
.mud-alert-outlined-success {
    background: var(--bop-success-soft) !important;
    color: #0E6027 !important;
    border-color: rgba(36, 161, 72, 0.22) !important;
}

.mud-alert-filled-warning,
.mud-alert-outlined-warning {
    background: var(--bop-warning-soft) !important;
    color: #684E00 !important;
    border-color: rgba(241, 194, 27, 0.34) !important;
}

.mud-alert-filled-error,
.mud-alert-outlined-error {
    background: var(--bop-error-soft) !important;
    color: #A2191F !important;
    border-color: rgba(218, 30, 40, 0.22) !important;
}

.mud-chip,
.mud-chip-filled {
    border-radius: var(--bop-radius-pill) !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}

.mud-tabs-toolbar {
    background: transparent !important;
    border-bottom: 1px solid var(--bop-divider);
    min-height: 42px !important;
}

.mud-tab {
    min-height: 42px !important;
    text-transform: none !important;
    font-weight: 600 !important;
    color: var(--bop-text-secondary) !important;
    transition: color var(--bop-transition-fast), background-color var(--bop-transition-fast);
}

.mud-tab:hover {
    background: var(--bop-hover) !important;
    color: var(--bop-text-primary) !important;
}

.mud-tab.mud-tab-active {
    color: var(--bop-primary) !important;
}

.mud-tabs-toolbar .mud-tabs-toolbar-inner .mud-tabs-toolbar-content .mud-tab-slider {
    background: var(--bop-primary) !important;
    height: 2px !important;
    border-radius: var(--bop-radius-pill);
}

/* ============================================
   Focus States (Accessibility)
   ============================================ */
:focus-visible {
    outline: 2px solid var(--bop-primary);
    outline-offset: 2px;
}

h1:focus, h2:focus, h3:focus, h4:focus, h5:focus, h6:focus {
    outline: none;
}

/* ============================================
   Link Styling
   ============================================ */
a {
    color: var(--bop-primary);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

a:hover {
    opacity: 0.75;
}

/* ============================================
   Form Validation States
   ============================================ */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--bop-success);
}

.invalid {
    outline: 1px solid var(--bop-error);
}

.validation-message {
    color: var(--bop-error);
    font-size: 0.8125rem;
    margin-top: 4px;
}

/* ============================================
   Blazor Error Boundary (Fallback)
   ============================================ */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: var(--bop-space-md) var(--bop-space-md) var(--bop-space-md) 3.7rem;
    color: white;
    border-radius: var(--bop-radius-md);
    margin: var(--bop-space-md);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ============================================
   Utility Classes
   ============================================ */
.bop-text-primary { color: var(--bop-text-primary); }
.bop-text-secondary { color: var(--bop-text-secondary); }
.bop-text-tertiary { color: var(--bop-text-tertiary); }
.bop-bg-surface { background-color: var(--bop-surface); }

/* Spacing utilities */
.bop-mt-xs { margin-top: var(--bop-space-xs); }
.bop-mt-sm { margin-top: var(--bop-space-sm); }
.bop-mt-md { margin-top: var(--bop-space-md); }
.bop-mt-lg { margin-top: var(--bop-space-lg); }
.bop-mt-xl { margin-top: var(--bop-space-xl); }
.bop-mb-xs { margin-bottom: var(--bop-space-xs); }
.bop-mb-sm { margin-bottom: var(--bop-space-sm); }
.bop-mb-md { margin-bottom: var(--bop-space-md); }
.bop-mb-lg { margin-bottom: var(--bop-space-lg); }
.bop-mb-xl { margin-bottom: var(--bop-space-xl); }
.bop-p-xs { padding: var(--bop-space-xs); }
.bop-p-sm { padding: var(--bop-space-sm); }
.bop-p-md { padding: var(--bop-space-md); }
.bop-p-lg { padding: var(--bop-space-lg); }
.bop-p-xl { padding: var(--bop-space-xl); }

/* ============================================
   SaaS Grid & Table Styling (Global)
   ============================================ */

/* Shared grid container — inside white cards */
.bop-grid {
    border: none;
    border-radius: 0;
    overflow: hidden;
    background: var(--bop-surface);
}

/* Header cells */
.bop-grid .mud-table-head .mud-table-cell {
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bop-text-secondary);
    background: var(--bop-surface-muted);
    border-bottom: 1px solid var(--bop-divider);
    padding: 12px 16px;
    white-space: nowrap;
}

/* Body cells — balanced height, subtle separators (expanded mode default) */
.bop-grid .mud-table-body .mud-table-cell {
    padding: 12px 16px;
    border-bottom: 1px solid var(--bop-divider);
    font-size: 0.8125rem;
    color: var(--bop-text-primary);
    vertical-align: middle;
    transition: padding var(--bop-transition-fast), background-color var(--bop-transition-fast), color var(--bop-transition-fast);
}

/* Condensed density mode */
.bop-grid--condensed .mud-table-body .mud-table-cell {
    padding: 10px 16px;
}

/* Expanded density mode (explicit) */
.bop-grid--expanded .mud-table-body .mud-table-cell {
    padding: 12px 16px;
}

/* Last row — no bottom border */
.bop-grid .mud-table-body .mud-table-row:last-child .mud-table-cell {
    border-bottom: none;
}

/* Row hover */
.bop-grid .mud-table-body .mud-table-row {
    transition: background-color var(--bop-transition-fast), transform var(--bop-transition-fast);
}

.bop-grid .mud-table-body .mud-table-row:hover {
    background-color: var(--bop-hover) !important;
}

/* Clickable rows */
.bop-grid-clickable .mud-table-body .mud-table-row {
    cursor: pointer;
}

.bop-grid-clickable .mud-table-body .mud-table-row:active {
    background-color: var(--bop-hover-strong) !important;
}

/* Remove MudDataGrid internal borders */
.bop-grid .mud-table-container {
    border-radius: 0;
}

.bop-grid.mud-table,
.bop-grid .mud-table {
    border: none;
}

/* Sort icon styling */
.bop-grid .mud-table-head .mud-table-cell .mud-table-sort-label {
    color: var(--bop-text-secondary);
}

/* Selected row highlight */
.bop-grid .mud-table-body .mud-table-row.bop-row-selected {
    background-color: var(--bop-primary-soft);
}

.bop-grid .mud-table-body .mud-table-row.bop-row-selected:hover {
    background-color: #D0E2FF !important;
}

/* Row action column — minimal width */
.bop-grid .bop-col-actions {
    width: 48px;
    text-align: center;
    padding: 0 8px !important;
}

/* Checkbox column — minimal width */
.bop-grid .bop-col-checkbox {
    width: 48px;
    text-align: center;
    padding: 0 8px !important;
}

/* Shared simple table styling */
.bop-simple-table {
    background: transparent;
}

.bop-simple-table .mud-table-container {
    border-radius: 0;
}

.bop-simple-table thead th {
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bop-text-secondary);
    background: var(--bop-surface-muted);
    border-bottom: 1px solid var(--bop-divider);
    padding: 12px 16px;
    white-space: nowrap;
}

.bop-simple-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--bop-divider);
    font-size: 0.8125rem;
    color: var(--bop-text-primary);
    vertical-align: middle;
}

.bop-simple-table tbody tr:last-child td {
    border-bottom: none;
}

.bop-simple-table tbody tr {
    transition: background-color var(--bop-transition-fast);
}

.bop-simple-table tbody tr:hover {
    background-color: var(--bop-hover);
}

/* Generic MudTable/DataGrid fallback for modules that do not use BopDataGrid yet. */
.mud-table:not(.bop-grid) {
    background: var(--bop-surface) !important;
    border: 1px solid var(--bop-divider);
    border-radius: var(--bop-radius-md) !important;
    box-shadow: var(--bop-shadow-1) !important;
    overflow: hidden;
    max-width: 100%;
}

.mud-table:not(.bop-grid) .mud-table-container {
    border-radius: inherit;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bop-divider-strong) transparent;
}

.mud-table:not(.bop-grid) .mud-table-container::-webkit-scrollbar {
    height: 8px;
}

.mud-table:not(.bop-grid) .mud-table-container::-webkit-scrollbar-thumb {
    background: var(--bop-divider-strong);
    border-radius: 999px;
}

.mud-table:not(.bop-grid) .mud-table-container::-webkit-scrollbar-track {
    background: transparent;
}

.mud-table:not(.bop-grid) .mud-table-head .mud-table-cell,
.mud-table:not(.bop-grid) thead .mud-table-cell,
.mud-table:not(.bop-grid) thead th {
    background: var(--bop-surface-muted) !important;
    color: var(--bop-text-secondary) !important;
    border-bottom: 1px solid var(--bop-divider) !important;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mud-table:not(.bop-grid) .mud-table-body .mud-table-cell,
.mud-table:not(.bop-grid) tbody .mud-table-cell,
.mud-table:not(.bop-grid) tbody td {
    color: var(--bop-text-primary);
    border-bottom: 1px solid var(--bop-divider) !important;
    font-variant-numeric: tabular-nums;
}

.mud-table:not(.bop-grid) .mud-table-body .mud-table-row,
.mud-table:not(.bop-grid) tbody tr {
    box-shadow: inset 0 0 0 transparent;
    transition: background-color var(--bop-transition-fast), box-shadow var(--bop-transition-fast);
}

.mud-table:not(.bop-grid) .mud-table-body .mud-table-row:hover,
.mud-table:not(.bop-grid) tbody tr:hover {
    background: var(--bop-hover) !important;
    box-shadow: inset 3px 0 0 var(--bop-primary);
}

.mud-table:not(.bop-grid) .mud-table-body .mud-table-row:focus-within,
.mud-table:not(.bop-grid) tbody tr:focus-within {
    background: var(--bop-primary-soft) !important;
    box-shadow: inset 3px 0 0 var(--bop-primary);
}

.number-col,
.amount-col,
.score-col,
.bop-col-number,
.bop-col-amount,
.bop-col-score,
td.number-col,
td.amount-col,
td.score-col,
th.number-col,
th.amount-col,
th.score-col {
    text-align: right !important;
    font-variant-numeric: tabular-nums !important;
}

.bop-grid .mud-table-container,
.bop-simple-table .mud-table-container {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--bop-divider-strong) transparent;
}

/* Mono text for IDs, GUIDs, keys */
.bop-mono {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.78rem;
    color: var(--bop-text-secondary);
}

/* Truncated text cells */
.bop-cell-truncate {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Grid responsive */
@media (max-width: 767px) {
    .bop-grid .mud-table-head .mud-table-cell,
    .bop-grid .mud-table-body .mud-table-cell {
        padding: 10px 12px;
        font-size: 0.78rem;
    }

    .bop-simple-table thead th,
    .bop-simple-table tbody td {
        padding: 10px 12px;
        font-size: 0.78rem;
    }
}

/* ============================================
   Modern Input Styling (Global Overrides)
   ============================================ */

/* Soft filled input base */
.mud-input-control,
.bop-field .mud-input-control {
    margin-bottom: 0;
}

.mud-input.mud-input-filled,
.bop-field .mud-input.mud-input-filled {
    background: var(--bop-input-bg);
    border-radius: var(--bop-radius-md);
    border: 1px solid var(--bop-divider);
    min-height: 42px;
    transition: background var(--bop-transition-fast), border-color var(--bop-transition-fast), box-shadow var(--bop-transition-fast), transform var(--bop-transition-fast);
}

.mud-input.mud-input-filled::before,
.mud-input.mud-input-filled::after,
.bop-field .mud-input.mud-input-filled::before,
.bop-field .mud-input.mud-input-filled::after {
    border-bottom: none !important;
}

.mud-input.mud-input-filled:hover,
.bop-field .mud-input.mud-input-filled:hover {
    background: #FFFFFF;
    border-color: var(--bop-divider-strong);
}

.mud-input.mud-input-filled.mud-input-focused,
.bop-field .mud-input.mud-input-filled.mud-input-focused {
    background: #FFFFFF;
    border-color: var(--bop-focus-border);
    box-shadow: var(--bop-shadow-focus);
}

.mud-input.mud-input-filled.mud-input-error,
.bop-field .mud-input.mud-input-filled.mud-input-error {
    border-color: var(--bop-error);
}

.mud-input.mud-input-filled.mud-input-error.mud-input-focused,
.bop-field .mud-input.mud-input-filled.mud-input-error.mud-input-focused {
    box-shadow: 0 0 0 3px rgba(218, 30, 40, 0.16);
}

/* Label styling for filled inputs */
.mud-input-label,
.bop-field .mud-input-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--bop-text-secondary);
    transition: color var(--bop-transition-fast);
}

.mud-input-label.mud-input-label-focused,
.bop-field .mud-input-label.mud-input-label-focused {
    color: var(--bop-primary);
}

/* Helper and error text */
.mud-input-helper-text,
.bop-field .mud-input-helper-text {
    font-size: 0.75rem;
    margin-top: 4px;
    color: var(--bop-text-tertiary);
}

/* Select dropdown styling */
.bop-field .mud-select .mud-input.mud-input-filled {
    cursor: pointer;
}

.mud-input.mud-input-text,
.mud-input.mud-input-outlined {
    background: var(--bop-input-bg) !important;
    border: 1px solid var(--bop-divider) !important;
    border-radius: var(--bop-radius-md) !important;
    min-height: 42px;
    padding-inline: 10px;
    transition: background var(--bop-transition-fast), border-color var(--bop-transition-fast), box-shadow var(--bop-transition-fast);
}

.mud-input.mud-input-text::before,
.mud-input.mud-input-text::after,
.mud-input.mud-input-outlined::before,
.mud-input.mud-input-outlined::after {
    border-bottom: none !important;
}

.mud-input.mud-input-text:hover,
.mud-input.mud-input-outlined:hover {
    background: #FFFFFF !important;
    border-color: var(--bop-divider-strong) !important;
}

.mud-input.mud-input-text.mud-input-focused,
.mud-input.mud-input-outlined.mud-input-focused {
    background: #FFFFFF !important;
    border-color: var(--bop-focus-border) !important;
    box-shadow: var(--bop-shadow-focus) !important;
}

.mud-input.mud-input-text .mud-input-slot,
.mud-input.mud-input-outlined .mud-input-slot {
    padding-top: 10px;
    padding-bottom: 8px;
}

.mud-input.mud-input-text.mud-input-adorned-start,
.mud-input.mud-input-outlined.mud-input-adorned-start {
    padding-left: 8px;
}

.mud-input.mud-input-text.mud-input-adorned-end,
.mud-input.mud-input-outlined.mud-input-adorned-end {
    padding-right: 8px;
}

.mud-input.mud-input-outlined .mud-input-outlined-border {
    border: 0 !important;
}

/* ============================================
   Dialog & Modal Motion (Global)
   ============================================ */

/* Smooth scale-in + fade for MudDialog */
.mud-dialog-container {
    animation: bop-dialog-backdrop-in 0.2s ease-out;
}

@keyframes bop-dialog-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mud-dialog {
    animation: bop-dialog-in 0.22s cubic-bezier(0.32, 0.72, 0, 1);
    border-radius: var(--bop-radius-md) !important;
    background: #FFFFFF !important;
    border: 1px solid var(--bop-divider) !important;
    box-shadow: var(--bop-shadow-3) !important;
    color: var(--bop-text-primary) !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: min(92vh, 920px);
}

.mud-dialog .mud-dialog-title {
    flex: 0 0 auto;
    padding: 18px 22px;
    border-bottom: 1px solid var(--bop-divider);
    background: var(--bop-surface) !important;
}

.mud-dialog .mud-dialog-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 22px !important;
    color: var(--bop-text-secondary);
    scrollbar-width: thin;
    scrollbar-color: var(--bop-divider-strong) transparent;
}

.mud-dialog .mud-dialog-content::-webkit-scrollbar {
    width: 8px;
}

.mud-dialog .mud-dialog-content::-webkit-scrollbar-thumb {
    background: var(--bop-divider-strong);
    border-radius: 999px;
}

.mud-dialog .mud-dialog-content::-webkit-scrollbar-track {
    background: transparent;
}

.mud-dialog .mud-dialog-actions {
    flex: 0 0 auto;
    padding: 14px 22px 18px !important;
    border-top: 1px solid var(--bop-divider);
    background: var(--bop-surface-muted);
    gap: 10px;
}

.mud-dialog .dialog-header,
.mud-dialog .register-dialog-header,
.mud-dialog .edit-limit-dialog-header,
.mud-dialog .lifecycle-dialog-header,
.mud-dialog .ecp-header {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.mud-dialog .dialog-header > .mud-icon-root:first-child,
.mud-dialog .register-dialog-header > .mud-icon-root:first-child,
.mud-dialog .edit-limit-dialog-header > .mud-icon-root:first-child,
.mud-dialog .lifecycle-dialog-header > .mud-icon-root:first-child,
.mud-dialog .ecp-header > .mud-icon-root:first-child {
    width: 40px !important;
    height: 40px !important;
    padding: 9px !important;
    border-radius: var(--bop-radius-md) !important;
    background: var(--bop-primary-soft) !important;
    color: var(--bop-primary) !important;
}

.mud-dialog .dialog-title-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mud-dialog .dialog-title-stack .mud-typography-caption {
    color: var(--bop-text-secondary);
    line-height: 1.35;
}

.mud-dialog .dialog-form,
.mud-dialog .register-dialog-body,
.mud-dialog .edit-limit-dialog-body,
.mud-dialog .lifecycle-dialog-body,
.mud-dialog .tb-dialog-form,
.mud-dialog .tl-dialog-form {
    gap: 18px !important;
}

.mud-dialog .form-section-label,
.mud-dialog .bop-form-section-label {
    margin-top: 4px;
    padding: 0 0 6px;
    border-bottom: 1px solid var(--bop-divider);
}

.mud-dialog .form-section-label .mud-typography,
.mud-dialog .bop-form-section-label {
    color: var(--bop-primary) !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
}

.mud-dialog .form-toggle-row,
.mud-dialog .uam-policy-toggle {
    background: var(--bop-surface-muted) !important;
    border: 1px solid var(--bop-divider) !important;
    border-radius: var(--bop-radius-md) !important;
}

.mud-dialog .dialog-actions,
.mud-dialog .register-dialog-actions,
.mud-dialog .edit-limit-dialog-actions,
.mud-dialog .lifecycle-dialog-actions,
.mud-dialog .bop-confirm-actions {
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
}

.mud-dialog .dialog-primary-action,
.mud-dialog .bop-confirm-actions .mud-button-filled {
    min-width: 128px;
}

@media (max-width: 767px) {
    .mud-dialog {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100vh - 24px);
    }

    .mud-dialog .mud-dialog-title,
    .mud-dialog .mud-dialog-content,
    .mud-dialog .mud-dialog-actions {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .mud-dialog .dialog-actions,
    .mud-dialog .register-dialog-actions,
    .mud-dialog .edit-limit-dialog-actions,
    .mud-dialog .lifecycle-dialog-actions,
    .mud-dialog .bop-confirm-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .mud-dialog .dialog-actions .mud-button,
    .mud-dialog .register-dialog-actions .mud-button,
    .mud-dialog .edit-limit-dialog-actions .mud-button,
    .mud-dialog .lifecycle-dialog-actions .mud-button,
    .mud-dialog .bop-confirm-actions .mud-button {
        width: 100%;
    }
}

@keyframes bop-dialog-in {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(6px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Modal overlay scrim */
.mud-overlay {
    transition: opacity 0.2s ease;
}

.mud-overlay-dialog {
    background-color: rgba(15, 23, 42, 0.32) !important;
}

/* Drawer slide-in motion */
.mud-drawer {
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1) !important;
}

/* ============================================
   Unified Modal System (.bop-dialog)
   Single Carbon-flat surface for every dialog. Apply via the BopDialog C#
   presets (Compact / Standard / Wide / ExtraWide), which set Class="bop-dialog".
   Replaces the per-page .bop-glass-dialog / .voice-infra-dialog blocks: those
   defined competing radii (20px vs 8px vs 4px), widths (380/440/860px), and a
   glass blur that clashed with the rest of the app. Width is governed by the
   MudBlazor MaxWidth preset; we only keep the surface and rhythm consistent.
   ============================================ */
.bop-dialog .mud-dialog {
    background: var(--bop-surface) !important;
    border: 1px solid var(--bop-divider) !important;
    border-radius: var(--bop-radius-md) !important;
    box-shadow: var(--bop-shadow-3) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    /* Modals are not anchored to a trigger — scale in from center (Emil). */
    transform-origin: center !important;
    /* Let the MaxWidth preset drive width; no hardcoded min-width fighting it. */
    min-width: 0 !important;
}

/* Canonical structural slots. Legacy aliases (.dialog-form, .dialog-body,
   .register-dialog-body, …) keep working via the global .mud-dialog rules above;
   new dialogs should prefer these. */
.bop-dialog .bop-dialog-header {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.bop-dialog .bop-dialog-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.bop-dialog .bop-dialog-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: 100%;
}

@media (max-width: 767px) {
    .bop-dialog .bop-dialog-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .bop-dialog .bop-dialog-actions .mud-button {
        width: 100%;
    }
}

/* ============================================
   Button Styling
   ============================================ */
.mud-button {
    border-radius: var(--bop-radius-md) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 600 !important;
    transition: background-color var(--bop-transition-fast), color var(--bop-transition-fast), box-shadow var(--bop-transition-fast), filter var(--bop-transition-fast) !important;
}

.mud-button-filled-primary,
.mud-button-filled-secondary {
    color: #FFFFFF !important;
    box-shadow: none !important;
}

.mud-button-filled-primary {
    background: var(--bop-primary) !important;
}

.mud-button-filled-secondary {
    background: var(--bop-secondary-deep) !important;
    box-shadow: none !important;
}

.mud-button-filled-primary:hover,
.mud-button-filled-secondary:hover {
    filter: brightness(0.96);
}

.mud-button-text,
.mud-button-outlined {
    color: var(--bop-primary-dark) !important;
}

.mud-button-text:hover,
.mud-button-outlined:hover {
    background: var(--bop-primary-soft) !important;
}

.mud-icon-button {
    border-radius: var(--bop-radius-md) !important;
    color: var(--bop-text-secondary) !important;
    transition: background-color var(--bop-transition-fast), color var(--bop-transition-fast), transform var(--bop-transition-fast), box-shadow var(--bop-transition-fast) !important;
}

.mud-icon-button:hover {
    background: var(--bop-hover) !important;
    color: var(--bop-primary-dark) !important;
}

.bop-button {
    transition: background-color var(--bop-transition-fast), box-shadow var(--bop-transition-fast), transform 0.1s ease;
    border-radius: var(--bop-radius-md) !important;
    min-height: 40px;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.bop-button:active:not(:disabled) {
    transform: scale(0.97);
}

/* ============================================
   Card Styling
   ============================================ */
.bop-card {
    transition: box-shadow var(--bop-transition-fast), border-color var(--bop-transition-fast);
    border-radius: var(--bop-radius-lg) !important;
    border: 1px solid var(--bop-divider) !important;
    box-shadow: var(--bop-shadow-1) !important;
}

.bop-card:hover {
    border-color: var(--bop-divider) !important;
    box-shadow: var(--bop-shadow-1) !important;
}

.bop-card--interactive:hover {
    border-color: var(--bop-primary) !important;
    box-shadow: var(--bop-shadow-2) !important;
}

/* ============================================
   Content Card (white card on light background)
   ============================================ */
.bop-content-card {
    background: var(--bop-surface-raised);
    border: 1px solid var(--bop-divider);
    border-radius: var(--bop-radius-lg);
    padding: var(--bop-space-lg);
    box-shadow: var(--bop-shadow-1);
}

.bop-content-card--lg {
    padding: var(--bop-space-xl);
}

/* Carbon/BOP migration utilities for page-by-page upgrades. */
.bop-carbon-page {
    display: flex;
    flex-direction: column;
    gap: var(--bop-space-lg);
    color: var(--bop-text-primary);
}

.bop-carbon-section {
    display: flex;
    flex-direction: column;
    gap: var(--bop-space-md);
}

.bop-carbon-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--bop-space-md);
    padding: var(--bop-space-md);
    background: var(--bop-surface);
    border: 1px solid var(--bop-divider);
    border-radius: var(--bop-radius-lg);
}

.bop-carbon-toolbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--bop-space-sm);
}

.bop-carbon-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--bop-space-md);
    min-width: 0;
}

.bop-carbon-form-grid--single,
.bop-carbon-form-span {
    grid-column: 1 / -1;
}

.bop-carbon-dialog-summary {
    color: var(--bop-text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* ============================================
   Platform-Wide Carbon/BOP Convergence
   These selectors deliberately reach across legacy page-local classes so the
   system shift is visible across Dashboard, Workboard, Analytics, Webforms,
   Valhalla, Settings, and Call Center while each page is migrated in detail.
   ============================================ */
.dashboard-action-btn,
.workboard-new-contact-btn,
.workboard-clear-btn,
.analytics-card,
.workboard-mode-toggle,
.valhalla-master-banner,
.webforms-filter-summary,
.bop-filter-bar,
.mud-picker,
.mud-popover,
.mud-menu {
    border-radius: var(--bop-radius-md) !important;
}

.overview-card,
.analytics-card,
.valhalla-health-tile,
.valhalla-usage-row,
.workboard-grid-card,
.appointments-sidebar,
.dashboard-widgets,
.dashboard-notes {
    background: var(--bop-surface) !important;
    border: 1px solid var(--bop-divider) !important;
    border-radius: var(--bop-radius-md) !important;
    box-shadow: var(--bop-shadow-1) !important;
}

.overview-card:hover,
.analytics-card:hover,
.workboard-grid-card:hover {
    border-color: var(--bop-divider-strong) !important;
    box-shadow: var(--bop-shadow-2) !important;
    transform: none !important;
}

.overview-card--active {
    color: #FFFFFF !important;
    background: var(--bop-secondary-deep) !important;
    border-color: var(--bop-secondary-deep) !important;
    border-left: 4px solid var(--bop-primary) !important;
}

.overview-icon,
.analytics-card-icon,
.workboard-mode-toggle button,
.dashboard-action-btn {
    border-radius: var(--bop-radius-md) !important;
}

.overview-icon,
.analytics-card-icon {
    border: 1px solid rgba(22, 22, 22, 0.08) !important;
}

.overview-more,
.dashboard-action-btn,
.workboard-mode-toggle,
.workboard-mode-toggle button,
.workboard-clear-btn {
    box-shadow: none !important;
}

.analytics-card-title,
.overview-title,
.workboard-filter-summary,
.valhalla-health-count {
    color: var(--bop-text-primary) !important;
    font-weight: 600 !important;
}

.analytics-card-description,
.overview-sub,
.ir-stage-copy,
.q-meta,
.moh-meta {
    color: var(--bop-text-secondary) !important;
}

.analytics-card-arrow {
    color: var(--bop-primary) !important;
}

.analytics-card-icon--blue,
.analytics-card-icon--cyan,
.analytics-card-icon--blue-soft,
.analytics-card-icon--orange,
.analytics-card-icon--neutral {
    background: var(--bop-primary-soft) !important;
    color: var(--bop-primary) !important;
}

.workboard-mode-toggle {
    display: inline-flex !important;
    padding: 3px !important;
    background: var(--bop-surface) !important;
    border: 1px solid var(--bop-divider) !important;
}

.workboard-mode-toggle button {
    border: 0 !important;
    min-height: 36px !important;
}

.workboard-mode-toggle button[aria-selected="true"],
.workboard-mode-toggle button.active,
.workboard-mode-toggle .active {
    background: var(--bop-secondary-deep) !important;
    color: #FFFFFF !important;
}

.valhalla-master-banner {
    background: var(--bop-secondary-deep) !important;
    border-left: 4px solid var(--bop-primary) !important;
    color: #FFFFFF !important;
    box-shadow: none !important;
}

.marketing-hero,
.journey-hero,
.gcc-hero,
.re-hero-panel,
.coliseum-command {
    background: var(--bop-surface) !important;
    border: 1px solid var(--bop-divider) !important;
    border-left: 4px solid var(--bop-primary) !important;
    border-radius: var(--bop-radius-md) !important;
    box-shadow: var(--bop-shadow-1) !important;
    color: var(--bop-text-primary) !important;
}

.marketing-hero h2,
.journey-hero h2,
.gcc-hero h2,
.re-hero-title,
.coliseum-command-copy h1 {
    color: var(--bop-text-primary) !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}

.marketing-hero p,
.journey-hero p,
.gcc-hero p,
.re-hero-copy,
.coliseum-command-copy p {
    color: var(--bop-text-secondary) !important;
}

.marketing-kicker,
.journey-kicker,
.gcc-kicker,
.re-eyebrow,
.arena-kicker,
.uam-eyebrow {
    color: var(--bop-primary) !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
}

.marketing-metrics article,
.journey-hero-metrics article,
.journey-metric-grid article,
.gcc-website-panel,
.studio-summary article,
.step-preview-grid article,
.arena-stat,
.uam-stat,
.direction-card,
.nav-card,
.re-hero-action,
.re-layer-card {
    background: var(--bop-surface) !important;
    border: 1px solid var(--bop-divider) !important;
    border-radius: var(--bop-radius-md) !important;
    box-shadow: none !important;
    color: var(--bop-text-primary) !important;
}

.marketing-metrics article:hover,
.journey-list-item:hover,
.studio-node:hover,
.nav-card:hover,
.re-hero-action:hover,
.re-layer-card:hover,
.leaderboard-card:hover {
    border-color: var(--bop-divider-strong) !important;
    box-shadow: var(--bop-shadow-1) !important;
    transform: none !important;
}

.marketing-metrics span,
.journey-hero-metrics span,
.journey-metric-grid span,
.studio-summary span,
.step-preview-grid span,
.arena-stat strong,
.uam-stat strong,
.direction-card-value {
    color: var(--bop-text-primary) !important;
    font-weight: 600 !important;
}

.marketing-metrics small,
.journey-hero-metrics small,
.journey-metric-grid small,
.studio-summary small,
.step-preview-grid small,
.arena-stat span,
.uam-stat span,
.direction-card-label,
.nav-card-description {
    color: var(--bop-text-secondary) !important;
}

.studio-canvas,
.studio-lane,
.journey-list,
.journey-main,
.journey-section,
.journey-step-card,
.uam-org-panel,
.uam-org-card,
.uam-org-list,
.uam-policy-toggle,
.ca-records,
.ca-detail-modal,
.ca-recording-panel,
.ca-manual-scorecard,
.ca-channel-placeholder,
.report-filters,
.report-table-wrap,
.receipt-create-card,
.receipt-header-grid,
.split-card,
.lines-grid,
.accounts-grid,
.concepts-grid,
.epay-form,
.arena-panel,
.leaderboard-card,
.coliseum-command-board {
    background: var(--bop-surface) !important;
    border: 1px solid var(--bop-divider) !important;
    border-radius: var(--bop-radius-md) !important;
    box-shadow: var(--bop-shadow-1) !important;
}

.studio-node,
.journey-list-item,
.uam-tab,
.command-chip,
.arena-badge,
.re-pill,
.amount-type-pill,
.amount-mode-pill {
    border-radius: var(--bop-radius-md) !important;
}

.studio-node.selected,
.journey-list-item.selected,
.uam-tab-active,
.uam-role-card-active,
.uam-template-card-active,
.leaderboard-card.selected {
    background: var(--bop-primary-soft) !important;
    border-color: var(--bop-primary) !important;
    color: var(--bop-primary-dark) !important;
    box-shadow: inset 3px 0 0 var(--bop-primary) !important;
}

.ca-table,
.report-table,
.accounts-table,
.concepts-table,
.receipt-lines-table,
.arena-table,
.epay-table {
    background: var(--bop-surface) !important;
    border: 1px solid var(--bop-divider) !important;
    border-radius: var(--bop-radius-md) !important;
    overflow: hidden !important;
}

.ca-table th,
.report-table th,
.accounts-table thead th,
.concepts-table thead th,
.receipt-lines-table thead th,
.arena-table th,
.epay-table th {
    background: var(--bop-surface-muted) !important;
    color: var(--bop-text-secondary) !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
}

.mud-dialog {
    border-radius: var(--bop-radius-md) !important;
}

.mud-dialog .mud-dialog-title {
    background: var(--bop-surface) !important;
}

.mud-dialog .mud-dialog-actions {
    background: var(--bop-surface) !important;
}

@media (max-width: 767px) {
    .bop-carbon-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .bop-carbon-toolbar__actions,
    .bop-carbon-form-grid {
        grid-template-columns: 1fr;
        width: 100%;
    }
}

/* ============================================
   App Shell Responsive Guards
   ============================================ */
@media (max-width: 767px) {
    .bop-main-content {
        margin-left: 0 !important;
    }

    .bop-sidebar:not(.open) {
        transform: translateX(-100%) !important;
    }

    .bop-sidebar.open {
        transform: translateX(0) !important;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .bop-main-content {
        padding: 0;
    }

    .blazor-error-boundary {
        display: none;
    }
}

/* ============================================
   Cross-Module Real-Time UX Animations
   (Task 16.4 - Number change animation)
   ============================================ */

/* Number change animation — scale pulse on real-time value updates */
@keyframes bop-number-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.bop-number-change {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    transition: transform 0.15s ease;
}

.bop-number-change--active {
    animation: bop-number-pulse 0.15s ease;
}

/* SignalR highlight animation for list items (Task 12.7) */
@keyframes bop-item-highlight {
    0% { background-color: rgba(99, 102, 241, 0.08); }
    100% { background-color: transparent; }
}

.bop-item-highlight {
    animation: bop-item-highlight 0.3s ease-out;
}

/* Sticky Notes — Page-switching slide animations */
@keyframes sticky-slide-left {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes sticky-slide-right {
    from { transform: translateX(-100%); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}

.sticky-note-enter-left {
    animation: sticky-slide-left 250ms cubic-bezier(0.32, 0.72, 0, 1);
}

.sticky-note-enter-right {
    animation: sticky-slide-right 250ms cubic-bezier(0.32, 0.72, 0, 1);
}

/* ============================================
   Voice Infrastructure Dialogs
   ============================================ */
.voice-infra-dialog .mud-dialog {
    width: min(1120px, calc(100vw - 48px)) !important;
    max-width: min(1120px, calc(100vw - 48px)) !important;
    min-width: min(860px, calc(100vw - 48px)) !important;
    max-height: min(88vh, 920px) !important;
    overflow: hidden !important;
    background: #FFFFFF !important;
    border: 1px solid var(--bop-divider) !important;
    border-radius: var(--bop-radius-xl) !important;
    box-shadow: var(--bop-shadow-3) !important;
}

.voice-infra-dialog .mud-dialog-title {
    padding: 0 !important;
    border-bottom: 1px solid var(--bop-divider) !important;
    background: var(--bop-surface) !important;
}

.voice-infra-dialog .dialog-header {
    display: grid !important;
    grid-template-columns: 44px 1fr auto;
    align-items: center !important;
    gap: 14px !important;
    padding: 20px 24px !important;
}

.voice-infra-dialog .dialog-header .mud-icon-root {
    width: 44px !important;
    height: 44px !important;
    padding: 10px !important;
    border-radius: var(--bop-radius-md) !important;
    background: var(--bop-primary-soft) !important;
    color: var(--bop-primary) !important;
    box-shadow: inset 0 0 0 1px rgba(15, 98, 254, 0.16) !important;
}

.voice-infra-dialog .dialog-header .mud-typography {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: var(--bop-text-primary) !important;
}

.voice-infra-dialog .mud-dialog-content {
    padding: 24px !important;
    max-height: calc(min(88vh, 920px) - 142px) !important;
    overflow-y: auto !important;
    background: var(--bop-background) !important;
}

.voice-infra-dialog .dialog-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px 20px !important;
    min-width: 0 !important;
    padding: 0 !important;
}

.voice-infra-dialog .form-section-label,
.voice-infra-dialog .member-editor,
.voice-infra-dialog .ivr-option-editor,
.voice-infra-dialog .time-condition-editor,
.voice-infra-dialog .form-toggle-row,
.voice-infra-dialog .mud-alert,
.voice-infra-dialog .did-hint {
    grid-column: 1 / -1 !important;
}

.voice-infra-dialog .form-section-label {
    margin-top: 6px !important;
    padding: 12px 14px !important;
    border: 1px solid var(--bop-divider) !important;
    border-radius: var(--bop-radius-md) !important;
    background: #FFFFFF !important;
    box-shadow: none !important;
}

.voice-infra-dialog .form-section-label .mud-typography {
    color: var(--bop-text-primary) !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0 !important;
}

.voice-infra-dialog .mud-input-control {
    margin: 0 !important;
}

.voice-infra-dialog .mud-input,
.voice-infra-dialog .bop-field .mud-input {
    background: #FFFFFF !important;
    border: 1px solid var(--bop-divider) !important;
    border-radius: var(--bop-radius-md) !important;
    box-shadow: none !important;
}

.voice-infra-dialog .mud-input:focus-within {
    border-color: var(--bop-primary) !important;
    box-shadow: var(--bop-shadow-focus) !important;
}

.voice-infra-dialog .rdp-picker {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px !important;
}

.voice-infra-dialog .form-toggle-row {
    padding: 14px 16px !important;
    background: #FFFFFF !important;
    border: 1px solid var(--bop-divider) !important;
    border-radius: var(--bop-radius-md) !important;
    box-shadow: none !important;
}

.voice-infra-dialog .member-editor,
.voice-infra-dialog .ivr-option-editor,
.voice-infra-dialog .time-condition-editor {
    padding: 16px !important;
    background: #FFFFFF !important;
    border: 1px solid var(--bop-divider) !important;
    border-radius: var(--bop-radius-md) !important;
    box-shadow: none !important;
}

.voice-infra-dialog .member-add-row {
    max-width: none !important;
}

.voice-infra-dialog .member-row,
.voice-infra-dialog .ivr-option-card {
    background: var(--bop-surface-muted) !important;
    border: 1px solid var(--bop-divider) !important;
    border-radius: var(--bop-radius-md) !important;
}

.voice-infra-dialog .member-row {
    align-items: stretch !important;
}

.voice-infra-dialog .drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    border-radius: var(--bop-radius-md);
    color: var(--bop-text-tertiary);
    background: #FFFFFF;
    border: 1px solid var(--bop-divider);
    cursor: grab;
}

.voice-infra-dialog .drag-handle:active {
    cursor: grabbing;
}

.voice-infra-dialog .member-row--dragging {
    opacity: 0.55;
    transform: scale(0.99);
}

.voice-infra-dialog .member-row--drop-target {
    border-color: var(--bop-primary) !important;
    box-shadow: var(--bop-shadow-focus) !important;
}

.voice-infra-dialog .voice-helper {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--bop-text-secondary);
    font-size: 0.82rem;
}

.voice-infra-dialog .mud-dialog-actions {
    padding: 16px 24px !important;
    border-top: 1px solid var(--bop-divider) !important;
    background: #FFFFFF !important;
}

.voice-infra-dialog .dialog-actions {
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 0 !important;
}

.voice-infra-dialog .dialog-actions::before {
    content: none;
}

.voice-infra-dialog .dialog-primary-action.mud-button-filled-primary {
    min-width: 132px !important;
    background: var(--bop-primary) !important;
    color: #FFFFFF !important;
    border-radius: var(--bop-radius-md) !important;
    box-shadow: none !important;
}

.voice-infra-dialog .dialog-primary-action.mud-button-filled-primary:hover {
    background: var(--bop-primary-dark) !important;
}

.voice-infra-dialog .dialog-primary-action.mud-button-filled-primary:disabled {
    background: var(--bop-divider) !important;
    color: var(--bop-disabled) !important;
    box-shadow: none !important;
}

.voice-infra-dialog .dialog-cancel-action.mud-button-text-secondary {
    color: var(--bop-text-secondary) !important;
}

@media (max-width: 980px) {
    .voice-infra-dialog .mud-dialog {
        width: calc(100vw - 24px) !important;
        min-width: 0 !important;
        max-width: calc(100vw - 24px) !important;
    }

    .voice-infra-dialog .dialog-form,
    .voice-infra-dialog .rdp-picker {
        grid-template-columns: 1fr !important;
    }

    .voice-infra-dialog .dialog-actions {
        justify-content: flex-end !important;
    }

    .voice-infra-dialog .dialog-actions::before {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .sticky-note-enter-left,
    .sticky-note-enter-right {
        animation: none;
    }
}
