﻿/* CSS VERSION: v3.0.0 - June 12, 2026 - Signature polish: motion system, refined theme, micro-interactions */
/* Accessibility: Skip Navigation Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    z-index: 9999;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

html,
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    max-width: 100vw;
    width: 100vw;
    overflow-x: hidden;
    scrollbar-gutter: stable force;
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box;
}

a,
.btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding: 1rem;
    max-width: 100vw;
    flex-grow: 1;
    overflow-x: auto;
}

/* Layout spacing baseline - provides calm, comfortable spacing across all viewports.
   Desktop gets more breathing room while maintaining information density. */
@media (min-width: 992px) {
    .content {
        padding: 1.5rem 2rem;
    }
}

@media (min-width: 1200px) {
    .content {
        padding: 1.5rem 2.5rem;
    }
}

/* Consistent container spacing for pages */
.container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 992px) {
    .container-fluid {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* Dashboard Cards */
.border-left-primary {
    border-left: 0.25rem solid #4e73df !important;
}

.border-left-success {
    border-left: 0.25rem solid #1cc88a !important;
}

.border-left-info {
    border-left: 0.25rem solid #36b9cc !important;
}

.border-left-warning {
    border-left: 0.25rem solid #f6c23e !important;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

.text-gray-300 {
    color: #dddfeb !important;
}

.text-xs {
    font-size: 0.7rem;
}

.font-weight-bold {
    font-weight: 700 !important;
}

/* Login Page Styles */
.vh-100 {
    height: 100vh !important;
}

.card {
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15) !important;
}

.card-body {
    padding: 1.25rem;
}

/* Navigation improvements */
.navbar-brand {
    font-weight: bold;
}

/* Navigation Styles - Mobile and Desktop */
.mobile-nav .nav-item {
    margin-bottom: 0.5rem;
}

.mobile-nav .nav-link {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    color: #374151;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-height: 44px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mobile-nav .nav-link:hover,
.mobile-nav .nav-link:focus {
    background: #f3f4f6;
    color: #2563eb;
    text-decoration: none;
}

.mobile-nav .nav-link.active {
    background: #eff6ff;
    color: #2563eb;
    border-left: 3px solid #2563eb;
}

.mobile-nav .nav-link i,
.mobile-nav .nav-link .bi {
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ===== ADVANCED SPACE OPTIMIZATION IMPROVEMENTS ===== */

/* Table optimizations */
.table th,
.table td {
    padding: 0.5rem 0.75rem;
    /* Reduced table cell padding */
    vertical-align: middle;
}

.table-sm th,
.table-sm td {
    padding: 0.375rem 0.5rem;
    /* Even more compact for small tables */
}

/* Form optimizations */
.form-control,
.form-select {
    padding: 0.5rem 0.75rem;
    /* Slightly reduced form control padding */
    font-size: 0.9rem;
    /* Slightly smaller form text */
}

.form-control-sm,
.form-select-sm {
    padding: 0.375rem 0.5rem;
    /* More compact small form controls */
    font-size: 0.825rem;
}

/* Button optimizations */
.btn {
    padding: 0.5rem 1rem;
    /* Optimized button padding */
    font-size: 0.9rem;
    /* Slightly smaller button text */
    line-height: 1.3;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    /* More compact small buttons */
    font-size: 0.8rem;
}

/* Modal optimizations */
.modal-header {
    padding: 0.875rem 1rem;
    /* Reduced modal header padding */
}

.modal-body {
    padding: 0.875rem 1rem;
    /* Reduced modal body padding */
}

.modal-footer {
    padding: 0.75rem 1rem;
    /* Reduced modal footer padding */
}

/* Utility classes for space management */
.p-compact {
    padding: 0.5rem !important;
}

.px-compact {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

.py-compact {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.m-compact {
    margin: 0.5rem !important;
}

.mx-compact {
    margin-left: 0.5rem !important;
    margin-right: 0.5rem !important;
}

.my-compact {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

/* Offcanvas Mobile Menu - Optimized width */
.offcanvas {
    max-width: 200px;
    /* Match sidebar width */
}

.offcanvas-header {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    /* Reduced padding for more space */
}

.offcanvas-body {
    padding: 0.75rem 1rem;
    /* Reduced padding for more space */
}

/* Mobile Menu Toggle - Only visible on mobile */
.mobile-menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #374151;
    padding: 0.5rem;
    border-radius: 6px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* Hide hamburger menu on desktop */
@media (min-width: 992px) {
    .mobile-menu-toggle {
        display: none !important;
    }

    /* Force hide any navbar-toggler checkboxes on desktop */
    .navbar-toggler,
    input[type="checkbox"][title="Navigation menu"] {
        display: none !important;
    }
}

.mobile-menu-toggle:hover {
    background: #f3f4f6;
}

.mobile-menu-toggle:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ===== SPACE-OPTIMIZED MOBILE-FIRST DASHBOARD STYLES ===== */

/* Mobile Header - Reduced padding */
.mobile-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem;
    /* Reduced from 1rem */
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Mobile brand with optimized sizing */
.mobile-brand {
    font-size: 1.125rem;
    /* Slightly reduced for more space */
    font-weight: 700;
    color: #2563eb;
    margin: 0;
}

/* Subtle mobile brand styling */
.mobile-brand-subtle {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

.mobile-logout-btn {
    background: none;
    border: none;
    font-size: 1.125rem;
    /* Slightly reduced */
    color: #6b7280;
    padding: 0.375rem;
    /* Reduced padding */
    border-radius: 6px;
    min-width: 40px;
    /* Reduced from 44px */
    min-height: 40px;
    /* Reduced from 44px */
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.mobile-logout-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Dashboard Header - Optimized spacing */
.dashboard-header {
    padding: 0.75rem;
    /* Reduced from 1rem */
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    margin: -0.75rem -0.75rem 1rem -0.75rem;
    /* Adjusted for new content padding */
    overflow-x: hidden;
}

.business-health-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.health-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    /* Reduced gap */
    font-weight: 600;
}

.health-status i {
    margin-left: 0.25rem;
}

.health-good {
    color: #10b981;
}

.health-warning {
    color: #f59e0b;
}

.health-critical {
    color: #ef4444;
}

.date-info {
    font-size: 0.8rem;
    /* Slightly smaller for more space */
    opacity: 0.9;
    margin-right: 0.25rem;
    /* Reduced margin */
    display: flex;
    align-items: center;
    gap: 0.375rem;
    /* Reduced gap */
}

/* Section Titles */
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    padding: 0 1rem;
}

/* Metrics Section */
.metrics-section {
    margin-bottom: 2rem;
}

.metrics-scroll-container {
    display: flex;
    gap: 1rem;
    padding: 0 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.metrics-scroll-container::-webkit-scrollbar {
    display: none;
}

.metric-card {
    min-width: 280px;
    max-width: 320px;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    scroll-snap-align: start;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.metric-primary {
    border-left-color: #2563eb;
}

.metric-success {
    border-left-color: #16a34a;
}

.metric-warning {
    border-left-color: #ea580c;
}

.metric-info {
    border-left-color: #0891b2;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.metric-primary .metric-icon {
    background: #2563eb;
}

.metric-success .metric-icon {
    background: #16a34a;
}

.metric-warning .metric-icon {
    background: #ea580c;
}

.metric-info .metric-icon {
    background: #0891b2;
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.metric-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.25rem 0;
}

.metric-change {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    display: inline-block;
}

.metric-change.positive {
    background: #dcfce7;
    color: #166534;
}

.metric-change.negative {
    background: #fee2e2;
    color: #991b1b;
}

.metric-change.neutral {
    background: #f3f4f6;
    color: #374151;
}

/* Charts Section */
.charts-section {
    margin-bottom: 2rem;
}

.chart-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 0 1rem 1.5rem 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.chart-summary {
    font-size: 0.875rem;
}

.trend-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
}

.trend-indicator.positive {
    color: #16a34a;
}

.trend-indicator.negative {
    color: #dc2626;
}

.collection-rate {
    color: #16a34a;
    font-weight: 600;
}

.chart-wrapper {
    position: relative;
    height: 200px;
}

/* Activity Section */
.activity-section {
    margin-bottom: 6rem;
    /* Space for bottom nav */
}

.activity-feed {
    padding: 0 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.125rem;
}

.activity-icon.primary {
    background: #2563eb;
}

.activity-icon.success {
    background: #16a34a;
}

.activity-icon.warning {
    background: #ea580c;
}

.activity-icon.danger {
    background: #dc2626;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
}

.activity-details {
    color: #6b7280;
    font-size: 0.8125rem;
    margin: 0.125rem 0;
}

.activity-time {
    color: #9ca3af;
    font-size: 0.75rem;
}

.activity-amount {
    font-weight: 700;
    font-size: 0.875rem;
}

.activity-amount.primary {
    color: #2563eb;
}

.activity-amount.success {
    color: #16a34a;
}

.activity-amount.danger {
    color: #dc2626;
}

/* Bottom Navigation (Mobile) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    text-decoration: none;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 8px;
    margin: 0 0.25rem;
    transition: all 0.2s ease;
    min-height: 44px;
    /* Touch target */
}

.bottom-nav-item:hover,
.bottom-nav-item:focus {
    color: #2563eb;
    background: #eff6ff;
    text-decoration: none;
}

.bottom-nav-item.primary {
    background: #2563eb;
    color: white;
}

.bottom-nav-item.primary:hover,
.bottom-nav-item.primary:focus {
    background: #1d4ed8;
    color: white;
}

.bottom-nav-item i {
    font-size: 1.25rem;
}

/* Desktop Sidebar */
.desktop-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: white;
    border-left: 1px solid #e5e7eb;
    padding: 0.75rem;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: #f8f5fc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-action:hover,
.sidebar-action:focus {
    background: #e2e8f0;
    color: #334155;
    text-decoration: none;
    transform: translateY(-1px);
}

.sidebar-action.primary {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.sidebar-action.primary:hover,
.sidebar-action.primary:focus {
    background: #1d4ed8;
    color: white;
    border-color: #1d4ed8;
}

.status-indicators {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f5fc;
    border-radius: 6px;
    font-size: 0.875rem;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.success {
    background: #dcfce7;
    color: #166534;
}

.status-time {
    color: #6b7280;
    font-size: 0.8125rem;
}

/* Responsive Layout Adjustments */
@media (min-width: 1024px) {
    .dashboard-header {
        margin: -1.5rem -1.5rem 2rem -1.5rem;
        padding: 1.5rem;
    }

    .section-title {
        padding: 0;
    }

    .metrics-scroll-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
        padding: 0;
        overflow: visible;
    }

    .metric-card {
        min-width: auto;
    }

    .chart-container {
        margin: 0 0 1.5rem 0;
    }

    .activity-feed {
        padding: 0;
    }

    .activity-section {
        margin-bottom: 2rem;
        margin-right: 300px;
        /* Space for sidebar */
    }

    .charts-section {
        margin-right: 300px;
        /* Space for sidebar */
    }

    .metrics-section {
        margin-right: 300px;
        /* Space for sidebar */
    }
}

/* Touch Improvements */
@media (hover: none) and (pointer: coarse) {
    .metric-card {
        min-height: 120px;
    }

    .activity-item {
        min-height: 72px;
    }

    .bottom-nav-item {
        min-height: 56px;
        padding: 0.75rem 0.5rem;
    }
}

/* Safe Area Support for iOS */
@supports (padding: max(0px)) {
    .bottom-nav {
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
}

/* DataGrid and Search Input Improvements */
.input-group-text {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

.input-group-text i {
    font-size: 0.875rem;
}

/* Improve search input focus state */
.input-group:focus-within .input-group-text {
    border-color: #86b7fe;
    background-color: #e7f1ff;
    color: #0d6efd;
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    .dashboard-header {
        background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    }
}

/* Additional Space-efficient utility classes */
.compact-form .form-group {
    margin-bottom: 0.75rem;
    /* Reduced from default 1rem */
}

.compact-form .form-control {
    padding: 0.375rem 0.5rem;
    /* Slightly reduced padding */
}

.compact-table th,
.compact-table td {
    padding: 0.5rem 0.75rem;
    /* More compact than default */
}

.compact-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.minimal-gap {
    gap: 0.25rem;
}

.tight-spacing>*+* {
    margin-top: 0.5rem;
    /* Reduced spacing between elements */
}

/* Maximize content width utility */
.full-width-content {
    width: 100%;
    max-width: none;
    margin: 0;
}

/* Additional responsive spacing adjustments */
@media (min-width: 992px) {
    .desktop-compact {
        padding: 0.5rem 0.75rem;
    }

    .desktop-full-width {
        width: calc(100vw - 260px);
        /* Account for sidebar width */
    }

    /* Eliminate any remaining gaps on desktop */
    .main-content-desktop {
        margin-left: 0;
        padding-left: 0;
        width: calc(100% - 260px);
    }
}

/* Zero gap utilities for maximum space efficiency */
.no-gap {
    gap: 0;
}

.no-margin {
    margin: 0 !important;
}

.no-padding {
    padding: 0 !important;
}

.min-padding {
    padding: 0.25rem !important;
}

.micro-margin {
    margin: 0.125rem !important;
}

/* ===== DASHBOARD LAYOUT OPTIMIZATIONS ===== */

/* Ensure full width utilization for dashboard content */
@media (min-width: 992px) {

    /* Remove any unnecessary margins for better space utilization */
    .dashboard-content {
        max-width: 100%;
        padding: 0 15px;
    }
}

/* ===== MENU ALIGNMENT FIXES ===== */

/* Fix sidebar menu icon and text alignment */
.sidebar .nav-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    /* Consistent spacing between icon and text */
    padding: 0.75rem 1rem !important;
    white-space: nowrap !important;
}

.sidebar .nav-link i,
.sidebar .nav-link .bi {
    width: 1.25rem !important;
    /* Fixed width for consistent alignment */
    text-align: center !important;
    flex-shrink: 0 !important;
    /* Prevent icon from shrinking */
}

/* ===== PINNED SIDEBAR - CENTER-ALIGNED ICONS ===== */
/* High specificity to override scoped CSS */
.sidebar.pinned .nav-item .nav-link {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0.75rem 0 !important;
    text-align: center !important;
}

/* Pinned sidebar vertical layout - use inline style injection instead */
.sidebar.pinned .sidebar-header {
    padding: 0.25rem 0 !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 0.25rem !important;
    height: 48px !important;
}

.sidebar.pinned .sidebar-brand-text {
    display: none !important;
}

.sidebar.pinned .navbar-brand {
    flex-direction: column !important;
    gap: 0.25rem !important;
    align-items: center !important;
}

.sidebar.pinned .brand-icon {
    margin: 0 !important;
    width: 24px !important;
    height: 24px !important;
    font-size: 0.9rem !important;
}

.sidebar.pinned .sidebar-pin-button {
    position: static !important;
    width: 24px !important;
    height: 16px !important;
    padding: 0 !important;
}

/* ===== RABBIT ACCOUNTS DESIGN REFRESH ===== */
:root {
    --ra-ink: #18231f;
    --ra-ink-soft: #425149;
    --ra-muted: #69766f;
    --ra-line: #dfe7e2;
    --ra-line-strong: #c6d2cb;
    --ra-surface: #ffffff;
    --ra-surface-soft: #f7faf6;
    --ra-surface-warm: #fbf8f0;
    --ra-primary: #6d28d9;
    --ra-primary-hover: #4c1d95;
    --ra-primary-soft: #f3e8ff;
    --ra-accent: #c026d3;
    --ra-danger: #b42318;
    --ra-focus: #2d7ff9;
    --ra-shadow-sm: 0 1px 2px rgba(24, 35, 31, 0.08);
    --ra-shadow-md: 0 14px 36px rgba(24, 35, 31, 0.12);
    --ra-radius: 8px;
}

html,
body {
    min-height: 100%;
    background:
        linear-gradient(180deg, rgba(247, 250, 246, 0.96) 0%, rgba(244, 247, 242, 0.98) 100%);
    color: var(--ra-ink);
    font-family: "Aptos", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0;
}

body {
    line-height: 1.5;
}

a,
.btn-link {
    color: var(--ra-primary);
}

a:hover,
.btn-link:hover {
    color: var(--ra-primary-hover);
}

.btn {
    border-radius: 7px;
    font-weight: 650;
    letter-spacing: 0;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--ra-primary);
    border-color: var(--ra-primary);
    box-shadow: 0 8px 18px rgba(109, 40, 217, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--ra-primary-hover);
    border-color: var(--ra-primary-hover);
}

.btn-outline-secondary {
    color: var(--ra-ink-soft);
    border-color: var(--ra-line-strong);
    background: rgba(255, 255, 255, 0.74);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    color: var(--ra-ink);
    border-color: var(--ra-primary);
    background: var(--ra-primary-soft);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
.form-select:focus {
    border-color: var(--ra-focus);
    box-shadow: 0 0 0 0.2rem rgba(45, 127, 249, 0.18);
}

.form-control,
.form-select {
    border-color: var(--ra-line-strong);
    border-radius: 7px;
    color: var(--ra-ink);
    min-height: 44px;
}

.form-label {
    color: var(--ra-ink-soft);
    font-weight: 650;
}

.form-check-input {
    border-color: var(--ra-line-strong);
}

.form-check {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check .form-check-input {
    width: 1.05rem;
    min-width: 1.05rem;
    height: 1.05rem;
    min-height: 1.05rem;
    margin-top: 0;
}

.form-check-input:checked {
    background-color: var(--ra-primary);
    border-color: var(--ra-primary);
}

.badge {
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0;
}

.bg-primary {
    background-color: var(--ra-primary) !important;
}

.text-muted {
    color: var(--ra-muted) !important;
}

.content {
    background: transparent;
    padding-bottom: 5.5rem;
}

.app-shell main {
    min-width: 0;
}

.app-topbar {
    min-height: 72px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid var(--ra-line);
    backdrop-filter: blur(14px);
    box-shadow: var(--ra-shadow-sm);
}

.business-logo,
.business-logo-sm {
    border: 1px solid var(--ra-line);
    background: var(--ra-surface);
    box-shadow: var(--ra-shadow-sm);
}

.business-name {
    color: var(--ra-ink) !important;
}

.business-switcher {
    width: min(260px, 28vw);
}

.topbar-user {
    color: var(--ra-muted);
    font-size: 0.92rem;
}

.ra-command-palette {
    position: relative;
}

.command-palette-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.48rem;
    min-height: 2.3rem;
    margin-right: 0.6rem;
    white-space: nowrap;
}

.command-palette-trigger kbd {
    display: inline-flex;
    align-items: center;
    min-height: 1.35rem;
    border: 1px solid rgba(40, 24, 75, 0.13);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--ra-muted);
    box-shadow: none;
    font-size: 0.68rem;
    font-weight: 760;
}

.command-palette-trigger.is-compact {
    width: 2.4rem;
    min-width: 2.4rem;
    height: 2.4rem;
    min-height: 2.4rem;
    margin-right: 0;
    padding: 0;
    justify-content: center;
}

.command-palette-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1080;
    background: rgba(13, 9, 20, 0.32);
    backdrop-filter: blur(3px);
}

.command-palette-panel {
    position: fixed;
    top: 5.25rem;
    left: 50%;
    z-index: 1081;
    width: min(720px, calc(100vw - 2rem));
    max-height: min(680px, calc(100vh - 7rem));
    transform: translateX(-50%);
    overflow: hidden;
    border: 1px solid rgba(109, 40, 217, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 30px 80px rgba(24, 35, 31, 0.24);
}

.command-palette-search {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem;
    border-bottom: 1px solid var(--ra-line);
    background: linear-gradient(180deg, #fff, #fbfaff);
}

.command-palette-search > .bi {
    color: var(--ra-muted);
    font-size: 1.05rem;
}

.command-palette-search .form-control {
    min-height: 2.5rem;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 1rem;
}

.command-palette-results {
    max-height: calc(min(680px, calc(100vh - 7rem)) - 4rem);
    overflow: auto;
    padding: 0.5rem;
}

.command-palette-group + .command-palette-group {
    margin-top: 0.35rem;
}

.command-palette-group-label {
    padding: 0.45rem 0.55rem 0.25rem;
    color: var(--ra-muted);
    font-size: 0.72rem;
    font-weight: 820;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.command-palette-item {
    display: grid;
    grid-template-columns: 2.2rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    min-height: 3.35rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ra-ink);
    text-align: left;
    padding: 0.45rem 0.55rem;
}

.command-palette-item:hover,
.command-palette-item:focus {
    background: var(--ra-primary-soft);
    outline: none;
}

.command-palette-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 8px;
    background: #fff;
    color: var(--ra-primary);
    box-shadow: var(--ra-shadow-sm);
}

.command-palette-copy {
    display: grid;
    gap: 0.05rem;
    min-width: 0;
}

.command-palette-copy strong,
.command-palette-copy small,
.command-palette-path {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.command-palette-copy strong {
    color: var(--ra-ink);
    font-size: 0.92rem;
}

.command-palette-copy small,
.command-palette-path,
.command-palette-empty {
    color: var(--ra-muted);
    font-size: 0.78rem;
}

.command-palette-path {
    max-width: 11rem;
    font-variant-numeric: tabular-nums;
}

.command-palette-empty {
    padding: 2rem 1rem;
    text-align: center;
}

.card,
.modal-content,
.chart-container,
.metric-card,
.activity-item {
    background: var(--ra-surface);
    border: 1px solid var(--ra-line) !important;
    border-radius: var(--ra-radius);
    box-shadow: var(--ra-shadow-sm) !important;
}

.card {
    padding: 0;
}

.card-header {
    background: var(--ra-surface-soft);
    border-bottom-color: var(--ra-line);
}

.table {
    color: var(--ra-ink);
}

.table th {
    color: var(--ra-ink-soft);
    font-size: 0.78rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: 0;
    background: var(--ra-surface-soft);
    border-bottom-color: var(--ra-line-strong);
}

.table td {
    border-color: var(--ra-line);
}

.table-hover tbody tr:hover {
    background-color: rgba(109, 40, 217, 0.06);
}

.sidebar {
    background: #170d29;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 12px 0 36px rgba(26, 11, 46, 0.18);
}

.sidebar-header {
    min-height: 72px;
    padding: 0.9rem 1rem;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-brand {
    gap: 0.75rem;
    color: #faf7ff !important;
    text-decoration: none;
}

.brand-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #26093d;
    background: #f3e8ff;
    box-shadow: inset 0 -1px 0 rgba(31, 27, 77, 0.12);
}

.brand-title {
    display: block;
    color: #faf7ff;
    font-weight: 800;
    line-height: 1.1;
}

.brand-subtitle {
    display: block;
    color: #b9aed6;
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.1;
}

.sidebar-pin-button {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    color: #cdc2e6;
    background: rgba(255, 255, 255, 0.05);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-pin-button:hover,
.sidebar-pin-button:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.nav-scrollable {
    padding: 0.8rem 0 1.25rem;
}

.mobile-nav .nav-item {
    margin-bottom: 0.16rem;
}

.mobile-nav .nav-link,
.sidebar .nav-link {
    min-height: 42px;
    border-radius: 7px;
    color: #ddd6f3;
    font-weight: 650;
    line-height: 1.25;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus,
.mobile-nav .nav-link:hover,
.mobile-nav .nav-link:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.09);
}

.sidebar .nav-link.active,
.mobile-nav .nav-link.active {
    color: #ffffff;
    background: rgba(236, 235, 255, 0.16);
    box-shadow: inset 3px 0 0 #c4b5fd;
}

.sidebar .nav-link .bi,
.mobile-nav .nav-link .bi {
    color: #c4b5fd;
    font-size: 1rem;
}

.sidebar .nav-link.active .bi,
.mobile-nav .nav-link.active .bi {
    color: #f3e8ff;
}

.nav-divider {
    padding: 0.6rem 1rem 0.25rem;
}

.nav-divider hr {
    display: none;
}

.nav-divider small {
    color: #9486b8 !important;
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0;
    padding-left: 0 !important;
    text-transform: uppercase;
}

.sidebar-resizer {
    background: transparent;
}

.sidebar-resizer:hover {
    background: rgba(167, 139, 250, 0.55);
}

.mobile-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--ra-line);
    box-shadow: var(--ra-shadow-sm);
    backdrop-filter: blur(12px);
}

.mobile-menu-toggle,
.mobile-logout-btn {
    color: var(--ra-ink-soft);
    border: 1px solid var(--ra-line);
    background: var(--ra-surface);
}

.mobile-menu-toggle:hover,
.mobile-logout-btn:hover {
    color: var(--ra-primary);
    background: var(--ra-primary-soft);
}

.offcanvas {
    background: #170d29;
    color: #faf7ff;
    max-width: min(86vw, 320px);
}

.offcanvas-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.offcanvas-title {
    font-weight: 800;
}

.offcanvas .btn-close {
    filter: invert(1) grayscale(1);
    opacity: 0.8;
}

.bottom-nav {
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid var(--ra-line);
    box-shadow: 0 -10px 30px rgba(24, 35, 31, 0.11);
    backdrop-filter: blur(14px);
}

.bottom-nav-item {
    color: var(--ra-muted);
    border-radius: 7px;
}

.bottom-nav-item:hover,
.bottom-nav-item:focus {
    color: var(--ra-primary);
    background: var(--ra-primary-soft);
}

.dashboard-header {
    background: #6d28d9;
    color: #ffffff;
}

.dashboard-header h1,
.dashboard-header h2,
.dashboard-header h3,
.dashboard-header p,
.dashboard-header .business-title,
.dashboard-header .business-subtitle,
.dashboard-header .date-info,
.dashboard-header .health-status {
    color: #ffffff !important;
}

.dashboard-header .text-muted,
.dashboard-header small {
    color: rgba(255, 255, 255, 0.78) !important;
}

.metric-card {
    border-left-width: 0 !important;
}

.metric-icon,
.activity-icon {
    border-radius: 8px;
}

.login-page {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 1rem;
    background:
        linear-gradient(135deg, rgba(109, 40, 217, 0.12), rgba(192, 38, 211, 0.12)),
        var(--ra-surface-soft);
}

.login-panel {
    width: min(1120px, 100%);
    min-height: min(720px, calc(100dvh - 2rem));
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    overflow: hidden;
    background: var(--ra-surface);
    border: 1px solid var(--ra-line);
    border-radius: 8px;
    box-shadow: var(--ra-shadow-md);
}

.login-hero {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(2rem, 5vw, 4.25rem);
    color: #faf7ff;
    background:
        linear-gradient(145deg, rgba(26, 11, 46, 0.98), rgba(49, 24, 84, 0.96)),
        #170d29;
}

.login-brand-lockup {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.login-brand-mark {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f3e8ff;
    color: #26093d;
    font-size: 1.35rem;
}

.login-eyebrow {
    color: var(--ra-accent);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.login-hero .login-eyebrow {
    color: #f0abfc;
}

.login-hero h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(2rem, 4vw, 3.65rem);
    font-weight: 850;
    line-height: 1.02;
}

.login-lede {
    max-width: 620px;
    margin: auto 0 0;
    color: #ddd3ee;
    font-size: 1.12rem;
}

.login-proof-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.login-proof-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 58px;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #f3eefb;
    font-weight: 650;
}

.login-proof-item .bi {
    color: #f0abfc;
    font-size: 1.1rem;
}

.login-form-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
}

.login-card {
    width: min(100%, 440px);
    box-shadow: none !important;
}

.login-card .card-body {
    padding: clamp(1.5rem, 4vw, 2.4rem);
}

.login-card-heading {
    margin-bottom: 1.35rem;
}

.login-card h2 {
    margin: 0;
    color: var(--ra-ink);
    font-size: 1.75rem;
    font-weight: 820;
}

.login-form {
    margin-bottom: 1.25rem;
}

.demo-login-card {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
    border: 1px solid var(--ra-line);
    border-radius: 8px;
    background: var(--ra-surface-warm);
}

.demo-credentials {
    display: grid;
    gap: 0.4rem;
    color: var(--ra-ink-soft);
    font-size: 0.92rem;
}

.demo-credentials code {
    color: #86198f;
    background: rgba(192, 38, 211, 0.12);
    border-radius: 5px;
    padding: 0.12rem 0.32rem;
}

@media (max-width: 991.98px) {
    .login-panel {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .login-hero {
        padding: 1.5rem;
    }

    .login-proof-grid {
        grid-template-columns: 1fr;
    }

    .login-form-area {
        padding: 1rem;
    }

    .business-switcher {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .login-page {
        padding: 0;
        place-items: stretch;
    }

    .login-panel {
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .login-hero h1 {
        font-size: 2rem;
    }

    .demo-login-card .d-flex {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ===== RABBIT ACCOUNTS UNIFIED APP SYSTEM ===== */
:root {
    --ra-ink: #221833;
    --ra-ink-soft: #4a3f63;
    --ra-muted: #6f6589;
    --ra-line: #e9e3f2;
    --ra-line-strong: #d6cce6;
    --ra-surface: #ffffff;
    --ra-surface-soft: #f8f5fc;
    --ra-surface-tint: #f6efff;
    --ra-primary: #6d28d9;
    --ra-primary-hover: #4c1d95;
    --ra-primary-soft: #f3e8ff;
    --ra-accent: #c026d3;
    --ra-info: #087ea4;
    --ra-success: #1664c0;
    --ra-danger: #c4375f;
    --ra-warning: #b77910;
    --ra-focus: #2563eb;
    --ra-shadow-sm: 0 1px 2px rgba(26, 11, 46, 0.08);
    --ra-shadow-md: 0 16px 34px rgba(26, 11, 46, 0.12);
    --ra-radius: 8px;
    --ra-content-gap: 0.9rem;
}

html,
body {
    background:
        radial-gradient(circle at top left, rgba(109, 40, 217, 0.06), transparent 34rem),
        linear-gradient(180deg, #faf7fd 0%, #f4f0f9 100%);
    color: var(--ra-ink);
}

.content {
    padding: clamp(0.8rem, 1.2vw, 1.15rem);
    background: transparent;
    min-width: 0;
}

.app-shell main {
    min-width: 0;
    max-width: 100%;
}

.route-shell-stage,
.route-shell-stage > *,
.route-shell-stage .container-fluid,
.route-shell-stage .ra-page,
.route-shell-stage .ra-workbench {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.route-shell-stage .ra-page-header,
.route-shell-stage .ra-workbench-panel,
.route-shell-stage .ra-grid-card,
.route-shell-stage .ra-data-card {
    min-width: 0;
    max-width: 100%;
}

.container-fluid {
    max-width: 100%;
    padding-left: clamp(0.55rem, 1vw, 0.9rem);
    padding-right: clamp(0.55rem, 1vw, 0.9rem);
}

.app-topbar {
    min-height: 64px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--ra-line);
    box-shadow: var(--ra-shadow-sm);
}

.app-topbar .brand {
    min-width: 0;
    max-width: min(44vw, 520px);
    padding: 0.42rem 0.72rem;
    border: 1px solid var(--ra-line);
    border-radius: var(--ra-radius);
    background: var(--ra-surface);
    box-shadow: var(--ra-shadow-sm);
}

.business-name,
.mobile-brand-subtle {
    color: var(--ra-ink) !important;
    font-weight: 760;
    line-height: 1.2;
}

.business-switcher {
    width: min(280px, 30vw);
}

.sidebar,
.offcanvas {
    background: linear-gradient(180deg, #170d29 0%, #231345 54%, #321137 100%);
    box-shadow: 12px 0 34px rgba(26, 11, 46, 0.2);
}

.brand-icon {
    color: #26093d;
    background: linear-gradient(135deg, #e879f9, #f0abfc);
}

.login-hero {
    background:
        radial-gradient(circle at 18% 14%, rgba(240, 171, 252, 0.2), transparent 24rem),
        linear-gradient(145deg, rgba(22, 13, 38, 0.98), rgba(50, 17, 55, 0.96)),
        #170d29;
}

.login-brand-mark {
    color: #26093d;
    background: linear-gradient(135deg, #e879f9, #f0abfc);
}

.login-hero .login-eyebrow,
.login-proof-item .bi {
    color: #e879f9;
}

.login-proof-item {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.14);
}

.sidebar .nav-link .bi,
.mobile-nav .nav-link .bi {
    color: #c4b5fd;
}

.sidebar .nav-link:hover,
.sidebar .nav-link:focus,
.mobile-nav .nav-link:hover,
.mobile-nav .nav-link:focus {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active,
.mobile-nav .nav-link.active {
    background: rgba(167, 139, 250, 0.18);
    box-shadow: inset 3px 0 0 #e879f9;
}

.sidebar .nav-link.active .bi,
.mobile-nav .nav-link.active .bi {
    color: #e879f9;
}

.btn {
    border-radius: 7px;
    min-height: 40px;
}

.btn-primary,
.btn-success {
    background-color: var(--ra-primary);
    border-color: var(--ra-primary);
    box-shadow: 0 8px 18px rgba(109, 40, 217, 0.18);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus {
    background-color: var(--ra-primary-hover);
    border-color: var(--ra-primary-hover);
}

.btn-info {
    color: #fff;
    background-color: var(--ra-info);
    border-color: var(--ra-info);
}

.btn-outline-primary,
.btn-outline-success,
.btn-outline-info {
    color: var(--ra-primary);
    border-color: rgba(109, 40, 217, 0.45);
    background: #fff;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-info:hover,
.btn-outline-info:focus {
    color: #fff;
    background: var(--ra-primary);
    border-color: var(--ra-primary);
}

.text-primary,
.text-success,
.text-info {
    color: var(--ra-success) !important;
}

.text-warning {
    color: var(--ra-warning) !important;
}

.text-danger {
    color: var(--ra-danger) !important;
}

.bg-primary,
.bg-success,
.bg-info {
    background-color: var(--ra-primary) !important;
}

.bg-warning {
    background-color: #f6c453 !important;
}

.bg-danger {
    background-color: var(--ra-danger) !important;
}

.border-primary,
.border-success,
.border-info {
    border-color: rgba(109, 40, 217, 0.42) !important;
}

.border-warning {
    border-color: rgba(192, 38, 211, 0.42) !important;
}

.border-danger {
    border-color: rgba(196, 55, 95, 0.42) !important;
}

.card,
.modal-content,
.chart-container,
.activity-item {
    border: 1px solid var(--ra-line) !important;
    border-radius: var(--ra-radius);
    box-shadow: var(--ra-shadow-sm) !important;
}

.card-header,
.card-header.bg-primary,
.card-header.text-white {
    color: var(--ra-ink) !important;
    background: linear-gradient(180deg, #fcfaff, var(--ra-surface-soft)) !important;
    border-bottom: 1px solid var(--ra-line) !important;
}

.card-body {
    padding: 1rem;
}

.table {
    margin-bottom: 0;
    color: var(--ra-ink);
}

.table th,
.table-dark th,
.table-light th,
thead.table-dark th,
thead.table-light th {
    color: var(--ra-ink-soft) !important;
    background: var(--ra-surface-soft) !important;
    border-bottom: 1px solid var(--ra-line-strong) !important;
    font-size: 0.73rem;
    font-weight: 780;
    letter-spacing: 0;
    text-transform: uppercase;
}

.table td {
    vertical-align: middle;
    border-color: var(--ra-line);
}

.table-responsive {
    border: 1px solid var(--ra-line);
    border-radius: var(--ra-radius);
}

.badge {
    border-radius: 999px;
    font-weight: 720;
}

.ra-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--ra-content-gap);
    min-width: 0;
    max-width: 100%;
}

.ra-page > *,
.ra-workbench > *,
.route-shell-stage .container-fluid > * {
    min-width: 0;
    max-width: 100%;
}

.ra-entity-page {
    gap: 0.55rem;
}

.ra-entity-page > .row,
.ra-entity-page > .row.mb-3 {
    margin-bottom: 0.5rem !important;
}

.ra-page .row,
.ra-page [class^="col-"],
.ra-page [class*=" col-"] {
    min-width: 0;
}

.ra-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--ra-line);
    border-radius: var(--ra-radius);
    background: linear-gradient(135deg, #ffffff 0%, #faf6ff 100%);
    box-shadow: var(--ra-shadow-sm);
    min-width: 0;
    max-width: 100%;
}

.ra-page-header > * {
    min-width: 0;
}

.ra-page-header h1,
.ra-page-header h2,
.ra-page-header h3 {
    margin: 0;
    color: var(--ra-ink);
    font-size: clamp(1.28rem, 1.7vw, 1.72rem);
    font-weight: 820;
    letter-spacing: 0;
}

.ra-page-header p {
    max-width: 760px;
    margin: 0.22rem 0 0;
    color: var(--ra-muted);
    overflow-wrap: anywhere;
}

.ra-page-kicker {
    margin: 0 0 0.18rem !important;
    color: var(--ra-accent) !important;
    font-size: 0.7rem;
    font-weight: 820;
    letter-spacing: 0;
    text-transform: uppercase;
}

.ra-page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    min-width: 0;
}

.ra-page-actions.btn-group,
.ra-page-actions .btn-group {
    gap: 0.35rem;
}

.ra-page-actions.btn-group > .btn,
.ra-page-actions .btn-group > .btn {
    border-radius: 7px !important;
}

.ra-entity-page .ra-page-header {
    align-items: center;
    padding: 0.68rem 0.8rem;
}

.ra-entity-page .ra-page-header h1,
.ra-entity-page .ra-page-header h2,
.ra-entity-page .ra-page-header h3 {
    font-size: clamp(1.14rem, 1.35vw, 1.42rem);
}

.ra-entity-page .ra-page-header p:not(.ra-page-kicker) {
    max-width: 44rem;
    margin-top: 0.12rem;
    font-size: 0.82rem;
    line-height: 1.25;
}

.ra-entity-page .ra-page-actions {
    gap: 0.4rem;
}

.ra-entity-page .ra-page-actions .btn,
.ra-entity-page .ra-page-actions.btn-group .btn {
    min-height: 2.28rem;
    padding: 0.38rem 0.62rem;
    font-size: 0.86rem;
}

.ra-filter-panel {
    margin-bottom: 0.9rem !important;
}

.ra-filter-panel .card-header {
    padding: 0.65rem 0.85rem;
}

.ra-filter-panel .card-body {
    padding: 0.85rem;
}

.ra-filter-field .form-label {
    margin-bottom: 0.32rem;
    font-size: 0.78rem;
}

.ra-inline-filter-panel {
    margin-left: 0;
    margin-right: 0;
    padding: 0.85rem !important;
    border: 1px solid var(--ra-line);
    border-radius: var(--ra-radius);
    background: var(--ra-surface);
}

.ra-summary-grid,
.ra-compact-summary {
    margin-left: 0;
    margin-right: 0;
}

.ra-summary-card .card-body {
    padding: 0.82rem 0.9rem;
}

.ra-summary-card h3 {
    font-size: clamp(1.2rem, 1.7vw, 1.55rem);
}

.ra-compact-summary {
    align-items: center;
    border: 1px solid var(--ra-line);
    border-radius: var(--ra-radius) !important;
    background: #fff !important;
}

.ra-data-card .card-header {
    padding: 0.72rem 0.9rem;
}

.ra-data-card .card-body {
    padding: 0.9rem;
}

.dashboard-header,
.ra-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 0.85rem;
    padding: 0.95rem 1rem;
    color: var(--ra-ink);
    background:
        linear-gradient(135deg, rgba(109, 40, 217, 0.12), rgba(232, 121, 249, 0.22)),
        #ffffff;
    border: 1px solid var(--ra-line);
    border-radius: var(--ra-radius);
    box-shadow: var(--ra-shadow-sm);
    overflow: visible;
}

.dashboard-header h1,
.dashboard-header h2,
.dashboard-header h3,
.dashboard-header p,
.dashboard-header .business-title,
.dashboard-header .business-subtitle,
.dashboard-header .date-info,
.dashboard-header .health-status,
.dashboard-header .business-name {
    color: var(--ra-ink) !important;
}

.dashboard-header .business-name-logo {
    min-width: 0;
    padding: 0.3rem 0.45rem;
}

.dashboard-header .business-name {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: clamp(1.25rem, 1.8vw, 1.7rem);
    font-weight: 840;
}

.dashboard-header .business-subtitle,
.dashboard-header .text-muted,
.dashboard-header small {
    color: var(--ra-muted) !important;
}

.business-health-indicator {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
}

.health-status,
.date-info {
    min-height: 36px;
    padding: 0.42rem 0.62rem;
    border: 1px solid rgba(109, 40, 217, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
}

.health-good {
    color: var(--ra-success) !important;
}

.dashboard-period-card .card-body {
    padding: 0.72rem 0.82rem;
}

.dashboard-period-filter {
    display: grid;
    grid-template-columns: auto minmax(11rem, 14rem) minmax(24rem, 31rem);
    align-items: center;
    gap: 0.65rem;
}

.dashboard-period-filter .form-label {
    white-space: nowrap;
}

.dashboard-preset-select,
.dashboard-date-input {
    min-height: 42px;
}

.dashboard-date-range {
    width: 100%;
    flex-wrap: nowrap;
}

.dashboard-date-range .input-group-text {
    border-color: var(--ra-line-strong);
    background: var(--ra-surface-soft);
    color: var(--ra-muted);
}

.dashboard-date-input {
    min-width: 10.6rem;
}

.metrics-section,
.charts-section,
.activity-section {
    margin-right: 0 !important;
    margin-bottom: 1rem;
}

.section-title {
    margin: 0 0 0.58rem;
    padding: 0;
    color: var(--ra-ink);
    font-size: 1.05rem;
    font-weight: 820;
}

.metrics-section .row {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
}

.metrics-section .card-body {
    padding: 0.82rem 0.88rem;
}

.metrics-section .card h3 {
    font-size: clamp(1.24rem, 1.8vw, 1.58rem);
    line-height: 1.05;
}

.metrics-section .bi[style*="font-size: 2rem"] {
    font-size: 1.42rem !important;
}

.charts-section .row {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
}

.activity-section {
    margin-bottom: 1rem;
}

.activity-feed {
    padding: 0;
}

.activity-item {
    margin-bottom: 0.55rem;
    padding: 0.72rem 0.82rem;
}

@media (min-width: 1024px) {
    .dashboard-header {
        margin: 0 0 0.85rem !important;
        padding: 0.95rem 1rem !important;
    }
}

@media (max-width: 991.98px) {
    .content {
        padding: 0.75rem 0.65rem 5.5rem;
    }

    .app-topbar .brand {
        max-width: 100%;
    }

    .ra-page-header,
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .ra-page-actions {
        justify-content: flex-start;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .ra-page-actions .btn,
    .ra-page-actions.btn-group .btn {
        width: 100%;
        white-space: normal;
    }

    .dashboard-period-filter {
        grid-template-columns: 1fr;
    }

    .dashboard-date-range {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    }

    .dashboard-date-input {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .ra-page-header,
    .dashboard-header {
        padding: 0.8rem;
    }

    .ra-page-actions .btn,
    .ra-page-actions.btn-group .btn {
        width: 100%;
    }

    .dashboard-date-range {
        grid-template-columns: 1fr;
    }

    .dashboard-date-range > .form-control,
    .dashboard-date-range > .input-group-text {
        width: 100%;
        min-width: 100%;
        flex: 0 0 auto;
    }

    .dashboard-date-range .input-group-text {
        justify-content: center;
        border-left: 1px solid var(--ra-line-strong);
        border-right: 1px solid var(--ra-line-strong);
    }
}

/* ===== RABBIT ACCOUNTS WORKBENCH SYSTEM ===== */
.ra-workbench {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ra-workbench-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--ra-line);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(109, 40, 217, 0.09), rgba(192, 38, 211, 0.08)),
        #fff;
    box-shadow: var(--ra-shadow-sm);
    padding: 0.9rem 1rem;
}

.ra-workbench-heading {
    min-width: 0;
}

.ra-workbench-heading h1 {
    margin: 0;
    color: var(--ra-ink);
    font-size: clamp(1.55rem, 2vw, 2.15rem);
    font-weight: 850;
    letter-spacing: 0;
}

.ra-workbench-heading p {
    max-width: 48rem;
    margin: 0.2rem 0 0;
    color: var(--ra-muted);
    font-size: 0.94rem;
}

.ra-crumbs {
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
}

.ra-crumbs a {
    color: var(--ra-primary);
    text-decoration: none;
}

.ra-workbench-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.ra-workbench-panel {
    border: 1px solid var(--ra-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--ra-shadow-sm);
    padding: 0.75rem;
}

.ra-metric-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.65rem;
}

.ra-metric-pill {
    border: 1px solid rgba(109, 40, 217, 0.16);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #faf6ff);
    padding: 0.58rem 0.7rem;
    min-width: 0;
}

.ra-metric-pill small {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--ra-muted);
    font-size: 0.74rem;
    font-weight: 750;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.ra-metric-pill span {
    display: block;
    overflow: hidden;
    color: var(--ra-ink);
    font-size: 1rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ra-metric-pill.is-alert {
    border-color: rgba(244, 63, 94, 0.2);
    background: linear-gradient(180deg, #fff, #fff1f2);
}

.ra-metric-pill.is-alert span {
    color: var(--ra-danger);
}

.ra-command-bar {
    display: grid;
    grid-template-columns: minmax(16rem, 1.2fr) minmax(10rem, 0.6fr) minmax(10rem, 0.6fr) auto auto;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.ra-directory-panel {
    margin-bottom: 0.75rem;
}

.ra-directory-metrics {
    margin-bottom: 0.65rem;
}

.ra-directory-command {
    grid-template-columns: minmax(16rem, 1.2fr) repeat(auto-fit, minmax(8.75rem, 1fr));
    margin-bottom: 0;
}

.ra-search-box {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    margin: 0;
}

.ra-search-box .bi {
    position: absolute;
    left: 0.75rem;
    z-index: 1;
    color: var(--ra-muted);
}

.ra-search-box .form-control {
    height: 2.45rem;
    padding-left: 2.15rem;
}

.ra-compact-select,
.ra-clear-filter {
    height: 2.45rem;
}

.ra-date-input {
    min-height: 2.45rem;
    border-radius: 8px;
    font-weight: 650;
}

.ra-date-field {
    display: grid;
    gap: 0.18rem;
    min-width: 9.5rem;
}

.ra-date-field span {
    color: var(--ra-muted);
    font-size: 0.68rem;
    font-weight: 820;
    line-height: 1;
    text-transform: uppercase;
}

.ra-command-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    align-self: center;
    min-width: max-content;
}

.ra-command-actions .btn {
    white-space: nowrap;
}

.ra-command-note,
.ra-command-note-inline {
    color: var(--ra-muted);
    font-size: 0.78rem;
    line-height: 1.35;
}

.ra-command-note {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px dashed var(--ra-line);
}

.ra-command-note-inline {
    align-self: center;
    justify-self: end;
    white-space: nowrap;
}

.ra-mini-metric-row,
.ra-report-tabs,
.ra-report-insight-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.ra-mini-metric-row {
    margin-bottom: 0.65rem;
    color: var(--ra-muted);
    font-size: 0.82rem;
}

.ra-mini-metric-row span,
.ra-report-insight-strip {
    border: 1px solid var(--ra-line);
    border-radius: 999px;
    background: #fff;
    padding: 0.32rem 0.62rem;
}

.ra-mini-metric-row strong {
    color: var(--ra-ink);
}

.ra-report-tabs {
    margin-bottom: 0.65rem;
}

.ra-report-tabs .btn {
    min-height: 38px;
    border-radius: 8px !important;
    font-weight: 750;
}

.ra-report-command,
.ra-statements-command {
    grid-template-columns: minmax(10rem, 0.9fr) minmax(9rem, 0.7fr) repeat(2, minmax(9.5rem, 0.75fr)) auto;
}

.ra-journal-command {
    grid-template-columns: repeat(2, minmax(9.5rem, 0.55fr)) minmax(9.5rem, 0.55fr) auto;
}

.ra-template-command,
.ra-period-command {
    grid-template-columns: minmax(10rem, 14rem) auto minmax(16rem, 1fr);
    justify-content: start;
}

.ra-transfer-command {
    grid-template-columns: repeat(2, minmax(9.5rem, 0.55fr)) minmax(9.5rem, 0.55fr) auto;
}

.ra-reconciliation-command {
    grid-template-columns: minmax(18rem, 0.9fr) auto minmax(18rem, 1fr);
    justify-content: start;
}

.collection-rules-command {
    grid-template-columns: minmax(12rem, 16rem) auto;
    justify-content: start;
}

.ra-report-insight-strip {
    margin-bottom: 0.75rem;
    border-radius: 10px;
    color: var(--ra-muted);
}

.ra-report-insight-strip strong {
    color: var(--ra-ink);
}

.ra-flow-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.65rem;
}

.ra-flow-steps-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ra-flow-step,
.ra-review-note {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    border: 1px solid var(--ra-line);
    border-radius: 12px;
    background: #fff;
    padding: 0.68rem 0.75rem;
}

.ra-flow-step > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    border-radius: 999px;
    background: var(--ra-surface-muted);
    color: var(--ra-ink-soft);
    font-weight: 850;
}

.ra-flow-step strong,
.ra-review-note strong {
    display: block;
    color: var(--ra-ink);
    font-size: 0.85rem;
    line-height: 1.15;
}

.ra-flow-step small,
.ra-review-note span {
    display: block;
    color: var(--ra-muted);
    font-size: 0.78rem;
    line-height: 1.25;
}

.ra-flow-step.is-current {
    border-color: rgba(109, 40, 217, 0.26);
    background: linear-gradient(180deg, #fff, #faf6ff);
}

.ra-flow-step.is-current > span,
.ra-flow-step.is-done > span {
    background: var(--ra-primary);
    color: #fff;
}

.ra-review-grid,
.ra-reconciliation-grid {
    display: grid;
    gap: 0.75rem;
}

.ra-review-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ra-reconciliation-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.ra-truncate-cell {
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 992px) {
    .ra-flow-steps,
    .ra-review-grid,
    .ra-reconciliation-grid {
        grid-template-columns: 1fr;
    }

    .ra-reconciliation-command,
    .ra-transfer-command {
        grid-template-columns: 1fr;
    }
}

.ra-report-workbench {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding-bottom: 1.25rem;
}

.ra-report-workbench > .d-flex.justify-content-between,
.ra-report-workbench > .d-flex.justify-content-between.align-items-center,
.ra-report-workbench > .d-flex.justify-content-between.align-items-end {
    align-items: flex-end !important;
    gap: 1rem;
    margin-bottom: 0 !important;
    padding: 0.9rem 1rem;
    border: 1px solid var(--ra-line);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(109, 40, 217, 0.08), rgba(192, 38, 211, 0.06)),
        #fff;
    box-shadow: var(--ra-shadow-sm);
}

.ra-report-workbench > .d-flex.justify-content-between > div:last-child,
.ra-report-workbench > .d-flex.justify-content-between.align-items-center > div:last-child,
.ra-report-workbench > .d-flex.justify-content-between.align-items-end > div:last-child {
    min-width: max-content;
}

.ra-report-workbench > .d-flex.justify-content-between > div:first-child {
    min-width: 0;
}

.ra-report-workbench > .d-flex.justify-content-between h2 {
    margin: 0.2rem 0 0;
    color: var(--ra-ink);
    font-size: clamp(1.45rem, 1.8vw, 2rem);
    font-weight: 850;
    letter-spacing: 0;
}

.ra-report-workbench > .d-flex.justify-content-between .breadcrumb {
    margin: 0.15rem 0 0;
    font-size: 0.8rem;
}

.ra-report-workbench > .d-flex.justify-content-between .breadcrumb a {
    color: var(--ra-muted);
    font-weight: 700;
    text-decoration: none;
}

.ra-report-workbench > .d-flex.justify-content-between .breadcrumb .active {
    color: var(--ra-accent);
    font-weight: 820;
}

.ra-report-workbench > .d-flex.justify-content-between .d-flex.gap-2 {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ra-report-workbench > .card,
.ra-report-workbench .row > [class*="col-"] > .card {
    border: 1px solid var(--ra-line);
    border-radius: 16px;
    box-shadow: var(--ra-shadow-sm);
    overflow: hidden;
}

.ra-report-workbench .card-header {
    background: linear-gradient(180deg, #fff, #fbfaff);
    border-bottom: 1px solid var(--ra-line);
}

.ra-report-workbench > .card:first-of-type .card-body .row {
    align-items: end;
}

.ra-report-workbench .row.mb-4 > [class*="col-"] > .card {
    height: 100%;
    border-color: rgba(109, 40, 217, 0.14) !important;
    background: linear-gradient(180deg, #fff, #fbfaff) !important;
    color: var(--ra-ink) !important;
}

.ra-report-workbench .row.mb-4 > [class*="col-"] > .card .card-body {
    padding: 0.75rem 0.82rem;
}

.ra-report-workbench .row.mb-4 > [class*="col-"] > .card h3,
.ra-report-workbench .row.mb-4 > [class*="col-"] > .card h4 {
    color: var(--ra-ink) !important;
    font-weight: 820;
    font-variant-numeric: tabular-nums;
}

.ra-report-workbench .row.mb-4 > [class*="col-"] > .card .card-title,
.ra-report-workbench .row.mb-4 > [class*="col-"] > .card small {
    color: var(--ra-muted) !important;
}

.ra-report-workbench .row.mb-4 > [class*="col-"] > .card .bi,
.ra-report-workbench .row.mb-4 > [class*="col-"] > .card .fas,
.ra-report-workbench .row.mb-4 > [class*="col-"] > .card .fa {
    color: var(--ra-primary) !important;
    opacity: 0.75;
}

.ra-report-workbench .card-header.bg-primary,
.ra-report-workbench .card-header.bg-success,
.ra-report-workbench .card-header.bg-info,
.ra-report-workbench .card-header.bg-warning,
.ra-report-workbench .card-header.bg-danger,
.ra-report-workbench .card-header.bg-dark {
    background: linear-gradient(180deg, #fcfaff, #f8f5fc) !important;
    color: var(--ra-ink) !important;
}

.ra-report-workbench .card[class*="bg-"],
.ra-report-workbench .card.text-white {
    border-color: rgba(32, 80, 92, 0.13) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 252, 251, 0.96)),
        #fff !important;
    color: var(--ra-ink) !important;
    box-shadow: inset 3px 0 0 rgba(32, 120, 108, 0.2);
}

.ra-report-workbench .card[class*="bg-"] h1,
.ra-report-workbench .card[class*="bg-"] h2,
.ra-report-workbench .card[class*="bg-"] h3,
.ra-report-workbench .card[class*="bg-"] h4,
.ra-report-workbench .card[class*="bg-"] h5,
.ra-report-workbench .card[class*="bg-"] h6,
.ra-report-workbench .card[class*="bg-"] small,
.ra-report-workbench .card.text-white h1,
.ra-report-workbench .card.text-white h2,
.ra-report-workbench .card.text-white h3,
.ra-report-workbench .card.text-white h4,
.ra-report-workbench .card.text-white h5,
.ra-report-workbench .card.text-white h6,
.ra-report-workbench .card.text-white small {
    color: inherit !important;
}

.ra-report-workbench .table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.ra-report-workbench .table thead th {
    border-bottom: 1px solid var(--ra-line);
    color: var(--ra-muted);
    font-size: 0.74rem;
    font-weight: 820;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
}

.ra-report-workbench .table-dark {
    --bs-table-bg: #f7f5fb;
    --bs-table-color: var(--ra-ink);
    --bs-table-border-color: var(--ra-line);
    color: var(--ra-ink);
}

.ra-report-workbench .table tfoot.table-dark,
.ra-report-workbench .table tr.table-dark {
    --bs-table-bg: #f7f5fb;
    --bs-table-color: var(--ra-ink);
    color: var(--ra-ink);
}

.ra-report-workbench .table-responsive {
    border: 1px solid rgba(24, 34, 52, 0.08);
    border-radius: 12px;
}

.ra-report-workbench .table-primary,
.ra-report-workbench .table-success,
.ra-report-workbench .table-info,
.ra-report-workbench .table-warning,
.ra-report-workbench .table-danger,
.ra-report-workbench .table-active {
    --bs-table-bg: #fbfaff;
    --bs-table-color: var(--ra-ink);
}

.ra-report-workbench > .card .card-body > .table-responsive,
.ra-report-workbench .row > [class*="col-"] > .card .card-body > .table-responsive {
    max-height: max(18rem, calc(100dvh - 24rem));
    overflow: auto;
}

.ra-report-workbench .card-body > .table-responsive .table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8f5fc;
}

.ra-report-workbench .badge.bg-primary,
.ra-report-workbench .badge.bg-info,
.ra-report-workbench .badge.bg-secondary,
.ra-report-workbench .badge.bg-dark {
    background: var(--ra-primary-soft) !important;
    color: var(--ra-primary-active) !important;
}

.ra-report-workbench .badge.bg-success {
    background: #ecfdf3 !important;
    color: #157347 !important;
}

.ra-report-workbench .badge.bg-warning {
    background: #fef6e7 !important;
    color: #99571a !important;
}

.ra-report-workbench .badge.bg-danger {
    background: #feebef !important;
    color: #b4233f !important;
}

.ra-report-workbench .progress {
    height: 0.9rem !important;
    min-width: 7.5rem;
    overflow: hidden;
    border-radius: 999px;
    background: #ede7f6;
    box-shadow: inset 0 0 0 1px rgba(109, 40, 217, 0.08);
}

.ra-report-workbench .progress-bar {
    color: var(--ra-ink);
    font-size: 0.68rem;
    font-weight: 800;
}

.ra-report-workbench .input-group-text {
    border-color: var(--ra-line);
    background: #fbfaff;
    color: var(--ra-muted);
}

.ra-report-workbench .text-center.py-5 {
    border: 1px dashed rgba(109, 40, 217, 0.22);
    border-radius: 14px;
    background: linear-gradient(180deg, #fff, #fbfaff);
}

.ra-legacy-workbench {
    gap: 0.85rem;
}

.ra-legacy-workbench > .d-flex.justify-content-between,
.ra-legacy-workbench > .d-flex.align-items-center,
.ra-legacy-workbench > .row:first-child {
    margin-bottom: 0 !important;
}

.ra-legacy-workbench > .d-flex.justify-content-between,
.ra-legacy-workbench > .d-flex.justify-content-between.align-items-center,
.ra-legacy-workbench > .d-flex.justify-content-between.align-items-end {
    align-items: flex-end !important;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--ra-line);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(109, 40, 217, 0.075), rgba(192, 38, 211, 0.055)),
        #fff;
    box-shadow: var(--ra-shadow-sm);
}

.ra-legacy-workbench h1,
.ra-legacy-workbench h2,
.ra-legacy-workbench h3 {
    color: var(--ra-ink);
    font-weight: 820;
    letter-spacing: 0;
}

.ra-legacy-workbench > .d-flex.justify-content-between h1,
.ra-legacy-workbench > .d-flex.justify-content-between h2,
.ra-legacy-workbench > .d-flex.justify-content-between h3 {
    margin-bottom: 0.15rem;
    font-size: clamp(1.45rem, 1.8vw, 2rem);
    font-weight: 850;
}

.ra-legacy-workbench > .row.mb-4,
.ra-legacy-workbench > .row.g-3.mb-4,
.ra-legacy-workbench > .row.g-4.mb-4 {
    margin-bottom: 0 !important;
}

.ra-legacy-workbench .card {
    overflow: hidden;
}

.ra-legacy-workbench .card-header {
    background: linear-gradient(180deg, #fff, #fbfaff);
}

.ra-legacy-workbench .card-header.bg-primary,
.ra-legacy-workbench .card-header.bg-success,
.ra-legacy-workbench .card-header.bg-info,
.ra-legacy-workbench .card-header.bg-warning,
.ra-legacy-workbench .card-header.bg-danger,
.ra-legacy-workbench .card-header.bg-dark {
    border-bottom-color: rgba(32, 80, 92, 0.12) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 249, 0.96)),
        #fff !important;
    color: var(--ra-ink) !important;
}

.ra-legacy-workbench .card[class*="bg-"],
.ra-legacy-workbench .card.text-white {
    border-color: rgba(32, 80, 92, 0.13) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 252, 251, 0.96)),
        #fff !important;
    color: var(--ra-ink) !important;
    box-shadow: inset 3px 0 0 rgba(32, 120, 108, 0.2);
}

.ra-legacy-workbench .card[class*="bg-"] h1,
.ra-legacy-workbench .card[class*="bg-"] h2,
.ra-legacy-workbench .card[class*="bg-"] h3,
.ra-legacy-workbench .card[class*="bg-"] h4,
.ra-legacy-workbench .card[class*="bg-"] h5,
.ra-legacy-workbench .card[class*="bg-"] h6,
.ra-legacy-workbench .card[class*="bg-"] small,
.ra-legacy-workbench .card.text-white h1,
.ra-legacy-workbench .card.text-white h2,
.ra-legacy-workbench .card.text-white h3,
.ra-legacy-workbench .card.text-white h4,
.ra-legacy-workbench .card.text-white h5,
.ra-legacy-workbench .card.text-white h6,
.ra-legacy-workbench .card.text-white small {
    color: inherit !important;
}

.ra-legacy-workbench .row.mb-4 > [class*="col-"] > .card,
.ra-legacy-workbench .row.g-3.mb-4 > [class*="col-"] > .card,
.ra-legacy-workbench .row.g-4.mb-4 > [class*="col-"] > .card {
    height: 100%;
    border-color: rgba(109, 40, 217, 0.14) !important;
    background: linear-gradient(180deg, #fff, #fbfaff) !important;
    color: var(--ra-ink) !important;
}

.ra-legacy-workbench .row.mb-4 > [class*="col-"] > .card h3,
.ra-legacy-workbench .row.mb-4 > [class*="col-"] > .card h4,
.ra-legacy-workbench .row.g-3.mb-4 > [class*="col-"] > .card h3,
.ra-legacy-workbench .row.g-3.mb-4 > [class*="col-"] > .card h4,
.ra-legacy-workbench .row.g-4.mb-4 > [class*="col-"] > .card h3,
.ra-legacy-workbench .row.g-4.mb-4 > [class*="col-"] > .card h4 {
    color: var(--ra-ink) !important;
    font-weight: 820;
    font-variant-numeric: tabular-nums;
}

.ra-legacy-workbench .row.mb-4 > [class*="col-"] > .card small,
.ra-legacy-workbench .row.g-3.mb-4 > [class*="col-"] > .card small,
.ra-legacy-workbench .row.g-4.mb-4 > [class*="col-"] > .card small,
.ra-legacy-workbench .card-title,
.ra-legacy-workbench .card-subtitle {
    color: var(--ra-muted) !important;
}

.ra-legacy-workbench .table thead th {
    white-space: nowrap;
}

.ra-legacy-workbench .table-primary,
.ra-legacy-workbench .table-success,
.ra-legacy-workbench .table-info,
.ra-legacy-workbench .table-warning,
.ra-legacy-workbench .table-danger,
.ra-legacy-workbench .table-active {
    --bs-table-bg: #fbfaff;
    --bs-table-color: var(--ra-ink);
}

.ra-aging-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
}

.ra-aging-bucket {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
    padding: 0.72rem 0.78rem;
    border: 1px solid var(--ra-line);
    border-left: 4px solid var(--ra-primary);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #fbfaff);
}

.ra-aging-bucket small {
    color: var(--ra-muted);
    font-size: 0.72rem;
    font-weight: 820;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.ra-aging-bucket span {
    overflow: hidden;
    color: var(--ra-ink);
    font-size: 1.06rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ra-aging-bucket em {
    color: var(--ra-muted);
    font-size: 0.78rem;
    font-style: normal;
}

.ra-aging-bucket.is-watch {
    border-left-color: #b7791f;
}

.ra-aging-bucket.is-risk,
.ra-aging-bucket.is-critical {
    border-left-color: var(--ra-danger);
}

.ra-advanced-filter {
    position: relative;
}

.ra-advanced-filter summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 2.45rem;
    min-width: 6.75rem;
    border: 1px solid var(--ra-line-strong);
    border-radius: 0.6rem;
    background: #fff;
    color: var(--ra-ink);
    cursor: pointer;
    font-weight: 750;
    list-style: none;
    padding-inline: 0.85rem;
}

.ra-advanced-filter summary::-webkit-details-marker {
    display: none;
}

.ra-advanced-filter-body {
    position: absolute;
    right: 0;
    z-index: 20;
    width: min(32rem, calc(100vw - 2rem));
    margin-top: 0.45rem;
    border: 1px solid var(--ra-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--ra-shadow-md);
    padding: 0.75rem;
}

.ra-grid-card {
    overflow: hidden;
    border: 1px solid var(--ra-line);
    border-radius: 14px;
    background: #fff;
}

.ra-grid-card .card-body {
    padding: 0.75rem;
}

.ra-grid-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--ra-line);
    background: linear-gradient(180deg, #fff, #f8f5fc);
    padding: 0.65rem 0.85rem;
}

.ra-grid-card-header h2 {
    margin: 0;
    color: var(--ra-ink);
    font-size: 1rem;
    font-weight: 850;
}

.ra-grid-card-header p {
    margin: 0.15rem 0 0;
    color: var(--ra-muted);
    font-size: 0.8rem;
}

.ra-grid-count {
    flex: 0 0 auto;
    border: 1px solid rgba(244, 63, 94, 0.16);
    border-radius: 999px;
    background: #fff1f2;
    color: var(--ra-danger);
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.3rem 0.65rem;
}

.ra-grid-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.ra-grid-actions .btn {
    width: auto !important;
    min-width: 5.5rem;
    padding-inline: 0.7rem !important;
}

.ra-grid-scroll {
    max-height: max(24rem, calc(100dvh - 24rem));
    overflow: auto;
}

.ra-density-table {
    margin-bottom: 0;
}

.ra-density-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 1px solid var(--ra-line-strong);
    background: #f8f5fc;
    color: var(--ra-muted);
    font-size: 0.74rem;
    font-weight: 850;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.ra-density-table td {
    border-color: var(--ra-line);
}

.ra-view-toggle {
    flex-wrap: nowrap;
}

.ra-view-toggle .btn {
    min-height: 2.45rem;
    white-space: nowrap;
}

.ra-density-table .btn-group > .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    width: 2rem;
    min-width: 2rem;
    padding-inline: 0;
    font-size: 0;
    line-height: 1;
}

.ra-density-table .btn-group > .btn i {
    margin-right: 0 !important;
    font-size: 0.95rem;
}

.ra-inline-empty {
    border-top: 1px solid var(--ra-line);
    padding: 2rem 1rem;
    text-align: center;
}

.sales-workbench .sales-orders-table td {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
    vertical-align: middle;
}

.sales-workbench .sales-note {
    max-width: 16rem;
}

.sales-workbench .text-success {
    color: var(--ra-primary) !important;
}

.sales-workbench .badge.bg-success {
    background: var(--ra-primary) !important;
}

/* Legacy live fallback: compact the pre-workbench Sales page if IIS serves an older assembly. */
.container-fluid > .ra-filter-panel:has(+ .card .sales-orders-table) {
    overflow: visible;
    margin-bottom: 0.55rem;
    border-radius: 12px;
    box-shadow: var(--ra-shadow-sm);
}

.container-fluid > .ra-filter-panel:has(+ .card .sales-orders-table) .card-header {
    min-height: 0;
    border-bottom: 0;
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.08), rgba(192, 38, 211, 0.07));
    padding: 0.5rem 0.75rem;
}

.container-fluid > .ra-filter-panel:has(+ .card .sales-orders-table) .card-header h5,
.container-fluid > .ra-filter-panel:has(+ .card .sales-orders-table) .card-header h6 {
    margin: 0;
    font-size: 0.9rem;
}

.container-fluid > .ra-filter-panel:has(+ .card .sales-orders-table) .card-body {
    display: none;
}

.container-fluid > .card:has(.sales-orders-table) {
    border-color: var(--ra-line);
    border-radius: 14px;
    box-shadow: var(--ra-shadow-sm);
}

.container-fluid > .card:has(.sales-orders-table) > .card-body {
    padding: 0.75rem;
}

.container-fluid > .card:has(.sales-orders-table) .sales-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0 0 0.6rem !important;
    background: transparent !important;
    padding: 0 !important;
}

.container-fluid > .card:has(.sales-orders-table) .sales-summary-strip > div {
    width: auto;
    border: 1px solid rgba(109, 40, 217, 0.16);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #faf6ff);
    padding: 0.5rem 0.65rem;
}

.container-fluid > .card:has(.sales-orders-table) .table-responsive {
    max-height: max(24rem, calc(100dvh - 22rem));
    overflow: auto;
}

.container-fluid > .card:has(.sales-orders-table) .sales-orders-table {
    margin-bottom: 0;
}

.container-fluid > .card:has(.sales-orders-table) .sales-orders-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.container-fluid > .card:has(.sales-orders-table) .sales-orders-table .btn-group > .btn {
    width: 2rem;
    min-width: 2rem;
    padding-inline: 0;
}

.container-fluid > .card:has(.sales-orders-table) .sales-orders-table .btn-group > .btn .me-1 {
    margin-right: 0 !important;
}

.container-fluid > .card:has(.sales-orders-table) .sales-orders-table .btn-group > .btn {
    font-size: 0;
}

.container-fluid > .card:has(.sales-orders-table) .sales-orders-table .btn-group > .btn i {
    font-size: 0.875rem;
}

/* Legacy live fallback: compact old Customers/Products/Sales assemblies while IIS catches up to the new Razor DLL. */
.container-fluid > .ra-filter-panel:has(+ .ra-summary-grid),
.container-fluid > .ra-filter-panel:has(+ .ra-data-card),
.container-fluid > .ra-filter-panel:has(+ .card .sales-summary-strip) {
    overflow: hidden;
    margin-bottom: 0.55rem !important;
    border-color: var(--ra-line);
    border-radius: 12px;
    box-shadow: var(--ra-shadow-sm);
}

.container-fluid > .ra-filter-panel:has(+ .ra-summary-grid) .card-header,
.container-fluid > .ra-filter-panel:has(+ .ra-data-card) .card-header,
.container-fluid > .ra-filter-panel:has(+ .card .sales-summary-strip) .card-header {
    min-height: 0;
    border-bottom: 0;
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.08), rgba(192, 38, 211, 0.07));
    padding: 0.48rem 0.7rem;
}

.container-fluid > .ra-filter-panel:has(+ .ra-summary-grid) .card-header h5,
.container-fluid > .ra-filter-panel:has(+ .ra-filter-panel) .card-header h6,
.container-fluid > .ra-filter-panel:has(+ .ra-data-card) .card-header h5,
.container-fluid > .ra-filter-panel:has(+ .ra-data-card) .card-header h6,
.container-fluid > .ra-filter-panel:has(+ .card .sales-summary-strip) .card-header h5,
.container-fluid > .ra-filter-panel:has(+ .card .sales-summary-strip) .card-header h6 {
    margin: 0;
    font-size: 0.9rem;
}

.container-fluid > .ra-filter-panel:has(+ .ra-summary-grid) > .card-body,
.container-fluid > .ra-filter-panel:has(+ .ra-data-card) > .card-body,
.container-fluid > .ra-filter-panel:has(+ .card .sales-summary-strip) > .card-body {
    display: none;
}

.container-fluid > .ra-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.55rem !important;
}

.container-fluid > .ra-summary-grid > [class*="col-"] {
    width: auto;
    margin: 0 !important;
    padding: 0;
}

.container-fluid > .ra-summary-grid .card {
    height: 100%;
    border-color: rgba(109, 40, 217, 0.16) !important;
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #faf6ff);
}

.container-fluid > .ra-summary-grid .card-body {
    padding: 0.52rem 0.65rem;
}

.container-fluid > .ra-summary-grid h6,
.container-fluid > .ra-summary-grid .card-subtitle {
    margin-bottom: 0.18rem !important;
    font-size: 0.72rem;
    font-weight: 780;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.container-fluid > .ra-summary-grid h3,
.container-fluid > .ra-summary-grid .card-title {
    font-size: 0.98rem;
    line-height: 1.1;
}

.container-fluid > .ra-summary-grid .fs-1 {
    font-size: 1.25rem !important;
}

.container-fluid > .ra-data-card:has([data-test="products-summary"]) > .card-body {
    padding: 0.65rem;
}

.container-fluid > .ra-data-card [data-test="products-summary"] {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.55rem !important;
    background: transparent !important;
    padding: 0 !important;
}

.container-fluid > .ra-data-card [data-test="products-summary"] > [class*="col-"] {
    width: auto;
    border: 1px solid rgba(109, 40, 217, 0.16);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #faf6ff);
    padding: 0.5rem 0.65rem;
}

.container-fluid > .card:has(.sales-summary-strip) > .card-body {
    padding: 0.65rem;
}

.container-fluid > .card:has(.sales-summary-strip) .sales-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.55rem !important;
    background: transparent !important;
    padding: 0 !important;
}

.container-fluid > .card:has(.sales-summary-strip) .sales-summary-strip > div {
    width: auto;
    border: 1px solid rgba(109, 40, 217, 0.16);
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #faf6ff);
    padding: 0.5rem 0.65rem;
}

@media (max-width: 575.98px) {
    .container-fluid > .ra-summary-grid,
    .container-fluid > .ra-data-card [data-test="products-summary"],
    .container-fluid > .card:has(.sales-summary-strip) .sales-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1199.98px) {
    .ra-command-bar {
        grid-template-columns: minmax(14rem, 1fr) minmax(9rem, 0.55fr) minmax(9rem, 0.55fr);
    }

    .ra-directory-command {
        grid-template-columns: minmax(14rem, 1fr) repeat(2, minmax(9rem, 0.6fr));
    }

    .ra-advanced-filter,
    .ra-clear-filter,
    .ra-command-actions,
    .ra-command-note-inline {
        justify-self: start;
    }

    .ra-report-command,
    .ra-statements-command {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .ra-workbench-header {
        align-items: stretch;
        flex-direction: column;
    }

    .ra-workbench-actions {
        justify-content: flex-start;
    }

    .ra-metric-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ra-command-bar {
        grid-template-columns: 1fr;
    }

    .ra-directory-command {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ra-directory-command .ra-search-box {
        grid-column: 1 / -1;
    }

    .ra-advanced-filter summary,
    .ra-clear-filter,
    .ra-command-actions {
        width: 100%;
    }

    .ra-command-actions {
        justify-content: stretch;
    }

    .ra-command-actions .btn {
        flex: 1 1 0;
    }

    .ra-advanced-filter-body {
        position: static;
        width: 100%;
    }

    .ra-grid-scroll {
        max-height: none;
    }

    .container-fluid > .card:has(.sales-orders-table) .sales-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ra-entity-page .ra-page-header {
        gap: 0.65rem;
        padding: 0.65rem;
    }

    .ra-entity-page .ra-page-header p:not(.ra-page-kicker) {
        display: none;
    }

    .ra-entity-page .ra-page-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        flex-direction: row;
        gap: 0.38rem;
    }

    .ra-entity-page .ra-page-actions .btn,
    .ra-entity-page .ra-page-actions.btn-group .btn {
        min-height: 2.2rem;
        padding-inline: 0.45rem;
        white-space: nowrap;
    }

    .ra-entity-page .ra-view-toggle {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .ra-entity-page .ra-view-toggle .btn {
        min-width: 0;
        padding-inline: 0.35rem;
    }
}

@media (max-width: 575.98px) {
    .ra-workbench-header,
    .ra-workbench-panel {
        border-radius: 12px;
        padding: 0.75rem;
    }

    .ra-crumbs {
        display: none;
    }

    .ra-workbench-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .ra-workbench-actions .btn {
        width: 100%;
        padding-inline: 0.45rem;
    }

    .ra-entity-page .ra-page-actions .btn,
    .ra-entity-page .ra-page-actions.btn-group .btn {
        width: auto;
        min-width: 0;
        white-space: nowrap;
    }

    .ra-entity-page .ra-page-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ra-entity-page .ra-page-header,
    .dashboard-header {
        padding: 0.62rem;
    }

    .ra-metric-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .ra-metric-pill {
        padding: 0.48rem 0.55rem;
    }

    .ra-metric-pill span {
        font-size: 0.92rem;
    }

    .ra-command-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ra-directory-command {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ra-search-box,
    .ra-command-bar .ra-search-box {
        grid-column: 1 / -1;
    }

    .ra-command-actions {
        grid-column: 1 / -1;
        width: 100%;
    }

    .ra-command-actions .btn {
        flex: 1 1 0;
    }

    .ra-command-bar .ra-compact-select {
        grid-column: auto;
        min-width: 0;
        padding-inline: 0.55rem 1.75rem;
    }

    .ra-advanced-filter summary,
    .ra-clear-filter {
        width: 100%;
        min-width: 0;
    }

    .ra-grid-card-header {
        align-items: center;
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.55rem 0.65rem;
    }

    .ra-grid-card-header p {
        display: none;
    }

    .ra-grid-count {
        font-size: 0.72rem;
        padding: 0.25rem 0.5rem;
        text-align: right;
    }

    .ra-grid-count {
        white-space: normal;
    }

    .container-fluid > .card:has(.sales-orders-table) .sales-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .container-fluid > .card:has(.sales-orders-table) .table-responsive {
        max-height: none;
    }
}

/* ============================================================
   RABBIT ACCOUNTS SIGNATURE POLISH — v3
   World-class motion system, refined theme, micro-interactions.
   This layer intentionally loads last and wins the cascade.
   ============================================================ */

:root {
    /* Refined palette */
    --ra-ink: #221833;
    --ra-ink-soft: #4a3f63;
    --ra-muted: #6f6589;
    --ra-line: #e9e3f2;
    --ra-line-strong: #d6cce6;
    --ra-surface: #ffffff;
    --ra-surface-soft: #f8f5fc;
    --ra-primary: #6d28d9;
    --ra-primary-hover: #5b21b6;
    --ra-primary-active: #4c1d95;
    --ra-primary-soft: #f3e8ff;
    --ra-accent: #c026d3;
    --ra-accent-soft: #fae8ff;
    --ra-focus: #6d28d9;
    /* Elevation scale */
    --ra-shadow-xs: 0 1px 2px rgba(32, 18, 51, 0.05);
    --ra-shadow-sm: 0 1px 2px rgba(32, 18, 51, 0.06), 0 1px 1px rgba(32, 18, 51, 0.04);
    --ra-shadow-md: 0 4px 12px rgba(32, 18, 51, 0.08), 0 2px 4px rgba(32, 18, 51, 0.05);
    --ra-shadow-lg: 0 12px 32px rgba(32, 18, 51, 0.12), 0 4px 8px rgba(32, 18, 51, 0.06);
    --ra-shadow-primary: 0 6px 16px rgba(109, 40, 217, 0.24), 0 2px 4px rgba(109, 40, 217, 0.12);
    /* Motion system */
    --ra-dur-fast: 140ms;
    --ra-dur: 220ms;
    --ra-dur-slow: 360ms;
    --ra-ease: cubic-bezier(0.22, 1, 0.36, 1);          /* swift-out */
    --ra-ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1); /* gentle overshoot */
    --ra-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    /* Focus ring */
    --ra-ring: 0 0 0 3px rgba(109, 40, 217, 0.22);
}

/* ---------- Typography ---------- */
html,
body {
    font-family: "Inter", "Aptos", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-optical-sizing: auto;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.metric-value,
.ra-metric-pill span {
    letter-spacing: 0;
}

.table td,
.metric-value,
.ra-metric-pill span,
.ra-summary-card h3 {
    font-variant-numeric: tabular-nums;
}

::selection {
    background: rgba(109, 40, 217, 0.18);
    color: var(--ra-ink);
}

/* ---------- Refined app canvas ---------- */
html,
body {
    background:
        radial-gradient(1100px 500px at 85% -10%, rgba(225, 29, 72, 0.05), transparent 60%),
        radial-gradient(1200px 600px at -10% -10%, rgba(109, 40, 217, 0.07), transparent 55%),
        linear-gradient(180deg, #faf7fd 0%, #f4f0f9 100%);
}

/* ---------- Scrollbars (content areas) ---------- */
main ::-webkit-scrollbar,
.content ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

main ::-webkit-scrollbar-track,
.content ::-webkit-scrollbar-track {
    background: transparent;
}

main ::-webkit-scrollbar-thumb,
.content ::-webkit-scrollbar-thumb {
    background: var(--ra-line-strong);
    border: 3px solid transparent;
    background-clip: padding-box;
    border-radius: 999px;
}

main ::-webkit-scrollbar-thumb:hover,
.content ::-webkit-scrollbar-thumb:hover {
    background: #b3a6cc;
    background-clip: padding-box;
}

/* ---------- Page-enter choreography ----------
   Blazor swaps the routed page component inside .content on navigation,
   creating fresh DOM nodes, so these animations replay per page visit. */
@keyframes ra-page-enter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes ra-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.content > * {
    animation: ra-page-enter var(--ra-dur-slow) var(--ra-ease) backwards;
}

/* Staggered entrance for the first blocks of structured pages */
.ra-page > *,
.ra-workbench > *,
.container-fluid > * {
    animation: ra-page-enter var(--ra-dur-slow) var(--ra-ease) backwards;
}

.ra-page > *:nth-child(1),
.ra-workbench > *:nth-child(1),
.container-fluid > *:nth-child(1) { animation-delay: 0ms; }

.ra-page > *:nth-child(2),
.ra-workbench > *:nth-child(2),
.container-fluid > *:nth-child(2) { animation-delay: 45ms; }

.ra-page > *:nth-child(3),
.ra-workbench > *:nth-child(3),
.container-fluid > *:nth-child(3) { animation-delay: 90ms; }

.ra-page > *:nth-child(4),
.ra-workbench > *:nth-child(4),
.container-fluid > *:nth-child(4) { animation-delay: 135ms; }

.ra-page > *:nth-child(5),
.ra-workbench > *:nth-child(5),
.container-fluid > *:nth-child(5) { animation-delay: 180ms; }

.ra-page > *:nth-child(n+6),
.ra-workbench > *:nth-child(n+6),
.container-fluid > *:nth-child(n+6) { animation-delay: 215ms; }

/* Metric strips cascade individually */
.ra-metric-strip .ra-metric-pill,
.metrics-section .card {
    animation: ra-page-enter var(--ra-dur-slow) var(--ra-ease) backwards;
}

.ra-metric-strip .ra-metric-pill:nth-child(1) { animation-delay: 60ms; }
.ra-metric-strip .ra-metric-pill:nth-child(2) { animation-delay: 110ms; }
.ra-metric-strip .ra-metric-pill:nth-child(3) { animation-delay: 160ms; }
.ra-metric-strip .ra-metric-pill:nth-child(4) { animation-delay: 210ms; }

/* ---------- Focus: visible, consistent, calm ---------- */
:where(a, button, [role="button"], input, select, textarea, summary):focus {
    outline: none;
}

:where(a, button, [role="button"], summary):focus-visible {
    outline: none;
    box-shadow: var(--ra-ring);
    border-radius: 7px;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--ra-primary);
    box-shadow: var(--ra-ring);
}

/* ---------- Buttons ---------- */
.btn {
    position: relative;
    transition:
        background-color var(--ra-dur-fast) var(--ra-ease),
        border-color var(--ra-dur-fast) var(--ra-ease),
        color var(--ra-dur-fast) var(--ra-ease),
        box-shadow var(--ra-dur) var(--ra-ease),
        transform var(--ra-dur-fast) var(--ra-ease);
    will-change: transform;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 60ms;
}

.btn-primary,
.btn-success {
    background: linear-gradient(180deg, #8b5cf6 0%, var(--ra-primary) 60%, #5f21bd 100%);
    border-color: var(--ra-primary);
    box-shadow: var(--ra-shadow-primary), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus {
    background: linear-gradient(180deg, #9061f9 0%, var(--ra-primary-hover) 65%, #4c1d95 100%);
    border-color: var(--ra-primary-hover);
    box-shadow: 0 10px 24px rgba(109, 40, 217, 0.32), 0 3px 6px rgba(109, 40, 217, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:active,
.btn-success:active {
    background: var(--ra-primary-active);
    box-shadow: 0 3px 8px rgba(109, 40, 217, 0.24);
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-success,
.btn-outline-info,
.btn-outline-danger {
    transition:
        background-color var(--ra-dur-fast) var(--ra-ease),
        border-color var(--ra-dur-fast) var(--ra-ease),
        color var(--ra-dur-fast) var(--ra-ease),
        box-shadow var(--ra-dur) var(--ra-ease),
        transform var(--ra-dur-fast) var(--ra-ease);
}

/* ---------- Cards, panels & surfaces ---------- */
.card,
.chart-container,
.metric-card,
.activity-item,
.ra-workbench-panel,
.ra-grid-card,
.ra-metric-pill {
    transition:
        box-shadow var(--ra-dur) var(--ra-ease),
        border-color var(--ra-dur) var(--ra-ease),
        transform var(--ra-dur) var(--ra-ease),
        background-color var(--ra-dur) var(--ra-ease);
}

.metric-card:hover,
.metrics-section .card:hover,
.ra-summary-card:hover,
.ra-metric-pill:hover,
.activity-item:hover {
    border-color: rgba(109, 40, 217, 0.32) !important;
    box-shadow: var(--ra-shadow-lg) !important;
    transform: translateY(-2px);
}

.chart-container:hover,
.ra-grid-card:hover {
    box-shadow: var(--ra-shadow-md) !important;
}

/* ---------- Tables ---------- */
.table tbody tr {
    transition: background-color var(--ra-dur-fast) var(--ra-ease), box-shadow var(--ra-dur-fast) var(--ra-ease);
}

.table-hover tbody tr:hover,
.ra-density-table tbody tr:hover {
    background-color: var(--ra-primary-soft);
    box-shadow: inset 2px 0 0 var(--ra-primary);
}

.ra-grid-scroll {
    scroll-behavior: smooth;
}

/* Sticky table headers get a soft separation shadow */
.ra-density-table thead th,
.container-fluid > .card:has(.sales-orders-table) .sales-orders-table thead th {
    box-shadow: 0 1px 0 var(--ra-line-strong), 0 4px 10px rgba(32, 18, 51, 0.04);
}

/* ---------- Forms ---------- */
.form-control,
.form-select {
    transition:
        border-color var(--ra-dur-fast) var(--ra-ease),
        box-shadow var(--ra-dur) var(--ra-ease),
        background-color var(--ra-dur-fast) var(--ra-ease);
}

.form-control:hover:not(:focus),
.form-select:hover:not(:focus) {
    border-color: #b3a6cc;
}

.form-check-input {
    transition: background-color var(--ra-dur-fast) var(--ra-ease), border-color var(--ra-dur-fast) var(--ra-ease), box-shadow var(--ra-dur) var(--ra-ease);
}

/* ---------- Links ---------- */
a {
    transition: color var(--ra-dur-fast) var(--ra-ease);
}

.ra-crumbs a {
    position: relative;
}

.ra-crumbs a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Badges & pills ---------- */
.badge {
    transition: background-color var(--ra-dur-fast) var(--ra-ease), transform var(--ra-dur-fast) var(--ra-ease);
}

.health-status,
.date-info,
.ra-mini-metric-row span {
    transition: border-color var(--ra-dur-fast) var(--ra-ease), background-color var(--ra-dur-fast) var(--ra-ease);
}

/* ---------- Sidebar & navigation motion ---------- */
.sidebar,
.offcanvas {
    background:
        radial-gradient(420px 240px at 0% 0%, rgba(168, 85, 247, 0.22), transparent 70%),
        linear-gradient(180deg, #170d29 0%, #231345 52%, #321137 100%);
}

.sidebar .nav-link,
.mobile-nav .nav-link {
    transition:
        background-color var(--ra-dur-fast) var(--ra-ease),
        color var(--ra-dur-fast) var(--ra-ease),
        box-shadow var(--ra-dur) var(--ra-ease),
        padding-left var(--ra-dur-fast) var(--ra-ease);
}

.sidebar .nav-link:hover,
.mobile-nav .nav-link:hover {
    padding-left: 1rem;
}

.sidebar .nav-link .bi,
.mobile-nav .nav-link .bi {
    transition: transform var(--ra-dur-fast) var(--ra-ease-spring), color var(--ra-dur-fast) var(--ra-ease);
}

.sidebar .nav-link:hover .bi,
.mobile-nav .nav-link:hover .bi {
    transform: translateX(2px) scale(1.08);
}

.sidebar .nav-link.active,
.mobile-nav .nav-link.active {
    background: linear-gradient(90deg, rgba(167, 139, 250, 0.22), rgba(167, 139, 250, 0.08));
    box-shadow: inset 3px 0 0 #e879f9, 0 1px 8px rgba(0, 0, 0, 0.18);
}

.bottom-nav-item {
    transition: color var(--ra-dur-fast) var(--ra-ease), background-color var(--ra-dur-fast) var(--ra-ease), transform var(--ra-dur-fast) var(--ra-ease);
}

.bottom-nav-item:active {
    transform: scale(0.94);
}

.bottom-nav-item i {
    transition: transform var(--ra-dur-fast) var(--ra-ease-spring);
}

.bottom-nav-item:hover i {
    transform: translateY(-2px);
}

/* ---------- Topbar ---------- */
.app-topbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.app-topbar .brand {
    transition: box-shadow var(--ra-dur) var(--ra-ease), border-color var(--ra-dur) var(--ra-ease);
}

.app-topbar .brand:hover {
    border-color: rgba(109, 40, 217, 0.3);
    box-shadow: var(--ra-shadow-md);
}

/* ---------- Modals, dropdowns, offcanvas ---------- */
.modal.fade .modal-dialog {
    transform: translateY(14px) scale(0.985);
    transition: transform var(--ra-dur-slow) var(--ra-ease);
}

.modal.show .modal-dialog {
    transform: none;
}

.modal.show {
    z-index: 4000 !important;
}

.modal-content {
    border: 1px solid var(--ra-line) !important;
    border-radius: 14px;
    box-shadow: var(--ra-shadow-lg) !important;
}

.modal-backdrop.show {
    z-index: 3990 !important;
    opacity: 0.4;
    backdrop-filter: blur(2px);
}

.dropdown-menu {
    border: 1px solid var(--ra-line);
    border-radius: 12px;
    box-shadow: var(--ra-shadow-lg);
    padding: 0.4rem;
    animation: ra-page-enter var(--ra-dur) var(--ra-ease);
}

.dropdown-item {
    border-radius: 8px;
    transition: background-color var(--ra-dur-fast) var(--ra-ease), color var(--ra-dur-fast) var(--ra-ease);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--ra-primary-soft);
    color: var(--ra-primary-active);
}

.offcanvas.offcanvas-start {
    transition: transform var(--ra-dur-slow) var(--ra-ease);
}

.ra-advanced-filter-body {
    animation: ra-page-enter var(--ra-dur) var(--ra-ease);
}

/* ---------- Alerts & validation ---------- */
.alert {
    border-radius: 10px;
    animation: ra-page-enter var(--ra-dur-slow) var(--ra-ease);
}

.validation-message {
    animation: ra-fade-in var(--ra-dur) var(--ra-ease);
}

/* ---------- Loading: spinners & skeletons ---------- */
.spinner-border {
    border-width: 0.18em;
    animation-duration: 0.65s;
}

@keyframes ra-shimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

.ra-skeleton {
    border-radius: 8px;
    background: linear-gradient(90deg, #eef0f6 25%, #faf7fd 50%, #eef0f6 75%);
    background-size: 200% 100%;
    animation: ra-shimmer 1.4s linear infinite;
    color: transparent !important;
    pointer-events: none;
    user-select: none;
}

/* ---------- Login: cinematic entrance ---------- */
@keyframes ra-aurora {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.login-page {
    background:
        linear-gradient(120deg, rgba(109, 40, 217, 0.14), rgba(240, 171, 252, 0.12), rgba(225, 29, 72, 0.12), rgba(109, 40, 217, 0.14)),
        var(--ra-surface-soft);
    background-size: 300% 300%, 100% 100%;
    animation: ra-aurora 18s var(--ra-ease-in-out) infinite;
}

.login-panel {
    border-radius: 16px;
    box-shadow: var(--ra-shadow-lg), 0 30px 80px rgba(22, 13, 38, 0.18);
    animation: ra-page-enter 480ms var(--ra-ease) backwards;
}

.login-hero {
    position: relative;
    overflow: hidden;
}

.login-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(560px 320px at 110% 110%, rgba(232, 121, 249, 0.14), transparent 70%),
        radial-gradient(480px 300px at -10% -10%, rgba(240, 171, 252, 0.16), transparent 70%);
}

.login-hero > * {
    position: relative;
    z-index: 1;
    animation: ra-page-enter 520ms var(--ra-ease) backwards;
}

.login-hero > *:nth-child(1) { animation-delay: 80ms; }
.login-hero > *:nth-child(2) { animation-delay: 160ms; }
.login-hero > *:nth-child(3) { animation-delay: 240ms; }
.login-hero > *:nth-child(4) { animation-delay: 320ms; }

.login-proof-item {
    transition: background-color var(--ra-dur) var(--ra-ease), border-color var(--ra-dur) var(--ra-ease), transform var(--ra-dur) var(--ra-ease);
}

.login-proof-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(232, 121, 249, 0.4);
    transform: translateY(-2px);
}

.login-form-area {
    animation: ra-page-enter 520ms var(--ra-ease) 200ms backwards;
}

.login-brand-mark,
.brand-icon {
    transition: transform var(--ra-dur) var(--ra-ease-spring), box-shadow var(--ra-dur) var(--ra-ease);
}

.navbar-brand:hover .brand-icon,
.login-brand-lockup:hover .login-brand-mark {
    transform: rotate(-4deg) scale(1.06);
}

/* ---------- Theme-change smoothing ---------- */
body,
.card,
.app-topbar,
.mobile-header,
.bottom-nav,
.content {
    transition-property: background-color, border-color, color;
    transition-duration: var(--ra-dur);
    transition-timing-function: var(--ra-ease);
}

/* ---------- Accessibility: reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .login-page {
        animation: none;
    }
}

/* ============================================================
   RABBIT ACCOUNTS TYPOGRAPHIC SCALE & HIERARCHY — v4
   Editorial display serif for titles, modular scale, tracked
   micro-labels, data-first sizing, generous spatial rhythm.
   ============================================================ */

:root {
    --ra-font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --ra-font-ui: "Inter", "Aptos", "Segoe UI", system-ui, -apple-system, sans-serif;
    /* Modular type scale (1.2 ratio, data-app tuned) */
    --ra-text-2xs: 0.72rem;
    --ra-text-xs: 0.8rem;
    --ra-text-sm: 0.875rem;
    --ra-text-md: 1rem;
    --ra-text-lg: 1.18rem;
    --ra-text-xl: 1.45rem;
    --ra-text-2xl: clamp(1.65rem, 2vw, 2.05rem);
    --ra-text-3xl: clamp(2rem, 2.6vw, 2.6rem);
    --ra-track-caps: 0.07em;
    --ra-content-gap: 1.15rem;
}

body {
    line-height: 1.55;
}

/* ---------- Display serif for true titles ---------- */
.ra-page-header h1,
.ra-page-header h2,
.ra-page-header h3,
.ra-workbench-heading h1,
.dashboard-header .business-name,
.login-hero h1,
.login-card h2,
.modal-title {
    font-family: var(--ra-font-display);
    font-optical-sizing: auto;
    font-weight: 600;
    letter-spacing: 0;
}

.ra-workbench-heading h1 {
    font-size: var(--ra-text-3xl);
    line-height: 1.08;
}

.ra-page-header h1,
.ra-page-header h2,
.ra-page-header h3 {
    font-size: var(--ra-text-2xl);
    line-height: 1.12;
}

.ra-entity-page .ra-page-header h1,
.ra-entity-page .ra-page-header h2,
.ra-entity-page .ra-page-header h3 {
    font-size: clamp(1.45rem, 1.7vw, 1.8rem);
}

.dashboard-header .business-name {
    font-size: var(--ra-text-3xl);
    font-weight: 620;
    line-height: 1.06;
}

.modal-title {
    font-size: var(--ra-text-xl);
}

/* Supporting copy under titles: quieter, roomier */
.ra-page-header p:not(.ra-page-kicker),
.ra-workbench-heading p,
.dashboard-header .business-subtitle {
    font-size: var(--ra-text-sm);
    line-height: 1.5;
    color: var(--ra-muted);
}

/* ---------- Tracked uppercase micro-labels ---------- */
.ra-page-kicker,
.login-eyebrow,
.nav-divider small,
.nav-section-title,
.table th,
.table-dark th,
.table-light th,
thead.table-dark th,
thead.table-light th,
.ra-density-table thead th,
.ra-metric-pill small,
.ra-date-field span {
    letter-spacing: var(--ra-track-caps) !important;
    font-weight: 650;
}

.ra-page-kicker,
.login-eyebrow {
    font-weight: 750;
}

/* Table headers recede; data leads */
.table th,
.ra-density-table thead th {
    font-size: var(--ra-text-2xs);
    color: var(--ra-muted) !important;
}

.table td {
    font-size: var(--ra-text-sm);
}

/* ---------- Data-first: numbers own the page ---------- */
.metric-value {
    font-size: 2.1rem;
    letter-spacing: 0;
}

.ra-metric-pill span {
    font-size: 1.32rem;
    letter-spacing: 0;
}

.metrics-section .card h3,
.ra-summary-card h3 {
    font-size: clamp(1.5rem, 2vw, 1.95rem);
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1.05;
}

.container-fluid > .ra-summary-grid h3,
.container-fluid > .ra-summary-grid .card-title {
    font-size: 1.18rem;
    font-weight: 750;
    letter-spacing: 0;
}

.metric-label {
    font-size: var(--ra-text-xs);
}

/* ---------- Spatial rhythm: room to breathe ---------- */
.content {
    padding: clamp(1.1rem, 1.9vw, 2rem);
}

.ra-page {
    gap: var(--ra-content-gap);
}

.ra-workbench {
    gap: 1rem;
}

.ra-page-header {
    padding: 1.2rem 1.35rem;
}

.ra-workbench-header {
    padding: 1.25rem 1.4rem;
}

.dashboard-header,
.ra-dashboard-header {
    padding: 1.25rem 1.4rem;
    margin-bottom: 1.1rem;
}

.card-body {
    padding: 1.1rem 1.2rem;
}

.section-title {
    margin-bottom: 0.75rem;
    font-size: var(--ra-text-lg);
    font-weight: 750;
    letter-spacing: 0;
}

.metrics-section,
.charts-section,
.activity-section {
    margin-bottom: 1.4rem;
}

/* ---------- Quieter secondary chrome ---------- */
.btn {
    font-weight: 600;
    letter-spacing: 0.005em;
}

.btn-outline-secondary {
    color: var(--ra-ink-soft);
    border-color: var(--ra-line-strong);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: none;
}

.btn-outline-primary,
.btn-outline-success,
.btn-outline-info {
    border-color: rgba(109, 40, 217, 0.32);
    box-shadow: none;
}

.form-control,
.form-select {
    border-radius: 10px;
}

.form-label {
    font-size: var(--ra-text-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--ra-ink-soft);
}

.badge {
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.03em;
    padding: 0.36em 0.72em;
}

/* ---------- Login: editorial headline like the reference ---------- */
.login-hero h1 {
    font-size: clamp(2.5rem, 4.6vw, 4.3rem);
    font-weight: 560;
    line-height: 1.04;
    letter-spacing: 0;
}

.login-lede {
    font-size: var(--ra-text-lg);
    line-height: 1.6;
    font-weight: 420;
}

.login-card h2 {
    font-size: 2.05rem;
}

.login-proof-item {
    font-weight: 540;
    font-size: var(--ra-text-sm);
}

/* ============================================================
   DASHBOARD COMPOSITION — v4 structural redesign
   ============================================================ */

.dashboard-page {
    gap: 1.3rem;
}

.dash-hero {
    border: 1px solid var(--ra-line);
    border-radius: 16px;
    background:
        radial-gradient(640px 260px at 100% 0%, rgba(232, 121, 249, 0.1), transparent 70%),
        linear-gradient(135deg, rgba(109, 40, 217, 0.07), rgba(232, 121, 249, 0.05)),
        #ffffff;
    box-shadow: var(--ra-shadow-sm);
    padding: 1.35rem 1.5rem 1.1rem;
}

.dash-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
}

.dash-title {
    margin: 0;
    font-family: var(--ra-font-display);
    font-optical-sizing: auto;
    font-size: var(--ra-text-3xl);
    font-weight: 620;
    letter-spacing: 0;
    line-height: 1.06;
    color: var(--ra-ink);
}

.dash-subtitle {
    margin: 0.3rem 0 0;
    color: var(--ra-muted);
    font-size: var(--ra-text-sm);
}

.dash-hero-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.65rem;
    flex-shrink: 0;
}

.dash-status-pills {
    display: flex;
    gap: 0.45rem;
}

.dash-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 34px;
    padding: 0.32rem 0.75rem;
    border: 1px solid var(--ra-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--ra-ink-soft);
    font-size: var(--ra-text-xs);
    font-weight: 600;
}

.dash-pill-good {
    color: #15803d;
    border-color: rgba(21, 128, 61, 0.25);
    background: #f0fdf4;
}

.dash-actions {
    display: flex;
    gap: 0.5rem;
}

.dash-period {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--ra-line);
}

.dash-period .form-label {
    color: var(--ra-muted);
    white-space: nowrap;
}

.dash-period .dashboard-preset-select {
    width: 12rem;
    flex: 0 0 auto;
}

.dash-period .dashboard-date-range {
    width: auto;
    max-width: 26rem;
}

/* Primary stat band: the four numbers that run the business */
.dash-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.dash-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    min-width: 0;
    padding: 1.05rem 1.15rem;
    border: 1px solid var(--ra-line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--ra-shadow-sm);
    transition: box-shadow var(--ra-dur) var(--ra-ease), border-color var(--ra-dur) var(--ra-ease), transform var(--ra-dur) var(--ra-ease);
}

.dash-stat:hover {
    border-color: rgba(109, 40, 217, 0.32);
    box-shadow: var(--ra-shadow-lg);
    transform: translateY(-2px);
}

.dash-stat-label {
    color: var(--ra-muted);
    font-size: var(--ra-text-2xs);
    font-weight: 650;
    letter-spacing: var(--ra-track-caps);
    text-transform: uppercase;
}

.dash-stat-value {
    color: var(--ra-ink);
    font-size: clamp(1.6rem, 2.2vw, 2.15rem);
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1.04;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Secondary tier: margins and warnings */
.dash-substat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
    gap: 0.85rem;
    margin-top: 0.85rem;
}

.dash-substat {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--ra-line);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #fcfaff);
    box-shadow: var(--ra-shadow-xs);
    text-align: left;
}

.dash-substat > .bi {
    font-size: 1.45rem;
    flex-shrink: 0;
}

.dash-substat-body {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.dash-substat-value {
    color: var(--ra-ink);
    font-size: 1.32rem;
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.dash-substat-link {
    cursor: pointer;
    transition: box-shadow var(--ra-dur) var(--ra-ease), border-color var(--ra-dur) var(--ra-ease), transform var(--ra-dur) var(--ra-ease);
}

.dash-substat-link:hover {
    border-color: rgba(109, 40, 217, 0.32);
    box-shadow: var(--ra-shadow-md);
    transform: translateY(-2px);
}

.dash-substat-arrow {
    margin-left: auto;
    color: var(--ra-muted);
    transition: transform var(--ra-dur-fast) var(--ra-ease), color var(--ra-dur-fast) var(--ra-ease);
}

.dash-substat-link:hover .dash-substat-arrow {
    color: var(--ra-primary);
    transform: translateX(3px);
}

.dash-aging {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    color: var(--ra-muted);
}

/* Chart panels: flush headers, content leads */
.dash-panel {
    overflow: hidden;
}

.dash-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.2rem;
    border-bottom: 1px solid var(--ra-line);
    background: linear-gradient(180deg, #fcfaff, #f8f5fc);
}

.dash-panel-header h3 {
    margin: 0;
    font-size: var(--ra-text-md);
    font-weight: 700;
    letter-spacing: 0;
    color: var(--ra-ink);
}

.dash-empty {
    padding: 2.6rem 1rem;
    text-align: center;
    color: var(--ra-muted);
}

.dash-empty .bi {
    font-size: 1.9rem;
    opacity: 0.55;
}

.dash-empty p {
    margin: 0.55rem 0 0;
    font-size: var(--ra-text-sm);
}

.dash-chart-stage {
    position: relative;
    min-width: 0;
    width: 100%;
    contain: layout paint;
}

.dash-chart-stage-md {
    min-height: 250px;
}

.dash-chart-stage-lg {
    min-height: 300px;
}

.dash-chart-stage .apexcharts-canvas,
.dash-chart-stage .apexcharts-svg {
    max-width: 100%;
}

.dash-chart-stage canvas[data-rabbit-chart] {
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-height: inherit;
}

.dash-native-chart {
    width: 100%;
    min-height: inherit;
}

.dash-area-chart {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.75rem;
    padding: 0.45rem 0.25rem 0;
}

.dash-area-chart svg {
    width: 100%;
    height: 260px;
    overflow: visible;
    filter: drop-shadow(0 16px 24px rgba(124, 58, 237, 0.08));
}

.dash-area-chart polyline {
    stroke-dasharray: 160;
    animation: dash-chart-draw 720ms var(--ra-ease) both;
}

.dash-area-chart circle {
    animation: dash-point-rise 520ms var(--ra-ease) both;
}

.dash-chart-axis {
    display: flex;
    justify-content: space-between;
    color: var(--ra-muted);
    font-size: var(--ra-text-xs);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.dash-donut-chart {
    display: grid;
    place-items: center;
    gap: 0.95rem;
    padding: 0.6rem 0.25rem 0;
}

.dash-donut-ring {
    position: relative;
    display: grid;
    place-items: center;
    width: min(74%, 178px);
    aspect-ratio: 1;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75), 0 22px 42px rgba(15, 23, 42, 0.1);
    animation: dash-donut-rise 620ms var(--ra-ease) both;
}

.dash-donut-ring::after {
    content: "";
    position: absolute;
    inset: 18%;
    border-radius: inherit;
    background: var(--ra-surface);
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.8);
}

.dash-donut-ring span {
    position: relative;
    z-index: 1;
    color: var(--ra-ink);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0;
}

.dash-donut-legend {
    display: grid;
    gap: 0.42rem;
    width: min(100%, 230px);
}

.dash-donut-legend span {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
    color: var(--ra-ink-soft);
    font-size: var(--ra-text-xs);
    font-weight: 700;
}

.dash-donut-legend i {
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 999px;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.04);
}

.dash-product-bars {
    display: grid;
    align-content: center;
    gap: 0.82rem;
    padding: 0.3rem 0.1rem;
}

.dash-product-bar {
    display: grid;
    grid-template-columns: minmax(8rem, 0.82fr) minmax(10rem, 1.55fr) auto;
    align-items: center;
    gap: 0.9rem;
}

.dash-product-name {
    overflow: hidden;
    color: var(--ra-ink-soft);
    font-size: var(--ra-text-sm);
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-product-track {
    position: relative;
    height: 0.88rem;
    overflow: hidden;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.09), rgba(20, 184, 166, 0.08));
    box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.85);
}

.dash-product-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--ra-primary), var(--ra-accent));
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.22);
    animation: dash-bar-grow 720ms var(--ra-ease) both;
}

.dash-product-bar strong {
    color: var(--ra-ink);
    font-size: var(--ra-text-sm);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@keyframes dash-chart-draw {
    from {
        stroke-dashoffset: 160;
    }

    to {
        stroke-dashoffset: 0;
    }
}

@keyframes dash-point-rise {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dash-donut-rise {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes dash-bar-grow {
    from {
        transform: scaleX(0);
        transform-origin: left center;
    }

    to {
        transform: scaleX(1);
        transform-origin: left center;
    }
}

.dash-chart-skeleton {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 18px;
    background:
        linear-gradient(115deg, transparent 0 28%, rgba(255, 255, 255, 0.72) 44%, transparent 62%) -45% 0 / 42% 100% no-repeat,
        linear-gradient(180deg, rgba(249, 250, 251, 0.92), rgba(238, 242, 247, 0.76));
    border: 1px solid rgba(226, 232, 240, 0.78);
    animation: dash-chart-sheen 1.4s var(--ra-ease) infinite;
}

.dash-chart-skeleton::before {
    content: "";
    position: absolute;
    inset: 14% 7% 18%;
    border-radius: 16px;
    background:
        linear-gradient(180deg, transparent 23%, rgba(148, 163, 184, 0.18) 24%, transparent 25%),
        linear-gradient(180deg, transparent 49%, rgba(148, 163, 184, 0.18) 50%, transparent 51%),
        linear-gradient(180deg, transparent 74%, rgba(148, 163, 184, 0.18) 75%, transparent 76%);
}

.dash-chart-skeleton span {
    position: absolute;
    bottom: 18%;
    width: 13%;
    border-radius: 999px 999px 6px 6px;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.24), rgba(20, 184, 166, 0.18));
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.dash-chart-skeleton span:nth-child(1) {
    left: 10%;
    height: 32%;
}

.dash-chart-skeleton span:nth-child(2) {
    left: 31%;
    height: 58%;
}

.dash-chart-skeleton span:nth-child(3) {
    left: 52%;
    height: 44%;
}

.dash-chart-skeleton span:nth-child(4) {
    left: 73%;
    height: 68%;
}

.dash-chart-skeleton-bars span:nth-child(1) {
    left: 8%;
    height: 52%;
}

.dash-chart-skeleton-bars span:nth-child(2) {
    left: 25%;
    height: 76%;
}

.dash-chart-skeleton-bars span:nth-child(3) {
    left: 42%;
    height: 38%;
}

.dash-chart-skeleton-bars span:nth-child(4) {
    left: 59%;
    height: 62%;
}

.dash-chart-skeleton-bars span:nth-child(5) {
    left: 76%;
    height: 48%;
}

.dash-chart-skeleton-donut {
    display: grid;
    place-items: center;
}

.dash-chart-skeleton-donut::after {
    content: "";
    width: min(64%, 170px);
    aspect-ratio: 1;
    border-radius: 999px;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 42%, transparent 43%),
        conic-gradient(from 210deg, rgba(20, 184, 166, 0.3), rgba(124, 58, 237, 0.22), rgba(251, 191, 36, 0.22), rgba(20, 184, 166, 0.3));
    filter: drop-shadow(0 18px 28px rgba(15, 23, 42, 0.08));
}

@keyframes dash-chart-sheen {
    0% {
        background-position: -45% 0, 0 0;
    }

    100% {
        background-position: 145% 0, 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dash-chart-skeleton,
    .dash-area-chart polyline,
    .dash-area-chart circle,
    .dash-donut-ring,
    .dash-product-track i {
        animation: none;
    }
}

/* Shortcuts rail */
.dash-shortcuts {
    display: flex;
    flex-direction: column;
    padding: 0.45rem;
}

.dash-shortcut {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    color: var(--ra-ink-soft);
    font-weight: 600;
    font-size: var(--ra-text-sm);
    text-decoration: none;
    transition: background-color var(--ra-dur-fast) var(--ra-ease), color var(--ra-dur-fast) var(--ra-ease);
}

.dash-shortcut > .bi:first-child {
    color: var(--ra-primary);
    font-size: 1.05rem;
}

.dash-shortcut > .bi:last-child {
    margin-left: auto;
    color: var(--ra-line-strong);
    transition: transform var(--ra-dur-fast) var(--ra-ease), color var(--ra-dur-fast) var(--ra-ease);
}

.dash-shortcut:hover {
    background: var(--ra-primary-soft);
    color: var(--ra-primary-active);
}

.dash-shortcut:hover > .bi:last-child {
    color: var(--ra-primary);
    transform: translateX(3px);
}

.dash-system-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
    padding: 0.75rem 0.85rem 0.55rem;
    border-top: 1px dashed var(--ra-line);
}

/* Dashboard responsive composition */
@media (max-width: 1199.98px) {
    .dash-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-substat-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .command-palette-panel {
        top: 4.75rem;
        width: min(100vw - 1rem, 680px);
        max-height: calc(100vh - 6rem);
    }

    .command-palette-item {
        grid-template-columns: 2.2rem minmax(0, 1fr);
    }

    .command-palette-path {
        display: none;
    }

    .dash-hero {
        padding: 1rem;
    }

    .dash-hero-top {
        flex-direction: column;
    }

    .dash-hero-side {
        align-items: stretch;
        width: 100%;
    }

    .dash-status-pills {
        flex-wrap: wrap;
    }

    .dash-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dash-period {
        flex-direction: column;
        align-items: stretch;
    }

    .dash-period .dashboard-preset-select,
    .dash-period .dashboard-date-range {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 575.98px) {
    .dash-stat-grid {
        grid-template-columns: 1fr;
    }

    .dash-actions {
        grid-template-columns: 1fr 1fr;
    }

    .dash-actions .btn:first-child {
        grid-column: 1 / -1;
    }
}

/* ---------- Mobile typographic balance ---------- */
@media (max-width: 991.98px) {
    .ra-workbench-heading h1,
    .dashboard-header .business-name {
        font-size: 1.7rem;
    }

    .ra-page-header h1,
    .ra-page-header h2,
    .ra-page-header h3 {
        font-size: 1.45rem;
    }

    .metric-value {
        font-size: 1.8rem;
    }

    .content {
        padding: 1rem 0.85rem 5.5rem;
    }
}


/* ============================================================
   DIRECTORY REFINEMENT — shared by master-data pages
   Quiet tables: text hierarchy over icon noise.
   ============================================================ */

.ra-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--ra-primary-soft), #fae8ff);
    color: var(--ra-primary-active);
    font-weight: 750;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.ra-entity-cell {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.ra-entity-cell-body {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}

.ra-entity-name {
    color: var(--ra-ink);
    font-weight: 650;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ra-entity-meta {
    color: var(--ra-muted);
    font-size: 0.78rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ra-entity-meta code {
    color: var(--ra-primary);
    background: transparent;
    padding: 0;
    font-size: 0.78rem;
    font-weight: 650;
}

.ra-cell-stack {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}

.ra-cell-primary {
    color: var(--ra-ink);
    font-size: 0.86rem;
    line-height: 1.3;
}

.ra-cell-secondary {
    color: var(--ra-muted);
    font-size: 0.78rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 15rem;
}

.ra-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    color: var(--ra-ink);
}

.ra-amount-muted {
    font-variant-numeric: tabular-nums;
    color: var(--ra-muted);
}

/* Soft badges: tinted fill, no borders, no icons */
.ra-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28em 0.7em;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 680;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.ra-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.75;
}

.ra-badge-violet { background: var(--ra-primary-soft); color: var(--ra-primary-active); }
.ra-badge-green  { background: #ecfdf3; color: #157347; }
.ra-badge-amber  { background: #fef6e7; color: #99571a; }
.ra-badge-red    { background: #feebef; color: #b4233f; }
.ra-badge-grey   { background: #f1eff6; color: var(--ra-ink-soft); }

/* Row actions: quiet until the row is hovered */
.ra-row-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    opacity: 0.55;
    transition: opacity var(--ra-dur-fast) var(--ra-ease);
}

tr:hover .ra-row-actions,
.ra-row-actions:focus-within {
    opacity: 1;
}

.ra-row-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    min-height: 2rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--ra-ink-soft);
    box-shadow: none;
    font-size: 0.9rem;
}

.ra-row-actions .btn:hover {
    transform: none;
    background: var(--ra-primary-soft);
    border-color: rgba(109, 40, 217, 0.18);
    color: var(--ra-primary-active);
}

.ra-row-actions .btn.ra-action-danger:hover {
    background: #feebef;
    border-color: rgba(180, 35, 63, 0.18);
    color: #b4233f;
}

.ra-payables-command {
    grid-template-columns:
        minmax(7.75rem, 0.72fr)
        minmax(7.75rem, 0.72fr)
        minmax(8.25rem, 0.8fr)
        minmax(8.25rem, 0.8fr)
        minmax(8.75rem, 0.9fr)
        minmax(10rem, 1fr)
        minmax(5.7rem, auto);
    margin-bottom: 0.35rem;
}

.ra-payables-command .ra-search-box {
    min-width: 0;
}

.ra-payables-command .ra-command-actions {
    min-width: 0;
}

.ra-payables-adjustment-command {
    grid-template-columns:
        minmax(8rem, 0.8fr)
        minmax(8rem, 0.8fr)
        minmax(10rem, 0.9fr)
        minmax(12rem, 1.2fr)
        minmax(5.7rem, auto);
    margin-bottom: 0.7rem;
}

.ra-payables-adjustment-command .ra-search-box {
    min-width: 0;
}

.ra-payables-grid {
    margin-top: 0.75rem;
}

.ra-payables-grid .ra-empty-state {
    padding-block: 1.35rem;
}

.ra-payables-grid .ra-empty-state-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 0.2rem;
    border-radius: 16px;
    font-size: 1.42rem;
}

.ra-payables-grid .ra-empty-state p {
    margin-bottom: 0.35rem;
}

.ra-operational-table {
    --bs-table-striped-bg: rgba(246, 239, 255, 0.36);
}

.ra-operational-table tbody td {
    padding-top: 0.62rem;
    padding-bottom: 0.62rem;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.ra-payables-grid .ra-grid-scroll {
    overflow-x: auto;
}

.ra-payables-grid [data-test="vendor-payments-table"] {
    width: 100%;
    min-width: 72rem;
    table-layout: fixed;
}

.ra-payables-grid [data-test="vendor-payments-table"] th:nth-child(1),
.ra-payables-grid [data-test="vendor-payments-table"] td:nth-child(1) {
    width: 15%;
}

.ra-payables-grid [data-test="vendor-payments-table"] th:nth-child(2),
.ra-payables-grid [data-test="vendor-payments-table"] td:nth-child(2) {
    width: 9.5%;
}

.ra-payables-grid [data-test="vendor-payments-table"] th:nth-child(3),
.ra-payables-grid [data-test="vendor-payments-table"] td:nth-child(3) {
    width: 17%;
}

.ra-payables-grid [data-test="vendor-payments-table"] th:nth-child(4),
.ra-payables-grid [data-test="vendor-payments-table"] td:nth-child(4) {
    width: 12%;
}

.ra-payables-grid [data-test="vendor-payments-table"] th:nth-child(5),
.ra-payables-grid [data-test="vendor-payments-table"] td:nth-child(5) {
    width: 10%;
}

.ra-payables-grid [data-test="vendor-payments-table"] th:nth-child(6),
.ra-payables-grid [data-test="vendor-payments-table"] td:nth-child(6) {
    width: 11%;
}

.ra-payables-grid [data-test="vendor-payments-table"] th:nth-child(7),
.ra-payables-grid [data-test="vendor-payments-table"] td:nth-child(7) {
    width: 12%;
}

.ra-payables-grid [data-test="vendor-payments-table"] th:nth-child(8),
.ra-payables-grid [data-test="vendor-payments-table"] td:nth-child(8) {
    width: 14%;
}

.ra-payables-grid [data-test="vendor-payments-table"] th:nth-child(2),
.ra-payables-grid [data-test="vendor-payments-table"] td:nth-child(2),
.ra-payables-grid [data-test="vendor-payments-table"] th:nth-child(4),
.ra-payables-grid [data-test="vendor-payments-table"] td:nth-child(4),
.ra-payables-grid [data-test="vendor-payments-table"] th:nth-child(8),
.ra-payables-grid [data-test="vendor-payments-table"] td:nth-child(8) {
    overflow-wrap: normal;
    position: sticky;
    right: 0;
    z-index: 2;
    background: #fff;
    box-shadow: -10px 0 18px rgba(51, 33, 76, 0.08);
    white-space: nowrap;
}

.ra-payables-grid [data-test="vendor-payments-table"] th:nth-child(8) {
    z-index: 3;
    background: #f8f5fc;
}

.ra-operational-table code {
    border-radius: 6px;
    background: rgba(109, 40, 217, 0.08);
    color: var(--ra-primary-active);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.12rem 0.34rem;
}

.ra-operational-table .badge.bg-primary,
.ra-operational-table .badge.bg-info,
.ra-operational-table .badge.bg-secondary,
.ra-operational-table .badge.bg-dark {
    background: var(--ra-primary-soft) !important;
    color: var(--ra-primary-active) !important;
}

.ra-operational-table .badge.bg-success {
    background: #ecfdf3 !important;
    color: #157347 !important;
}

.ra-operational-table .badge.bg-warning {
    background: #fef6e7 !important;
    color: #99571a !important;
}

.ra-operational-table .badge.bg-danger {
    background: #feebef !important;
    color: #b4233f !important;
}

.ra-row-actions .btn.ra-inline-approve,
.ra-row-actions .btn.ra-inline-reject {
    width: auto;
    min-width: 2rem;
    padding-inline: 0.55rem;
    font-weight: 750;
}

.ra-row-actions .btn.ra-inline-approve {
    background: #ecfdf3;
    color: #157347;
}

.ra-row-actions .btn.ra-inline-approve:hover {
    border-color: rgba(21, 115, 71, 0.2);
    background: #dcfce7;
    color: #0f6b3d;
}

.ra-exception-description {
    display: -webkit-box;
    max-width: 30rem;
    overflow: hidden;
    color: var(--ra-ink-soft);
    font-size: 0.82rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ra-exception-grid .ra-grid-scroll {
    max-height: max(25rem, calc(100dvh - 22rem));
}

@media (max-width: 1200px) {
    .ra-payables-command,
    .ra-payables-adjustment-command {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ra-payables-command .ra-search-box,
    .ra-payables-adjustment-command .ra-search-box,
    .ra-payables-command .ra-command-actions,
    .ra-payables-adjustment-command .ra-command-actions {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .ra-payables-command,
    .ra-payables-adjustment-command {
        grid-template-columns: 1fr;
    }

    .ra-payables-command .ra-search-box,
    .ra-payables-adjustment-command .ra-search-box,
    .ra-payables-command .ra-command-actions,
    .ra-payables-adjustment-command .ra-command-actions {
        grid-column: auto;
    }

    .ra-grid-card-header {
        align-items: flex-start;
    }

    .ra-grid-actions,
    .ra-command-actions {
        justify-content: stretch;
        width: 100%;
    }

    .ra-grid-actions .btn,
    .ra-command-actions .btn {
        flex: 1 1 10rem;
    }

    .ra-grid-scroll:has(.ra-operational-table) {
        max-height: none;
        overflow: visible;
    }

    .ra-operational-table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0 0.7rem;
    }

    .ra-operational-table thead {
        display: none;
    }

    .ra-operational-table,
    .ra-operational-table tbody,
    .ra-operational-table tr,
    .ra-operational-table td {
        display: block;
        width: 100%;
    }

    .ra-operational-table tbody tr {
        padding: 0.82rem;
        border: 1px solid var(--ra-line);
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 10px 24px rgba(32, 18, 51, 0.055);
    }

    .ra-operational-table tbody td {
        display: grid;
        grid-template-columns: minmax(6.5rem, 0.38fr) minmax(0, 1fr);
        align-items: start;
        gap: 0.75rem;
        border: 0;
        padding: 0.34rem 0;
        text-align: left !important;
    }

    .ra-operational-table tbody td::before {
        content: attr(data-label);
        color: var(--ra-muted);
        font-size: 0.68rem;
        font-weight: 850;
        line-height: 1.2;
        text-transform: uppercase;
    }

    .ra-operational-table tbody td:first-child {
        grid-template-columns: 1fr;
        padding-top: 0;
        padding-bottom: 0.55rem;
        border-bottom: 1px solid var(--ra-line);
    }

    .ra-operational-table tbody td:first-child::before {
        display: none;
    }

    .ra-operational-table .ra-row-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
        opacity: 1;
    }
}

/* Designed empty state */
.ra-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 3.25rem 1.5rem;
    text-align: center;
}

.ra-empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 0.6rem;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--ra-primary-soft), #fae8ff);
    color: var(--ra-primary);
    font-size: 1.7rem;
}

.ra-empty-state h5 {
    margin: 0;
    font-family: var(--ra-font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--ra-ink);
}

.ra-empty-state p {
    margin: 0 0 0.85rem;
    color: var(--ra-muted);
    font-size: 0.9rem;
    max-width: 26rem;
}

.ra-empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.ra-empty-state-actions .btn {
    min-width: 9rem;
}

/* Skeleton loading rows */
.ra-skeleton-row td {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}

.ra-skeleton-bar {
    display: block;
    height: 0.85rem;
    border-radius: 6px;
    background: linear-gradient(90deg, #efeaf6 25%, #f8f5fc 50%, #efeaf6 75%);
    background-size: 200% 100%;
    animation: ra-shimmer 1.4s linear infinite;
}

.ra-skeleton-bar + .ra-skeleton-bar {
    margin-top: 0.4rem;
    width: 60%;
    opacity: 0.7;
}


/* ============================================================
   LEGACY COMPONENT ADAPTER — restyles remaining Bootstrap
   badges and table action clusters app-wide to the refined
   language without touching every page's markup.
   ============================================================ */

.badge.bg-success,
.badge.bg-success.text-dark {
    background: #ecfdf3 !important;
    color: #157347 !important;
}

.badge.bg-warning,
.badge.bg-warning.text-dark {
    background: #fef6e7 !important;
    color: #99571a !important;
}

.badge.bg-danger {
    background: #feebef !important;
    color: #b4233f !important;
}

.badge.bg-secondary,
.badge.bg-light,
.badge.bg-light.text-dark {
    background: #f1eff6 !important;
    color: var(--ra-ink-soft) !important;
}

.badge.bg-primary,
.badge.bg-info,
.badge.bg-info.text-dark {
    background: var(--ra-primary-soft) !important;
    color: var(--ra-primary-active) !important;
}

.badge.bg-dark {
    background: #2a2438 !important;
    color: #f3eefb !important;
}

/* Table action clusters: ghost buttons, awakened on row hover */
.table .btn-group > .btn-outline-primary,
.table .btn-group > .btn-outline-secondary,
.table .btn-group > .btn-outline-info,
.table .btn-group > .btn-outline-success,
.table .btn-group > .btn-outline-warning,
.table .btn-group > .btn-outline-danger {
    border-color: transparent;
    background: transparent;
    color: var(--ra-ink-soft);
    box-shadow: none;
}

.table .btn-group > .btn-outline-primary:hover,
.table .btn-group > .btn-outline-secondary:hover,
.table .btn-group > .btn-outline-info:hover,
.table .btn-group > .btn-outline-success:hover,
.table .btn-group > .btn-outline-warning:hover {
    background: var(--ra-primary-soft);
    border-color: rgba(109, 40, 217, 0.18);
    color: var(--ra-primary-active);
    transform: none;
}

.table .btn-group > .btn-outline-danger:hover {
    background: #feebef;
    border-color: rgba(180, 35, 63, 0.18);
    color: #b4233f;
    transform: none;
}

.table tbody tr .btn-group {
    opacity: 0.6;
    transition: opacity var(--ra-dur-fast) var(--ra-ease);
}

.table tbody tr:hover .btn-group,
.table tbody tr .btn-group:focus-within {
    opacity: 1;
}


/* Reports hub: library rows inside refined panels */
.dash-panel .list-group-flush {
    gap: 0.2rem;
    display: flex;
    flex-direction: column;
}

.dash-panel .list-group-item-action {
    border: 0;
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
    background: transparent;
    transition: background-color var(--ra-dur-fast) var(--ra-ease);
    cursor: pointer;
    text-align: left;
}

.dash-panel .list-group-item-action:hover:not(:disabled),
.dash-panel .list-group-item-action:focus-visible {
    background: var(--ra-primary-soft);
}

.dash-panel .list-group-item-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dash-panel .list-group-item-action h6 {
    margin: 0;
    color: var(--ra-ink);
    font-size: 0.92rem;
    font-weight: 680;
}

.dash-panel .list-group-item-action:hover:not(:disabled) h6 {
    color: var(--ra-primary-active);
}

.dash-panel .list-group-item-action p {
    margin: 0.15rem 0 0;
    color: var(--ra-muted);
    font-size: 0.8rem;
}

.dash-panel .list-group-item-action small {
    color: var(--ra-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ============================================================
   FORM AND WORKFLOW QUALITY PASS
   Raises every remaining Bootstrap-era form to the same product
   interaction standard: clear focus, truthful busy states, stable
   modal actions, scan-friendly workflow grouping, and calm motion.
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 2.4rem;
    border-radius: 8px;
    transition:
        background-color var(--ra-dur-fast) var(--ra-ease),
        border-color var(--ra-dur-fast) var(--ra-ease),
        color var(--ra-dur-fast) var(--ra-ease),
        box-shadow var(--ra-dur-fast) var(--ra-ease),
        transform var(--ra-dur-fast) var(--ra-ease);
}

.btn:not(:disabled):active {
    transform: translateY(1px) scale(0.99);
}

.btn:disabled,
.btn.disabled,
.btn[aria-busy="true"] {
    cursor: not-allowed;
    filter: saturate(0.82);
    box-shadow: none !important;
}

.btn .spinner-border {
    flex: 0 0 auto;
}

.btn-icon,
.btn.btn-sm:has(> .bi:only-child) {
    width: 2.15rem;
    padding-inline: 0;
}

.form-control,
.form-select,
textarea.form-control {
    background-color: rgba(255, 255, 255, 0.92);
    transition:
        background-color var(--ra-dur-fast) var(--ra-ease),
        border-color var(--ra-dur-fast) var(--ra-ease),
        box-shadow var(--ra-dur-fast) var(--ra-ease),
        transform var(--ra-dur-fast) var(--ra-ease);
}

.form-control:hover:not(:disabled):not([readonly]),
.form-select:hover:not(:disabled) {
    border-color: rgba(109, 40, 217, 0.32);
    background-color: #fff;
}

.form-control:focus,
.form-select:focus {
    transform: translateY(-1px);
}

.form-control:disabled,
.form-select:disabled {
    background: #f3f0f7;
    color: var(--ra-muted);
    cursor: not-allowed;
}

.form-control[readonly],
.form-control:read-only:not(textarea) {
    background:
        linear-gradient(180deg, rgba(250, 248, 253, 0.96), rgba(244, 240, 249, 0.96));
    color: var(--ra-ink-soft);
    border-color: var(--ra-line);
}

.form-control::placeholder,
textarea.form-control::placeholder {
    color: #9d94ad;
}

.form-label {
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    line-height: 1.25;
}

.form-text,
.invalid-feedback,
.validation-message {
    font-size: 0.8rem;
    line-height: 1.35;
}

.validation-message,
.invalid-feedback {
    margin-top: 0.35rem;
    color: #b4233f;
}

.input-group {
    align-items: stretch;
}

.input-group > .form-control,
.input-group > .form-select {
    min-width: 0;
}

.modal-content {
    overflow: hidden;
}

.modal-header {
    gap: 1rem;
    padding: 1rem 1.2rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 248, 253, 0.94));
}

.modal-title {
    color: var(--ra-ink);
    font-size: clamp(1.18rem, 2vw, 1.48rem);
    line-height: 1.1;
    letter-spacing: 0;
}

.modal-body {
    padding: 1.15rem 1.2rem;
    scrollbar-color: rgba(109, 40, 217, 0.25) transparent;
}

.modal-footer {
    gap: 0.6rem;
    padding: 0.9rem 1.2rem;
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid var(--ra-line);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.modal-dialog-scrollable .modal-footer,
.modal-content > .modal-footer,
.ra-workflow-form > .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 3;
}

.modal-body .card {
    border-color: var(--ra-line);
    border-radius: 12px;
    box-shadow: var(--ra-shadow-sm) !important;
}

.modal-body .card-header {
    background: rgba(250, 248, 253, 0.82);
    border-bottom-color: var(--ra-line);
}

.ra-workflow-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.ra-workflow-step {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.65rem;
    row-gap: 0.1rem;
    align-items: center;
    min-width: 0;
    padding: 0.78rem 0.85rem;
    border: 1px solid var(--ra-line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
}

.ra-workflow-step span {
    grid-row: span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: var(--ra-primary-soft);
    color: var(--ra-primary-active);
    font-weight: 800;
    font-size: 0.8rem;
}

.ra-workflow-step strong {
    color: var(--ra-ink);
    font-size: 0.88rem;
    line-height: 1.15;
}

.ra-workflow-step small {
    color: var(--ra-muted);
    font-size: 0.75rem;
    line-height: 1.2;
}

.ra-workflow-step.is-active {
    border-color: rgba(109, 40, 217, 0.28);
    background:
        linear-gradient(135deg, rgba(246, 239, 255, 0.98), rgba(255, 255, 255, 0.94));
    box-shadow: 0 12px 26px rgba(109, 40, 217, 0.08);
}

.ra-workflow-form {
    display: grid;
    gap: 0.82rem;
}

.ra-workflow-form > .modal-body {
    display: grid;
    gap: 0.82rem;
}

.ra-workflow-form > .row,
.ra-workflow-form > .mb-3,
.ra-workflow-form > .modal-body > .row,
.ra-workflow-form > .modal-body > .mb-3 {
    margin: 0 !important;
    padding: 0.9rem;
    border: 1px solid var(--ra-line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.74);
    transition:
        background-color var(--ra-dur-fast) var(--ra-ease),
        border-color var(--ra-dur-fast) var(--ra-ease),
        box-shadow var(--ra-dur-fast) var(--ra-ease);
}

.ra-workflow-form > .row:hover,
.ra-workflow-form > .mb-3:hover,
.ra-workflow-form > .modal-body > .row:hover,
.ra-workflow-form > .modal-body > .mb-3:hover,
.ra-workflow-form > .row:focus-within,
.ra-workflow-form > .mb-3:focus-within,
.ra-workflow-form > .modal-body > .row:focus-within,
.ra-workflow-form > .modal-body > .mb-3:focus-within {
    border-color: rgba(109, 40, 217, 0.24);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 24px rgba(32, 18, 51, 0.06);
}

.ra-workflow-form .mb-3:last-child {
    margin-bottom: 0 !important;
}

.ra-allocation-summary {
    border-color: rgba(109, 40, 217, 0.18) !important;
    background:
        linear-gradient(135deg, rgba(246, 239, 255, 0.96), rgba(255, 255, 255, 0.96));
}

.ra-allocation-summary .card-header {
    color: var(--ra-primary-active) !important;
    background: transparent !important;
    border-bottom-color: rgba(109, 40, 217, 0.15);
}

.ra-allocation-workbench > [class*="col-"] > .card {
    height: 100%;
}

.ra-allocation-workbench .card-body {
    scrollbar-color: rgba(109, 40, 217, 0.25) transparent;
}

.ra-allocation-workbench .card.mb-2 {
    transition:
        border-color var(--ra-dur-fast) var(--ra-ease),
        box-shadow var(--ra-dur-fast) var(--ra-ease),
        transform var(--ra-dur-fast) var(--ra-ease);
}

.ra-allocation-workbench .card.mb-2:hover {
    border-color: rgba(109, 40, 217, 0.28);
    box-shadow: 0 12px 26px rgba(32, 18, 51, 0.07) !important;
    transform: translateY(-1px);
}

.table-responsive {
    scrollbar-color: rgba(109, 40, 217, 0.25) transparent;
}

.table tbody tr {
    transition:
        background-color var(--ra-dur-fast) var(--ra-ease),
        box-shadow var(--ra-dur-fast) var(--ra-ease);
}

.table tbody tr:hover {
    background-color: rgba(246, 239, 255, 0.48);
}

@media (max-width: 768px) {
    .ra-workflow-steps {
        grid-template-columns: 1fr;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-inline: 1rem;
    }

    .modal-footer .btn {
        flex: 1 1 11rem;
    }
}

body.modal-open .bottom-nav {
    opacity: 0;
    transform: translateY(110%);
    pointer-events: none;
}

@media (max-width: 576px) {
    .modal.show {
        padding: 0.65rem !important;
        overflow-y: hidden;
    }

    .modal.show .modal-dialog {
        display: flex;
        align-items: stretch;
        width: 100%;
        max-width: none;
        min-height: calc(100dvh - 1.3rem);
        margin: 0 !important;
    }

    .modal.show .modal-content {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-height: calc(100dvh - 1.3rem);
    }

    .modal.show .modal-content > form.ra-workflow-form,
    .modal.show .modal-content > .ra-workflow-form {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
    }

    .modal.show .modal-body,
    .modal.show .ra-workflow-form > .modal-body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal.show .modal-footer,
    .modal.show .ra-workflow-form > .modal-footer {
        flex-shrink: 0;
    }

    .modal-title {
        font-size: clamp(1.22rem, 6vw, 1.55rem);
    }

    .ra-workflow-form > .modal-body > .row,
    .ra-workflow-form > .modal-body > .mb-3,
    .ra-workflow-form > .row,
    .ra-workflow-form > .mb-3 {
        padding: 0.82rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ra-route-armed .route-shell-cinematic,
    body.ra-route-armed .route-shell-stage,
    .ra-allocation-workbench .card.mb-2:hover,
    .form-control:focus,
    .form-select:focus,
    .btn:not(:disabled):active {
        transform: none !important;
        filter: none !important;
    }

    body.ra-route-armed .route-shell-stage {
        opacity: 1 !important;
    }
}
body.ra-route-armed .route-shell-cinematic {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) scale(1) !important;
}

body.ra-route-armed .route-shell-stage {
    opacity: 0.72 !important;
    transform: translate3d(8px, 0, 0) scale(0.997) !important;
    filter: saturate(0.97) !important;
}

body.modal-open .route-shell,
body.modal-open .route-shell.is-route-cinematic,
body.modal-open .route-shell.is-route-armed,
body.modal-open .route-shell.is-routing {
    isolation: auto !important;
}

body.modal-open .route-shell-stage,
body.modal-open.ra-route-armed .route-shell-stage,
body.modal-open .route-shell.is-route-cinematic .route-shell-stage,
body.modal-open .route-shell.is-route-armed .route-shell-stage,
body.modal-open .route-shell.is-routing .route-shell-stage {
    z-index: auto !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
    will-change: auto !important;
    pointer-events: auto !important;
}

body.modal-open .route-shell-stage::before {
    opacity: 0 !important;
    animation: none !important;
}
