/* Custom Classes */

/* ===== dcc.Dropdown (react-select v1) =====
   react-select ships its own stylesheet with the same selectors; mark these
   !important so the app tokens win. */

/* Control (the closed input) */
.Select-control,
.is-open > .Select-control {
    background-color: var(--surface-card) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
    height: 2.25rem !important;
    min-height: 2.25rem !important;
    font-size: 13px !important;
    color: var(--text-primary) !important;
}
.Select-control:hover {
    border-color: var(--text-muted) !important;
}
.is-focused:not(.is-open) > .Select-control {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 18%, transparent) !important;
}

/* Placeholder + value text: 2.125rem = inner height of the 36px control. */
.Select-placeholder,
.Select--single > .Select-control .Select-value {
    line-height: 2.125rem !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}
.Select-placeholder {
    color: var(--text-muted) !important;
}
.Select-value-label,
.Select-value {
    color: var(--text-primary) !important;
}
.Select--multi .Select-value {
    background-color: var(--surface-page) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text-primary) !important;
    font-size: 0.75rem !important;
}
.Select--multi .Select-value-icon {
    border-right: 1px solid var(--color-border) !important;
}
.Select--multi .Select-value-icon:hover {
    background-color: var(--color-border) !important;
    color: var(--text-primary) !important;
}
.Select-input {
    height: 2.125rem !important;
    padding-left: 0.75rem !important;
}
.Select-input > input {
    height: 2.125rem !important;
    line-height: 2.125rem !important;
    font-size: 13px !important;
    color: var(--text-primary) !important;
    padding: 0 !important;
}
.Select-arrow {
    border-top-color: var(--text-muted) !important;
}
.Select-clear {
    color: var(--text-muted) !important;
}
.Select-clear:hover {
    color: var(--color-danger) !important;
}
.is-disabled > .Select-control {
    background-color: var(--surface-page) !important;
    opacity: 0.7 !important;
}

/* Menu (the options list) */
.Select-menu-outer {
    background-color: var(--surface-card) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: 0 8px 20px -10px rgba(15, 23, 42, 0.25) !important;
    margin-top: 4px !important;
    z-index: 30 !important;
}
.Select-menu {
    max-height: 15rem !important;
}
/* Options are rendered by react-virtualized-select (fixed 35px rows). */
.VirtualizedSelectOption {
    padding: 0 12px !important;
    font-size: 13px !important;
    color: var(--text-primary) !important;
    background-color: var(--surface-card) !important;
    cursor: pointer;
}
.VirtualizedSelectFocusedOption {
    background-color: var(--surface-hover) !important;
}
.VirtualizedSelectSelectedOption {
    font-weight: 500 !important;
    color: var(--color-primary) !important;
    background-color: color-mix(in srgb, var(--color-primary) 8%, var(--surface-card)) !important;
}
.VirtualizedSelectSelectedOption.VirtualizedSelectFocusedOption {
    background-color: color-mix(in srgb, var(--color-primary) 14%, var(--surface-card)) !important;
}
.VirtualizedSelectDisabledOption {
    color: var(--text-muted) !important;
    cursor: default;
}
.Select-noresults {
    color: var(--text-muted) !important;
    font-size: 13px !important;
    padding: 0.5rem 12px !important;
}

/* ===== dcc.DateRangePicker / react-dates calendar ===== */

/* Input container (`Start Date → End Date`) */
.DateRangePickerInput {
    background-color: var(--surface-card) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-sm) !important;
    padding: 2px !important;
    font-size: 12px !important;
}

/* Individual date input */
.DateInput {
    background-color: var(--surface-card) !important;
    width: 106px !important;
}

/* Date input field */
.DateInput_input {
    font-size: 13px !important;
    height: 28px !important;
    padding: 4px 8px !important;
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border: none !important;
    text-align: center !important;
}

.DateInput_input::placeholder {
    color: var(--text-muted) !important;
}

.DateInput_input:focus {
    outline: none !important;
    box-shadow: inset 0 -2px 0 0 var(--color-primary) !important;
}

/* Arrow between the two date inputs */
.DateRangePickerInput_arrow svg {
    fill: var(--text-muted) !important;
}

/* Popup chrome */
.DateRangePicker_picker {
    z-index: 2000 !important;
    background-color: var(--surface-card) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 12px 28px -14px rgba(15, 23, 42, 0.30) !important;
}

/* Month header */
.CalendarMonth_caption {
    color: var(--text-primary) !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    padding-top: 14px !important;
    padding-bottom: 26px !important;
}

/* Weekday header row */
.DayPicker_weekHeader_li small {
    color: var(--text-muted) !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Prev/next month buttons */
.DayPickerNavigation_button {
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-sm) !important;
    background: var(--surface-card) !important;
}
.DayPickerNavigation_button:hover {
    background: var(--surface-page) !important;
}
.DayPickerNavigation_svg__horizontal {
    fill: var(--text-secondary) !important;
}

/* Day cells */
.CalendarDay__default {
    background: var(--surface-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--color-border-light) !important;
    font-size: 0.8rem !important;
}
.CalendarDay__default:hover {
    background: var(--surface-page) !important;
    border-color: var(--color-border) !important;
    color: var(--text-primary) !important;
}
.CalendarDay__outside,
.CalendarDay__blocked_out_of_range {
    background: var(--surface-card) !important;
    color: var(--text-muted) !important;
    border-color: var(--color-border-light) !important;
}

/* Today marker */
.CalendarDay__today {
    border-color: var(--color-primary-light) !important;
    color: var(--color-primary) !important;
    font-weight: 600 !important;
}

/* Selected day / range */
.CalendarDay__selected,
.CalendarDay__selected:active,
.CalendarDay__selected:hover {
    background: var(--color-primary) !important;
    border: 1px solid var(--color-primary) !important;
    color: #fff !important;
    font-weight: 600 !important;
}
.CalendarDay__selected_span,
.CalendarDay__hovered_span,
.CalendarDay__hovered_span:hover {
    background: var(--color-primary-lighter) !important;
    border: 1px solid var(--color-primary-lighter) !important;
    color: var(--color-primary-darker) !important;
}

/* Hide the react-dates keyboard-shortcuts affordance (teal corner) */
.DayPickerKeyboardShortcuts_buttonReset,
.DayPickerKeyboardShortcuts_showSpan {
    display: none !important;
}


/* ===== dbc.compact-radio-group — Luos segmented control (spec 055) ===== */
.compact-radio-group.btn-group {
    display: inline-flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-card);
}
.compact-radio-group .btn,
.compact-radio-group.btn-group-sm > .btn {
    border: 0 !important;
    border-radius: 0 !important;
    margin-left: 0 !important;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.3rem 0.7rem;
    min-height: 2rem;
    box-shadow: none !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* Neutralise the btn-outline-primary hover (grey bg, neutral text). */
    --bs-btn-color: var(--text-secondary);
    --bs-btn-hover-color: var(--text-secondary);
    --bs-btn-hover-bg: var(--surface-page);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--color-primary);
    --bs-btn-active-border-color: transparent;
}
.compact-radio-group .btn:hover,
.compact-radio-group .btn-outline-primary:hover {
    background: var(--surface-page) !important;
    color: var(--text-secondary) !important;
}
.compact-radio-group .btn-check:checked + .btn {
    background: var(--color-primary) !important;
    color: #fff !important;
    border-color: transparent !important;
}
.compact-radio-group > .form-check + .form-check,
.compact-radio-group label.btn ~ label.btn {
    border-left: 1px solid var(--color-border);
}
.compact-radio-group .form-check {
    display: flex;
    margin: 0;
    padding-left: 0 !important;
    min-height: 0;
}

.btn-sm {
    --bs-btn-font-size: 0.8rem;
    --bs-btn-padding-y: 0.25rem;
    --bs-btn-padding-x: 0.5rem;
}

.mermaid svg {
    max-width: none !important;
    width: 100% !important;
    height: auto !important;
}

.mermaid-container {
    width: 100%;
}

/* Target the rect with class "bg" */
rect.bg {
    fill: var(--bs-body-bg) !important;
    fill-opacity: 0.8 !important;
    stroke: none !important;
}

/* ===== dbc.Header===== */
.custom-table-header th {
    background-color: var(--bs-gray-100) !important;
    font-weight: 600 !important;
    color: var(--bs-body-color) !important;
    border-bottom: 2px solid var(--bs-border-color) !important;
}

/* ===== Admin Panel Sidebar ===== */

:root {
    --sidebar-width: 18rem;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e5e7eb;
    --sidebar-hover: #f1f5f9;
    --sidebar-active-bg: #eef6ff;
    --sidebar-text: #1e293b;
    --sidebar-text-secondary: #64748b;
    --sidebar-text-muted: #94a3b8;
    --sidebar-primary: #0f87ff;
    --sidebar-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

[data-bs-theme="dark"] {
    --sidebar-bg: #1e293b;
    --sidebar-border: #334155;
    --sidebar-hover: #334155;
    --sidebar-active-bg: #1e3a5f;
    --sidebar-text: #f1f5f9;
    --sidebar-text-secondary: #94a3b8;
    --sidebar-text-muted: #64748b;
    --sidebar-primary: #60a5fa;
    --sidebar-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.app-layout {
    min-height: 100vh;
}

.main-content {
    margin-left: 0;
    min-height: 100vh;
}

/* ===== Luos admin page shell (mirrors AdminPageShell.vue) ===== */
.admin-main {
    background: var(--surface-page);
}

.admin-page {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 5px 9px 2px;
}

.main-card {
    background: var(--surface-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 16px;
    box-sizing: border-box;
}

.admin-page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.admin-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* ``page_shell(..., filters=...)``: the filter row wraps under the title and
   the actions, inside the (sticky) header. */
.admin-page-header--with-filters {
    flex-wrap: wrap;
}

.admin-page-header--with-filters > .page-filter-row {
    flex-basis: 100%;
    margin-top: 0;
}

.admin-page-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.page-lead {
    margin: -8px 0 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 42rem;
}

.admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    z-index: 1000;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: var(--sidebar-shadow);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.admin-sidebar__section + .admin-sidebar__section {
    border-top: 1px solid var(--sidebar-border);
}

/* Toggle header */
.admin-sidebar__toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--sidebar-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.admin-sidebar__toggle:hover {
    color: var(--sidebar-text);
    background-color: var(--sidebar-hover);
}

.admin-sidebar__toggle--open {
    color: var(--sidebar-text);
}

/* Chevron */
.admin-sidebar__chevron {
    margin-left: auto;
    font-size: 0.65rem;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.admin-sidebar__toggle--open .admin-sidebar__chevron {
    transform: rotate(180deg);
}

/* Group (collapsible body) */
.admin-sidebar__group {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.25s ease;
}

.admin-sidebar__group--open {
    max-height: 40rem;
    opacity: 1;
}

/* Navigation items */
.admin-sidebar__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2rem;
    border: none;
    background: transparent;
    color: var(--sidebar-text-secondary);
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
    position: relative;
}

.admin-sidebar__item:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-text);
}

.admin-sidebar__item--active {
    color: var(--sidebar-primary);
    font-weight: 600;
    background-color: var(--sidebar-active-bg);
    box-shadow: inset 3px 0 0 var(--sidebar-primary);
}

/* Icon column */
.admin-sidebar__icon {
    width: 1rem;
    flex-shrink: 0;
    text-align: center;
    font-size: 0.875rem;
}

/* Focus ring */
.admin-sidebar__toggle:focus-visible,
.admin-sidebar__item:focus-visible {
    outline: 2px solid var(--sidebar-primary);
    outline-offset: -2px;
}

/* Bottom bar */
.admin-sidebar__bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--sidebar-border);
    margin-top: auto;
    flex-shrink: 0;
}

.admin-sidebar__bottom-btn {
    border: none !important;
    background: transparent !important;
    color: var(--sidebar-text-secondary) !important;
    padding: 0.375rem !important;
    font-size: 1rem !important;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.admin-sidebar__bottom-btn:hover {
    background-color: var(--sidebar-hover) !important;
    color: var(--sidebar-primary) !important;
}

.admin-sidebar__bottom-btn:focus-visible {
    outline: 2px solid var(--sidebar-primary);
    outline-offset: 2px;
}

/* --- Permission Tree (Debug Page) --- */
.perm-tree {
    list-style: none;
    padding-left: 0;
    font-size: 0.85rem;
}

.perm-tree summary {
    cursor: pointer;
    color: var(--bs-body-color);
    font-weight: 500;
    padding: 1px 0;
}

.perm-leaf {
    list-style: none;
    padding-left: 1.15em;
    font-size: 0.85rem;
}

.perm-leaf::before {
    content: "";
    display: inline-block;
    width: 0;
}

.perm-sub {
    list-style: none;
    padding-left: 16px;
    border-left: 1px solid var(--bs-border-color, #dee2e6);
    margin-left: 6px;
}

/* ===== Metric Cards (Luos design system) ===== */

:root {
    --color-primary: #007ea7;
    --color-primary-light: #80bfd3;
    --color-primary-lighter: #c7e3ec;
    --color-primary-dark: #114c5f;
    --color-primary-darker: #09313e;
    --color-secondary: #6c757d;
    --color-secondary-light: #b6babe;
    --color-secondary-lighter: #dfe1e2;
    --color-secondary-dark: #383d41;
    --color-secondary-darker: #24282b;
    --color-success: #198754;
    --color-success-light: #8cc3aa;
    --color-success-lighter: #cce5d9;
    --color-success-dark: #115f3b;
    --color-success-darker: #093e26;
    --color-danger: #dc3545;
    --color-danger-light: #ea868f;
    --color-danger-lighter: #f5c2c7;
    --color-danger-dark: #79151f;
    --color-danger-darker: #510c12;
    --color-warning: #ffc107;
    --color-warning-light: #ffda6a;
    --color-warning-lighter: #ffecb5;
    --color-warning-dark: #745c14;
    --color-warning-darker: #4e3d0b;
    --color-info: #0dcaf0;
    --color-info-light: #86e5f8;
    --color-info-lighter: #caf3fc;
    --color-info-dark: #146070;
    --color-info-darker: #0b404b;
    --color-border: #e5e7eb;
    --surface-page: #f1f5f9;
    --surface-card: #ffffff;
    --text-nav: var(--color-secondary-darker);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --color-border-light: #f1f5f9;
    --radius-sm: 6px;
    --radius-md: 8px;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --surface-muted: #f8fafc;
    --surface-hover: #f1f5f9;
    --table-row-hover-bg: color-mix(in srgb, var(--color-primary) 7%, var(--surface-card));
    --badge-success-bg: color-mix(in srgb, var(--color-success) 28%, var(--surface-card));
    --badge-success-text: var(--color-success-darker);
    --badge-success-dot: var(--color-success);
    --badge-warning-bg: color-mix(in srgb, var(--color-warning) 28%, var(--surface-card));
    --badge-warning-text: var(--color-warning-darker);
    --badge-warning-dot: var(--color-warning);
    --badge-danger-bg: color-mix(in srgb, var(--color-danger) 24%, var(--surface-card));
    --badge-danger-text: var(--color-danger-darker);
    --badge-danger-dot: var(--color-danger);
    --badge-info-bg: color-mix(in srgb, var(--color-info) 28%, var(--surface-card));
    --badge-info-text: var(--color-info-darker);
    --badge-info-dot: var(--color-info);
    --badge-neutral-bg: color-mix(in srgb, var(--color-secondary) 22%, var(--surface-card));
    --badge-neutral-text: var(--color-secondary-darker);
    --badge-neutral-dot: var(--color-secondary);
    --badge-primary-bg: var(--color-primary-lighter);
    --badge-primary-text: var(--color-primary-darker);
    --badge-primary-dot: var(--color-primary);
    --badge-secondary-bg: var(--color-secondary-lighter);
    --badge-secondary-text: var(--color-secondary-darker);
    --badge-secondary-dot: var(--color-secondary);
}

[data-bs-theme="dark"] {
    --surface-page: #111827;
    --surface-card: #1f2937;
    --text-nav: #cbd5e1;
    --text-primary: #e2e8f0;
    --color-border: #374151;
    --color-border-light: #4b5563;
    --text-secondary: #94a3b8;
    --text-muted: #9ca3af;
    --surface-muted: #374151;
    --surface-hover: #374151;
    --table-row-hover-bg: color-mix(in srgb, var(--color-primary) 12%, var(--surface-card));
    --badge-success-bg: color-mix(in srgb, var(--color-success) 32%, var(--surface-card));
    --badge-success-text: #d1fae5;
    --badge-success-dot: var(--color-success-light);
    --badge-warning-bg: color-mix(in srgb, var(--color-warning) 30%, var(--surface-card));
    --badge-warning-text: #fef3c7;
    --badge-warning-dot: var(--color-warning-light);
    --badge-danger-bg: color-mix(in srgb, var(--color-danger) 32%, var(--surface-card));
    --badge-danger-text: #fee2e2;
    --badge-danger-dot: var(--color-danger-light);
    --badge-info-bg: color-mix(in srgb, var(--color-info) 30%, var(--surface-card));
    --badge-info-text: #bae6fd;
    --badge-info-dot: var(--color-info-light);
    --badge-neutral-bg: color-mix(in srgb, var(--color-secondary) 30%, var(--surface-card));
    --badge-neutral-text: #e2e8f0;
    --badge-neutral-dot: var(--color-secondary-light);
    --badge-primary-bg: #1e3a5f;
    --badge-primary-text: #bfdbfe;
    --badge-secondary-bg: #334155;
    --badge-secondary-text: #cbd5e1;
}

/* Global scrollbar contract (Luos _layout.css): 6px primary-tinted scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--color-primary) 45%, transparent) transparent;
}
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--color-primary) 45%, transparent);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Card grids — dashboards, summary rows */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 12px;
    width: 100%;
}

.card-grid--metrics {
    grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
}

/* Metric card */
.metric-card {
    --metric-accent: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 16px;
    background: var(--surface-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card), inset 3px 0 0 0 var(--metric-accent);
    min-height: 5.5rem;
}

.metric-card__header {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.metric-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    color: var(--metric-accent);
    background: color-mix(in srgb, var(--metric-accent) 12%, var(--surface-card));
}

.metric-card__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-nav);
    line-height: 1.35;
}

.metric-card .metric-card__value {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.05;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    word-break: normal;
    overflow-wrap: break-word;
}

/* Sparkline — inline SVG mask painted with the card accent */
.metric-card__sparkline {
    display: block;
    width: 100%;
    min-height: 2rem;
    margin-top: 4px;
    background-color: var(--metric-accent);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

.metric-card__sparkline--empty {
    background-color: transparent;
    min-height: 0;
}

.metric-card--primary { --metric-accent: var(--color-primary); }
.metric-card--success { --metric-accent: var(--color-success); }
.metric-card--danger  { --metric-accent: var(--color-danger); }
.metric-card--warning { --metric-accent: var(--color-warning); }
.metric-card--info    { --metric-accent: var(--color-info); }

.metric-card--neutral {
    --metric-accent: var(--text-secondary);
}

/* Semantic badges (Luos) */
.badge-success,
.badge-warning,
.badge-danger,
.badge-info,
.badge-neutral,
.badge-primary,
.badge-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    vertical-align: middle;
    text-transform: uppercase;
}
.badge-success::before,
.badge-warning::before,
.badge-danger::before,
.badge-info::before,
.badge-neutral::before,
.badge-primary::before,
.badge-secondary::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex: none;
}

.badge-success  { background: var(--badge-success-bg);  color: var(--badge-success-text); }
.badge-warning  { background: var(--badge-warning-bg);  color: var(--badge-warning-text); }
.badge-danger   { background: var(--badge-danger-bg);   color: var(--badge-danger-text); }
.badge-info     { background: var(--badge-info-bg);     color: var(--badge-info-text); }
.badge-neutral  { background: var(--badge-neutral-bg);  color: var(--badge-neutral-text); }
.badge-primary  { background: var(--badge-primary-bg);  color: var(--badge-primary-text); }
.badge-secondary{ background: var(--badge-secondary-bg); color: var(--badge-secondary-text); }
.badge-success::before   { background: var(--badge-success-dot); }
.badge-warning::before   { background: var(--badge-warning-dot); }
.badge-danger::before    { background: var(--badge-danger-dot); }
.badge-info::before      { background: var(--badge-info-dot); }
.badge-neutral::before   { background: var(--badge-neutral-dot); }
.badge-primary::before   { background: var(--badge-primary-dot); }
.badge-secondary::before { background: var(--badge-secondary-dot); }

/* dash_table.DataTable backend grid (Spec 45 / 059 `.sheet` look) */
.audit-datatable,
.audit-datatable .dash-spreadsheet-inner,
.audit-datatable .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner table {
    /* Dash's default is `--accent: hotpink`, set ON the inner <table>; override
       it there (and above) so the sort arrows / filter focus never turn fuchsia. */
    --accent: var(--color-primary) !important;
}
.audit-datatable .dash-table-container {
    font-size: 0.8125rem;
    font-family: var(--bs-body-font-family, inherit);
}
.audit-datatable .dash-spreadsheet-container .dash-spreadsheet-inner,
.audit-datatable .dash-spreadsheet-container .dash-spreadsheet-inner * {
    font-family: var(--bs-body-font-family, inherit);
}
.audit-datatable .dash-spreadsheet-container .dash-spreadsheet-inner th {
    background: var(--surface-page);
    color: var(--text-secondary);
    border: 0;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}
.audit-datatable .dash-spreadsheet-container .dash-spreadsheet-inner th .dash-cell-value {
    text-align: left;
    flex: 1;
}
/* Sort arrows: gap from the column title + darker grey at rest. */
.audit-datatable .dash-spreadsheet-container .dash-spreadsheet-inner th .column-actions {
    margin: 0 0.5rem;
}
.audit-datatable .dash-spreadsheet-container .dash-spreadsheet-inner th .column-header--sort,
.audit-datatable .dash-spreadsheet-container .dash-spreadsheet-inner th .column-header--sort svg {
    color: var(--text-secondary);
    fill: var(--text-secondary);
}
.audit-datatable .dash-spreadsheet-container .dash-spreadsheet-inner th .column-header--sort:hover,
.audit-datatable .dash-spreadsheet-container .dash-spreadsheet-inner th .column-header--sort:hover svg,
.audit-datatable .dash-spreadsheet-container .dash-spreadsheet-inner th .column-header--sort.active,
.audit-datatable .dash-spreadsheet-container .dash-spreadsheet-inner th .column-header--sort.active svg {
    color: var(--text-primary);
    fill: var(--text-primary);
}
.audit-datatable .dash-spreadsheet-container .dash-spreadsheet-inner td {
    color: var(--text-primary);
    border: 0;
    border-bottom: 1px solid var(--color-border-light);
}
/* The filter inputs need Dash's full selector depth to win the cascade. */
.audit-datatable .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner .dash-filter input {
    background-color: var(--surface-card) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-sm, 6px) !important;
    color: var(--text-primary) !important;
}
/* Search input: left-aligned text, an "enter" affordance at the right and a
   visible placeholder. Dash's [Aa] case-sensitivity toggle is hidden — filters
   are case-insensitive (configured via `filter_options` in the factory). */
.audit-datatable .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner .dash-filter input[type="text"] {
    text-align: left !important;
    padding-left: 8px !important;
    padding-right: 28px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 10 4 15l5 5'/%3E%3Cpath d='M20 4v7a4 4 0 0 1-4 4H4'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 14px 14px !important;
}
.audit-datatable .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner .dash-filter input[type="text"]::placeholder {
    color: var(--text-muted) !important;
    opacity: 1 !important;
}
/* Drop Dash's [Aa] case-sensitivity toggle (and its hotpink styling). */
.audit-datatable .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner .dash-filter input.dash-filter--case {
    display: none !important;
}
.audit-datatable .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner .dash-filter input:hover,
.audit-datatable .dash-table-container .dash-spreadsheet-container .dash-spreadsheet-inner .dash-filter input:focus {
    border-color: var(--color-primary) !important;
    outline: none !important;
}
.audit-datatable .dash-table-container .previous-next-container,
.audit-datatable .dash-table-container .dash-table-tooltip {
    color: var(--text-primary);
}
/* Lurana loading indicator (dcc.Loading custom_spinner). */
.lurana-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.lurana-loader__label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}
.lurana-loader__mark--dark {
    display: none;
}
[data-bs-theme="dark"] .lurana-loader__mark--light {
    display: none;
}
[data-bs-theme="dark"] .lurana-loader__mark--dark {
    display: block;
}

/* Page-level loading screen (Spec 062): boot entry + pending page content. */
.page-loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    background-color: var(--surface-page);
}
.page-loading-screen .lurana-loader {
    gap: 14px;
}
/* Label matches the mark's tallest column so it meets WCAG AA on the page surface. */
.page-loading-screen .lurana-loader__label {
    font-size: 0.8125rem;
    color: #475569;
}
[data-bs-theme="dark"] .page-loading-screen .lurana-loader__label {
    color: #cbd5e1;
}
.page-loading-screen--boot {
    position: fixed;
    inset: 0;
    min-height: 0;
    z-index: 1;
}

/* Headings use the Luos typeface (Nunito) for visual consistency. */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
}

/* Sticky page header for container-based pages (title + filters). */
.sticky-page-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--surface-page);
    /* Neutralise the row gutter: Bootstrap's `.row > *` adds a top margin from
       --bs-gutter-y (the `g-2` class), which broke the vertical centring and
       the horizontal alignment with the page padding. */
    --bs-gutter-x: 0;
    --bs-gutter-y: 0;
    /* Even gutter on all four sides. The -1rem top cancels the container's top
       padding so the header sits flush at the top; the negative inline margins
       let it span the full width while keeping the content aligned with the
       page (which uses `p-3` = 1rem). */
    margin: -1rem -1rem 1rem;
    padding: 1rem;
    box-shadow: 0 8px 16px -12px rgba(0, 0, 0, 0.28);
}

/* Page title: moderate size, line-height matched to the btn-sm controls so it
   reads as vertically centred with the filter buttons. */
.sticky-page-header h1 {
    font-size: 1.5rem;
    line-height: 2rem;
    margin: 0;
}

/* ``page_shell(..., sticky=True)`` puts the header inside the admin card, so it
   must use the card surface (not the page background). */
.main-card .sticky-page-header {
    background: var(--surface-card);
}

/* Dropdown filter row inside a sticky page header: a coherent width per filter;
   extra filters are appended to the right and wrap to a new row when they run
   out of horizontal space. */
.page-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.page-filter-row > * {
    flex: 0 0 16rem;
    max-width: 16rem;
}

/* Explorer filter toolbar */
.explorer-section-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    margin-bottom: 0.35rem;
}
.explorer-filter-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
/* Chips box + filters toggle joined as one Bootstrap input group. */
.explorer-filter-group {
    flex-wrap: nowrap;
    align-items: stretch;
}
.explorer-filter-row {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    min-height: 2.25rem;
    padding: 3px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--surface-card, #fff);
}
/* Top row and filter panel share one grid of equal columns: Filters spans all
   but the last, Time Range takes the last, panel controls fill the same ones. */
.explorer-toolbar-main {
    container: explorer-toolbar / inline-size;
}
.explorer-toolbar-top,
.explorer-filter-more {
    --explorer-cols: 2;
    display: grid;
    grid-template-columns: repeat(var(--explorer-cols), minmax(0, 1fr));
    column-gap: 1rem;
}
.explorer-filter-more {
    row-gap: 0.75rem;
    margin-top: 0.75rem;
}
.explorer-toolbar-filters {
    grid-column: 1 / -2;
    min-width: 0;
}
.explorer-toolbar-time {
    grid-column: -2 / -1;
    min-width: 0;
}
@container explorer-toolbar (min-width: 570px) {
    .explorer-toolbar-top,
    .explorer-filter-more {
        --explorer-cols: 3;
    }
}
@container explorer-toolbar (min-width: 760px) {
    .explorer-toolbar-top,
    .explorer-filter-more {
        --explorer-cols: 4;
    }
}
@container explorer-toolbar (min-width: 1150px) {
    .explorer-toolbar-top,
    .explorer-filter-more {
        --explorer-cols: 5;
    }
}
.explorer-filter {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.explorer-filter .form-control {
    height: 2.25rem;
    padding: 8px 12px;
    font-size: 13px;
    border-color: var(--color-border);
    border-radius: var(--radius-sm);
}
.explorer-filter-label {
    font-size: 0.75rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: 2px;
}
.explorer-filter-row .btn {
    text-decoration: none;
}
.explorer-all-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: 1rem;
    background: var(--bs-secondary-bg, #e9ecef);
    color: #374151;
    font-size: 0.8rem;
    font-weight: 600;
}
.explorer-filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
.explorer-chip {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
}
.explorer-chip .chip-remove {
    color: inherit;
    padding: 0 0.25rem;
    line-height: 1;
    text-decoration: none;
}
.time-range-picker {
    position: relative;
    width: 100%;
}
.time-range-times {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.35rem;
}
.time-range-time {
    width: 100%;
}

/* Custom range floats below the picker so the toolbar never grows a row. */
.time-range-custom {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0;
    z-index: 1050;
    width: 320px;
    padding: 0.75rem;
    background: var(--surface-card, #fff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    box-shadow: var(--shadow-card, 0 4px 12px rgba(0, 0, 0, 0.12));
}
.time-range-custom .DateRangePickerInput {
    display: flex;
    align-items: center;
    width: 100%;
    background: transparent;
    border: 0;
}
.time-range-custom .DateInput {
    width: 100% !important;
    background: transparent;
}

/* One look for the date and time inputs: boxed at rest, blue underline on focus. */
.time-range-time,
.time-range-custom .DateInput_input {
    height: 2.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--bs-body-color, #212529);
    background: var(--surface-card, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: var(--radius-sm, 6px);
}
.time-range-custom .DateInput_input__focused,
.time-range-time:focus {
    border-bottom: 2px solid var(--color-primary, #007ea7);
    outline: none;
}
.time-range-time:focus {
    box-shadow: none;
}

/* Selected custom range shown under the dropdown after the panel is closed. */
.time-range-summary {
    margin-top: 0.2rem;
    font-size: 0.7rem;
    color: var(--text-secondary, #64748b);
    white-space: nowrap;
}
.time-range-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}
.time-range-apply {
    font-size: 0.8rem;
}

/* Compact auto-refresh cycle button: fixed width so the cadence never shifts. */
.auto-refresh-cycle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 2.25rem;
    font-size: 13px;
    white-space: nowrap;
}
/* Luos neutral toolbar button (filters toggle, auto-refresh); auto-refresh is
   tinted while a cadence is on. */
.explorer-filters-toggle.btn,
.auto-refresh-cycle.btn {
    --bs-btn-color: var(--text-secondary);
    --bs-btn-bg: var(--surface-card);
    --bs-btn-border-color: var(--color-border);
    --bs-btn-hover-color: var(--text-primary);
    --bs-btn-hover-bg: var(--surface-muted);
    --bs-btn-hover-border-color: var(--color-border);
    --bs-btn-active-color: var(--text-primary);
    --bs-btn-active-bg: var(--surface-muted);
    --bs-btn-active-border-color: var(--color-border);
    --bs-btn-border-radius: var(--radius-sm);
    color: var(--bs-btn-color);
    background-color: var(--bs-btn-bg);
    border-color: var(--bs-btn-border-color);
}
.explorer-filters-toggle.btn:hover,
.auto-refresh-cycle.btn:hover {
    color: var(--bs-btn-hover-color);
    background-color: var(--bs-btn-hover-bg);
    border-color: var(--bs-btn-hover-border-color);
}
.explorer-filters-toggle.btn:active,
.auto-refresh-cycle.btn:active {
    color: var(--bs-btn-active-color);
    background-color: var(--bs-btn-active-bg);
    border-color: var(--bs-btn-active-border-color);
}
.auto-refresh-cycle.btn.is-on {
    --bs-btn-color: var(--color-primary);
    --bs-btn-bg: color-mix(in srgb, var(--color-primary) 8%, var(--surface-card));
    --bs-btn-border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
    --bs-btn-hover-color: var(--color-primary);
    --bs-btn-hover-bg: color-mix(in srgb, var(--color-primary) 14%, var(--surface-card));
    --bs-btn-hover-border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
    --bs-btn-active-color: var(--color-primary);
    --bs-btn-active-bg: color-mix(in srgb, var(--color-primary) 14%, var(--surface-card));
    --bs-btn-active-border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
}

/* View toggle: join the radio buttons into a single Bootstrap button group. */
.explorer-view-group .form-check {
    margin: 0;
    padding-left: 0;
}
.explorer-view-group .form-check + .form-check {
    margin-left: -1px;
}
.explorer-view-group .form-check .btn {
    display: inline-flex;
    align-items: center;
    height: 2.25rem;
    border-radius: 0;
}
.explorer-view-group .form-check:first-child .btn {
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
}
.explorer-view-group .form-check:last-child .btn {
    border-top-right-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
}
.explorer-filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 2.25rem;
    padding: 0 12px;
    font-size: 13px;
    white-space: nowrap;
}
.explorer-filters-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}
.explorer-filters-count:empty {
    display: none;
}
.explorer-filters-chevron {
    transition: transform 0.2s ease;
}

/* Hide the Auto-refresh heading on narrow viewports; icon + cadence stay. */
@media (max-width: 1200px) {
    /* Keeps the line height so the button stays aligned with the View toggle. */
    .auto-refresh-heading {
        width: 0;
        overflow: hidden;
        white-space: nowrap;
        visibility: hidden;
    }
}

/* Explorer rows open the right-side detail panel on click. */
.log-row {
    cursor: pointer;
}

/* Explorer list table (Luos _tables.css): only the rows scroll. */
#audit-table-container > .table-responsive {
    max-height: max(20rem, calc(100vh - 16rem));
    overflow: auto;
    border: 1px solid var(--color-border);
    border-bottom: 0;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.audit-table {
    --bs-table-bg: var(--surface-card);
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--color-border);
    --bs-table-hover-bg: var(--table-row-hover-bg);
    --bs-table-hover-color: var(--text-primary);
    /* separate: a sticky header keeps its own borders while scrolling */
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
    font-size: 13px;
}
.audit-table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 10px 16px;
    background-color: var(--surface-muted);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
    border-bottom: 2px solid var(--color-border);
    border-right: 1px solid var(--color-border);
}
.audit-table > thead > tr > th:last-child {
    border-right: none;
}
.audit-table > tbody > tr > td {
    padding: 10px 16px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--color-border);
}
.audit-table > tbody > tr:last-child > td {
    border-bottom: 0;
}
.audit-table > tbody > tr:hover > td {
    background-color: var(--table-row-hover-bg);
    box-shadow: none;
}

/* Explorer pagination footer (Luos .tabulator-footer / .tabulator-page) */
.explorer-table-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--surface-muted);
    border: 1px solid var(--color-border);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
#audit-table-container:empty + .explorer-table-footer {
    border-radius: var(--radius-sm);
}
.explorer-table-footer #summary-text {
    margin-right: auto;
    font-size: 12px;
    white-space: nowrap;
}
.explorer-table-footer .form-label {
    font-size: 12px;
    white-space: nowrap;
}
.explorer-table-footer .pagination {
    flex-wrap: wrap;
    gap: 4px;
}
.explorer-table-footer .pagination .page-link {
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    color: var(--text-primary);
    background: var(--surface-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: none;
}
.explorer-table-footer .pagination .page-link:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}
.explorer-table-footer .pagination .page-item.active .page-link {
    color: #fff;
    background: var(--color-primary);
    border-color: var(--color-primary);
}
.explorer-table-footer .pagination .page-item.disabled .page-link {
    opacity: 0.4;
    color: var(--text-secondary);
    background: var(--surface-card);
}
.log-detail-table {
    width: 100%;
    table-layout: fixed;
}
.log-detail-table th.log-detail-key {
    width: 40%;
    vertical-align: top;
    font-weight: 600;
    color: var(--text-secondary, #64748b);
    word-break: break-word;
}
.log-detail-table td.log-detail-value {
    vertical-align: top;
    color: var(--text-primary, #1e293b);
    word-break: break-word;
    white-space: pre-wrap;
}

/* Pagination: larger, easier-to-hit controls */
.pagination {
    gap: 0.25rem;
    margin-bottom: 0;
}
.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0.35rem 0.6rem;
    color: var(--text-primary, #1e293b);
    border-radius: 0.375rem;
}
.pagination .page-link:hover {
    color: var(--color-primary, #007ea7);
}
.pagination .page-item.disabled .page-link {
    color: var(--text-secondary, #64748b);
}
#page-size-select {
    height: 28px;
    min-height: 28px;
    padding: 0 2rem 0 8px;
    font-size: 12px;
    background-position: right 8px center;
    border-color: var(--color-border);
    border-radius: var(--radius-sm);
}

/* Process intelligence */
.process-category-dropdown {
    min-width: 220px;
}

/* ===== Case investigation ===== */
.case-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}
.case-info-tabs .nav-link {
    color: var(--text-secondary, #64748b);
    font-weight: 600;
    font-size: 0.85rem;
}
.case-info-tabs .nav-link.active {
    color: var(--color-primary, #007ea7);
}
.case-info-grid {
    display: flex;
    flex-direction: column;
}
.case-info-row {
    display: grid;
    grid-template-columns: 12rem minmax(0, 1fr);
    gap: 1rem;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid var(--color-border-light, #f1f5f9);
}
.case-info-row:last-child {
    border-bottom: none;
}
.case-info-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary, #64748b);
}
.case-info-value {
    font-size: 0.85rem;
    color: var(--text-primary, #1e293b);
    word-break: break-word;
}

/* Initials avatars (photo overlay hidden by assets/user-avatars.js on 404) */
.user-avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    overflow: hidden;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.user-avatar__initials {
    line-height: 1;
}
.user-avatar__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.case-people-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.case-person {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.case-person__meta {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.case-person__name {
    font-size: 0.85rem;
    color: var(--text-primary, #1e293b);
}
.case-person__uid {
    font-size: 0.7rem;
}

/* ===== Dashboard hub (Spec 053) ===== */
.hub-group {
    margin-bottom: 28px;
}
.hub-group:last-child {
    margin-bottom: 0;
}
.hub-group__title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.hub-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
}
.hub-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.hub-card {
    --hub-accent: var(--color-info);
    display: flex;
    align-items: center;
    gap: 18px;
    height: 100%;
    min-height: 128px;
    padding: 22px;
    background: var(--surface-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card), inset 3px 0 0 0 var(--hub-accent);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.hub-card__link:hover .hub-card {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12), inset 3px 0 0 0 var(--hub-accent);
    transform: translateY(-2px);
}
.hub-card--core {
    --hub-accent: var(--color-primary);
}
.hub-card--plugin {
    --hub-accent: var(--color-info);
}
.hub-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    flex-shrink: 0;
    border-radius: 18px;
    font-size: 2rem;
    color: var(--hub-accent);
    background: color-mix(in srgb, var(--hub-accent) 12%, var(--surface-card));
}
.hub-card__text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.hub-card__title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
}
.hub-card__subtitle {
    font-size: 0.85rem;
    color: var(--text-nav);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hub-state {
    width: 100%;
}

@media (max-width: 1100px) {
    .hub-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 680px) {
    .hub-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Page toolbar + relative date filter (Events pilot) ===== */
.page-toolbar-row {
    width: 100%;
    margin-bottom: 16px;
}
.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
}
.page-toolbar__extra {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.page-toolbar__date {
    margin-left: auto;
}
.date-filter {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.date-filter .btn,
.date-filter .btn-group {
    margin: 0;
}
.date-filter__sep {
    width: 1px;
    align-self: stretch;
    min-height: 1.75rem;
    background: var(--color-border-light);
    margin: 0 0.25rem;
}
.date-nav-btn i {
    font-size: 0.85rem;
    line-height: 1;
}

/* In-graph selector overlay (Events timeseries) */
.chart-with-selector {
    position: relative;
}
.chart-selector-overlay {
    position: absolute;
    top: 56px;      /* align with the top of the plot/legend panel (below the title) */
    left: calc(82% - 16px);  /* align with the legend panel's left edge (x=0.82, l-margin 50, r-margin 30) */
    z-index: 5;
}

/* Heatmap dimension controls, in the chart_panel side column (same slot as
   the area-chart readout: beside the plot, under it when the panel is narrow). */
.heatmap-side-panel {
    min-width: 0;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}
.heatmap-side-panel .compact-radio-group {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 8px;
}
/* dbc wraps each option in .form-check; that wrapper is the flex item. */
.heatmap-side-panel .compact-radio-group > .form-check {
    flex: 1 1 auto;
    min-width: min(100%, max-content);
    max-width: 100%;
    margin: 0;
}
.heatmap-side-panel .compact-radio-group .btn {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.heatmap-value-list {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.heatmap-value-list .form-check-label {
    display: block;
    min-width: 0;
    padding: 4px 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.8125rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--color-border-light);
    cursor: pointer;
}
.heatmap-value-list .form-check-label:last-child {
    border-bottom: 0;
}
.heatmap-value-list .form-check-label:hover {
    background: color-mix(in srgb, var(--surface-page) 60%, transparent);
}
.heatmap-value-list .form-check-input {
    margin: 0 8px 0 0;
    vertical-align: -2px;
}
@container (min-width: 640px) {
    .heatmap-side-panel {
        padding: 0 0 0 14px;
        border-top: 0;
        border-left: 1px solid var(--color-border);
    }
}

/* ===== Chart widgets (Spec 055, Propuesta C) ===== */
.chart-panel {
    min-width: 0;
    height: 100%;
    background: var(--surface-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.chart-panel__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border-light);
}
.chart-panel__title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}
.chart-panel__hint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}
.chart-panel__body {
    padding: 14px;
    min-width: 0;
}
.chart-plot {
    background: color-mix(in srgb, var(--surface-page) 50%, var(--surface-card));
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    padding: 10px 10px 6px;
    overflow: hidden;
}
/* Vertical bars with many categories: keep the per-category slot and scroll. */
.chart-plot--scroll {
    overflow-x: auto;
    overflow-y: hidden;
}
/* Horizontal bars with many rows: cap the height and scroll vertically. */
.chart-plot--vscroll {
    max-height: 420px; /* = HORIZONTAL_BARS_MAX_HEIGHT (chart_styles.py) */
    overflow-x: hidden;
    overflow-y: auto;
}
/* The global rect.bg rule paints Plotly backgrounds; widget figures stay transparent. */
.chart-plot rect.bg,
.gauge-card rect.bg {
    fill: transparent !important;
}
.chart-plot .modebar-container,
.gauge-card .modebar-container {
    top: 2px !important;
    right: 2px !important;
}
.chart-plot .modebar,
.gauge-card .modebar {
    display: flex;
    gap: 2px;
    padding: 2px;
    background: var(--surface-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.chart-plot .plotly:hover .modebar,
.gauge-card .plotly:hover .modebar {
    opacity: 1;
}
.chart-plot .modebar-group,
.gauge-card .modebar-group {
    padding: 0 !important;
    background: transparent !important;
}
.chart-plot .modebar-group + .modebar-group,
.gauge-card .modebar-group + .modebar-group {
    padding-left: 2px !important;
    border-left: 1px solid var(--color-border-light);
}
.chart-plot .modebar-btn,
.gauge-card .modebar-btn {
    padding: 3px 4px !important;
    border-radius: 4px;
}
.chart-plot .modebar-btn path,
.gauge-card .modebar-btn path {
    fill: var(--text-muted) !important;
}
.chart-plot .modebar-btn:hover,
.gauge-card .modebar-btn:hover,
.chart-plot .modebar-btn.active,
.gauge-card .modebar-btn.active {
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
}
.chart-plot .modebar-btn:hover path,
.gauge-card .modebar-btn:hover path,
.chart-plot .modebar-btn.active path,
.gauge-card .modebar-btn.active path {
    fill: var(--color-primary) !important;
}
.chart-plot .modebar-btn[data-attr="zoom"][data-val="reset"] path {
    display: none;
}
.chart-plot .modebar-btn[data-attr="zoom"][data-val="reset"] svg {
    background-color: var(--text-muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.chart-plot .modebar-btn[data-attr="zoom"][data-val="reset"]:hover svg {
    background-color: var(--color-primary);
}
.chart-axis-note {
    margin: 8px 0 0;
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-align: center;
}
.chart-panel { container-type: inline-size; }
.chart-panel__body--side {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}
.chart-panel__body--side > .chart-axis-note { grid-column: 1 / -1; margin-top: 0; }
.chart-panel__side { min-width: 0; }
.event-readout {
    min-width: 0;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}
.event-readout.is-empty { display: none; }
@container (min-width: 640px) {
    .chart-panel__body--side { grid-template-columns: minmax(0, 1fr) 15rem; }
    .event-readout {
        padding: 0 0 0 14px;
        border-top: 0;
        border-left: 1px solid var(--color-border);
    }
}
.event-readout__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.event-readout__when {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.event-readout__pin {
    padding: 1px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-primary);
    background: transparent;
    border: 1px solid var(--color-primary);
    border-radius: 999px;
    cursor: pointer;
}
.event-readout__pin::after { content: " \00d7"; }
.event-readout__pin.is-hidden { display: none; }
.event-readout__total,
.event-readout__row {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    width: 100%;
    padding: 4px 0;
    font-size: 0.8125rem;
    color: var(--text-primary);
}
.event-readout__total {
    border-bottom: 1px solid var(--color-border);
}
.event-readout__total .event-readout__name { grid-column: 1 / 3; color: var(--text-primary); font-weight: 600; }
.event-readout__row {
    border: 0;
    border-bottom: 1px solid var(--color-border-light);
    background: transparent;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.event-readout__row:last-child { border-bottom: 0; }
.event-readout__row:hover { background: color-mix(in srgb, var(--surface-page) 60%, transparent); }
.event-readout__row.is-off { opacity: 0.4; }
.event-readout__swatch {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}
.event-readout__name {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.event-readout__value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.chart-mosaic {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
}
/* Collapses with a preceding mb-4 (1.5rem), so those pages keep their spacing. */
.chart-mosaic:not(:first-child) {
    margin-top: 1.5rem;
}
.chart-mosaic__cell { min-width: 0; }
.chart-mosaic__cell.span-3 { grid-column: span 3; }
.chart-mosaic__cell.span-4 { grid-column: span 4; }
.chart-mosaic__cell.span-6 { grid-column: span 6; }
.chart-mosaic__cell.span-8 { grid-column: span 8; }
.chart-mosaic__cell.span-9 { grid-column: span 9; }
.chart-mosaic__cell.span-12 { grid-column: span 12; }
.gauge-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

/* Plugin dashboard top block: metric cards 4-per-row on the left and the gauge
   spanning two rows on the right (CSS grid rowspan). Extra cards open new rows
   under the four columns. */
.manager-top-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(16rem, 1.2fr);
    gap: 1rem;
    align-items: start;
}
.manager-top-grid > * {
    min-width: 0;
}
.manager-top-grid__gauge {
    grid-column: 5;
    grid-row: 1 / span 2;
}
.manager-top-grid__wide {
    grid-column: span 2;
}
.manager-top-grid__gauge .gauge-card {
    height: 100%;
}
/* A nested stats grid (e.g. the "Total" pair) keeps two columns without
   overflowing its narrower cell. */
.manager-top-grid .card-grid--metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 1300px) {
    .manager-top-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .manager-top-grid__gauge {
        grid-column: auto;
        grid-row: auto;
    }
}
.gauge-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 12px 12px 10px;
    background: color-mix(in srgb, var(--surface-page) 50%, var(--surface-card));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}
.gauge-card__title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}
.gauge-card__target {
    margin: 2px 0 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.gauge-card__body {
    margin-top: auto;
}

/* Chart styling lab (debug only) */
.chart-lab__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    align-items: center;
    margin-bottom: 16px;
}
.chart-lab__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.chart-lab__field-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.chart-lab__section-title {
    margin: 22px 0 10px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.chart-lab__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}
.chart-lab__grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.chart-lab__gauges > div + div {
    margin-top: 16px;
}
.chart-lab__column-label {
    margin: 0 0 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.chart-lab__current {
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 6px;
}
/* Gauge prototype A (SVG arc): data-URI image + HTML overlay. */
.gauge-arc {
    position: relative;
    min-width: 0;
}
.gauge-arc--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    padding: 0 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}
.gauge-arc__svg {
    display: block;
    width: 100%;
    max-width: 280px;
    height: auto;
    margin: 0 auto;
}
.gauge-arc__center {
    position: absolute;
    left: 0;
    right: 0;
    top: 64%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
    pointer-events: none;
}
.gauge-arc__value {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.05;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.gauge-arc__unit {
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.gauge-arc__delta {
    margin-top: 2px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
/* Gauge target input (single line: label + input). */
.gauge-card__target-edit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--color-border);
}
.gauge-card__target-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}
.gauge-card__target-input,
.gauge-card__target-edit input {
    width: 5.5rem !important;
    padding: 2px 6px;
    font-size: 0.75rem;
    color: var(--text-primary);
    background: var(--surface-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm, 6px);
}
/* ===== Stat cards (spec 055/058) ===== */
.chart-lab__stat-cards > div + div {
    margin-top: 16px;
}
.statcard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    max-width: 820px;
}
.statcard {
    --metric-accent: var(--color-primary);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: var(--surface-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card), inset 3px 0 0 0 var(--metric-accent);
    min-height: 6rem;
}
.statcard .metric-card__sparkline {
    min-height: 0;
}
.statcard__label {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-nav);
}
.statcard__label--muted {
    color: var(--text-muted);
}
.statcard__value {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.05;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.statcard__value--hero {
    font-size: 1.75rem;
}
.statcard__period {
    margin: 0;
    font-size: 0.625rem;
    color: var(--text-muted);
}
.statcard--overlay {
    position: relative;
    min-height: 5.75rem;
    padding-bottom: 0;
    overflow: hidden;
}
.statcard--overlay .statcard__bg {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}
.statcard--overlay .statcard__bg .metric-card__sparkline {
    min-height: 0;
}
.statcard--overlay .statcard__overlay {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.statcard--overlay .statcard__value,
.statcard--overlay .statcard__label,
.statcard--overlay .statcard__period {
    text-shadow: 0 1px 2px color-mix(in srgb, var(--surface-card) 96%, transparent),
                 0 0 6px color-mix(in srgb, var(--surface-card) 82%, transparent);
}
.statcard--overlay .statcard__period {
    align-self: flex-start;
    padding: 1px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-card) 72%, transparent);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}
/* Keep the delta chip sized to its text, not stretched by the column flex. */
.statcard--overlay .delta-chip {
    align-self: flex-start;
}
.delta-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 600;
    white-space: nowrap;
}
.delta-chip--success {
    color: var(--color-success);
    background: color-mix(in srgb, var(--color-success) 14%, var(--surface-card));
}
.delta-chip--danger {
    color: var(--color-danger);
    background: color-mix(in srgb, var(--color-danger) 14%, var(--surface-card));
}
/* ===== Info cards (icon + title + value, spec 055/058) ===== */
.infocard {
    --metric-accent: var(--text-secondary);
    background: var(--surface-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card), inset 3px 0 0 0 var(--metric-accent);
}
.infocard__label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
}
.infocard__icon {
    color: var(--metric-accent);
    font-size: 0.8125rem;
}
/* Value first: hero value on top, muted icon + label below. */
.infocard--value-first {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 12px 14px;
    min-height: 6rem;
}
.infocard--value-first .infocard__value {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.infocard__meta {
    display: flex;
    align-items: center;
    gap: 6px;
}
.infocard--value-first .infocard__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    font-size: 0.875rem;
    color: var(--metric-accent);
    background: color-mix(in srgb, var(--metric-accent) 14%, var(--surface-card));
}
.infocard--value-first .infocard__label {
    color: var(--text-nav);
    font-size: 0.8125rem;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .chart-mosaic__cell.span-3,
    .chart-mosaic__cell.span-4,
    .chart-mosaic__cell.span-6,
    .chart-mosaic__cell.span-8,
    .chart-mosaic__cell.span-9 { grid-column: span 6; }
    .chart-lab__grid { grid-template-columns: 1fr; }
    .chart-lab__grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .statcard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .chart-mosaic,
    .gauge-grid,
    .statcard-grid,
    .chart-lab__grid--3 { grid-template-columns: 1fr; }
    .chart-mosaic__cell[class*="span-"] { grid-column: span 1; }
    .chart-panel__header { flex-direction: column; }
    .chart-panel__hint { text-align: left; }
}

