:root {
    --bs-body-bg: #ffffff;
    --bs-body-color: #1e293b;
    --bs-dropdown-bg: #ffffff;
    --bs-dropdown-color: #1e293b;
    --bs-dropdown-border-color: #cbd5e1;
    --bs-dropdown-link-hover-bg: #f1f5f9;
    --bs-dropdown-link-active-bg: #1b6ec2;
    --bs-dropdown-link-active-color: #ffffff;
    --dxbl-accent-color: #1b6ec2;
    --tw-navy: #110e2d;
    --tw-charcoal: #1a1a27;
    --tw-surface-dark: #1e1e2d;
    --tw-primary: #1b6ec2;
    --tw-steel: #446e9b;
    --tw-link: #0071c1;
    --tw-accent: #babc00;
}

html, body {
    font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

/* Traders Warehouse Top Header Bar matching Backoffice */
.tw-header-gradient {
    background: linear-gradient(109.6deg, rgba(17, 14, 45, 1) 12%, rgba(26, 26, 39, 1) 62%, rgba(68, 110, 155, 1) 100%);
    border-bottom: 3px solid #babc00;
}

/* Traders Warehouse Login Backdrop & Card matching https://bo.traderswarehouse.co.za/ */
.tw-login-backdrop {
    background: linear-gradient(135deg, #f0f2f5 0%, #e0e5ec 100%);
    min-height: 100vh;
}

.tw-login-card {
    max-width: 450px;
    width: 92%;
    padding: 28px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
    background-color: #ffffff;
    border-top: 4px solid #1b6ec2;
}

/* Solid Opaque DevExpress Dropdowns, ComboBoxes, Date/Time Pickers & Popups */
dxbl-dropdown,
.dxbl-dropdown,
.dxbl-dropdown-body,
.dxbl-dropdown-dialog,
.dxbl-list-box,
.dxbl-list-box-render-container,
.dxbl-list-box-scrollable-container,
.dxbl-calendar,
.dxbl-calendar-body,
.dxbl-time-edit,
.dxbl-roller,
.dxbl-modal-content,
.dxbl-popup-body,
.dropdown-menu {
    background-color: #ffffff !important;
    color: #1e293b !important;
    opacity: 1 !important;
}

.dxbl-dropdown,
.dxbl-dropdown-body,
.dropdown-menu {
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.18), 0 8px 10px -6px rgba(15, 23, 42, 0.1) !important;
    z-index: 2050 !important;
}

.dxbl-list-box-item {
    background-color: #ffffff !important;
    color: #1e293b !important;
    padding: 0.45rem 0.75rem !important;
}

.dxbl-list-box-item:hover,
.dxbl-list-box-item-focused {
    background-color: #eff6ff !important;
    color: #1b6ec2 !important;
}

.dxbl-list-box-item-selected {
    background-color: #1b6ec2 !important;
    color: #ffffff !important;
}

/* DevExpress Grid & Control Refinements */
.dxbl-grid {
    border-radius: 0.5rem;
    border-color: #cbd5e1 !important;
    font-size: 0.875rem;
    background-color: #ffffff !important;
}

.dxbl-grid-header-row {
    background-color: #f8fafc !important;
    color: #1e293b !important;
    font-weight: 600 !important;
}

#blazor-error-ui {
    background: linear-gradient(90deg, #110e2d 0%, #1e1e2d 100%);
    color: #f8fafc;
    border-top: 3px solid #ef4444;
    bottom: 0;
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.35);
    display: none;
    left: 0;
    padding: 0.75rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 2500;
    font-size: 0.85rem;
}

#blazor-error-ui a.reload {
    color: #babc00;
    font-weight: 600;
    margin-left: 0.75rem;
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1.25rem;
    top: 0.7rem;
    color: #94a3b8;
}

/* ==========================================================================
   Traders Warehouse Enterprise WASM Splash / Loading Screen
   ========================================================================== */
.tw-splash-screen {
    position: fixed;
    inset: 0;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 0%, rgba(27, 110, 194, 0.22) 0%, transparent 55%),
                radial-gradient(circle at 85% 90%, rgba(186, 188, 0, 0.12) 0%, transparent 45%),
                linear-gradient(135deg, #0d0b24 0%, #141422 50%, #1a2333 100%);
    color: #f8fafc;
    padding: 1.5rem;
    z-index: 9999;
    overflow: hidden;
}

.tw-splash-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.85) 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.85) 20%, transparent 75%);
    pointer-events: none;
}

.tw-splash-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: rgba(26, 26, 39, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2.5rem 2.25rem 2rem;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    text-align: center;
    overflow: hidden;
    animation: tw-card-enter 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tw-splash-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1b6ec2 0%, #38bdf8 45%, #babc00 100%);
}

.tw-splash-logo-wrap {
    position: relative;
    width: 108px;
    height: 108px;
    margin: 0 auto 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tw-splash-ring-outer {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    border: 2px solid rgba(255, 255, 255, 0.07);
    border-top-color: #1b6ec2;
    border-right-color: rgba(27, 110, 194, 0.4);
    animation: tw-spin 1.8s linear infinite;
}

.tw-splash-ring-inner {
    position: absolute;
    inset: 7px;
    border-radius: 9999px;
    border: 2px dashed rgba(186, 188, 0, 0.35);
    border-bottom-color: #babc00;
    animation: tw-spin-reverse 3.2s linear infinite;
}

.tw-splash-logo-badge {
    width: 78px;
    height: 78px;
    border-radius: 9999px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    position: relative;
    z-index: 2;
}

.tw-splash-logo-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tw-splash-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: rgba(186, 188, 0, 0.14);
    border: 1px solid rgba(186, 188, 0, 0.35);
    color: #d9dc2b;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    margin-bottom: 0.65rem;
}

.tw-splash-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background-color: #babc00;
    box-shadow: 0 0 8px #babc00;
    animation: tw-pulse 1.5s ease-in-out infinite;
}

.tw-splash-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    margin: 0 0 0.25rem;
}

.tw-splash-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0 0 1.5rem;
}

.tw-splash-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
}

.tw-splash-percentage::after {
    content: var(--blazor-load-percentage-text, "Initializing...");
    color: #38bdf8;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.tw-splash-progress-track {
    width: 100%;
    height: 7px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.tw-splash-progress-bar {
    height: 100%;
    width: var(--blazor-load-percentage, 18%);
    background: linear-gradient(90deg, #1b6ec2 0%, #38bdf8 60%, #babc00 100%);
    border-radius: 9999px;
    transition: width 0.2s ease-out;
    position: relative;
    overflow: hidden;
}

.tw-splash-progress-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.45) 50%,
        transparent 100%
    );
    animation: tw-shimmer 1.4s infinite;
}

.tw-splash-modules {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tw-splash-module-item {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.5rem 0.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.tw-splash-module-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

.tw-splash-footer {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.72rem;
    color: #64748b;
    letter-spacing: 0.03em;
}

@keyframes tw-spin {
    to { transform: rotate(360deg); }
}

@keyframes tw-spin-reverse {
    to { transform: rotate(-360deg); }
}

@keyframes tw-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes tw-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

@keyframes tw-card-enter {
    0% { opacity: 0; transform: translateY(10px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}