html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.8rem;
    height: 100% !important;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

#app, .main-layout, .agent-ui-container {
    height: 100% !important;
    min-height: 100%;
}


h1:focus {
    outline: none;
}

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

.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-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY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UgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 2rem auto 1rem auto;
    filter: drop-shadow(0 4px 12px rgba(196, 0, 82, 0.2));
    animation: pulse 2s ease-in-out infinite;
}

    .loading-progress circle {
        fill: none;
        stroke: #e2e8f0;
        stroke-width: 0.5rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
        transition: all 0.3s ease;
    }

        .loading-progress circle:last-child {
            stroke: url(#progressGradient);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.15s ease-in-out;
            stroke-linecap: round;
        }

.loading-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #64748b;
    letter-spacing: 0.5px;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

code {
    color: #c02d76;
}

.form-floating>.form-control-plaintext::placeholder, .form-floating>.form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating>.form-control-plaintext:focus::placeholder, .form-floating>.form-control:focus::placeholder {
    text-align: start;
}

.loading-logo {
    display: block;
    margin: 15vh auto 2rem auto;
    max-width: 280px;
    height: auto;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.1));
    animation: logoFadeIn 1.2s ease-out;
    transition: all 0.3s ease;
}

@keyframes logoFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Reduce all app element sizes by 20% */
#app {
    font-size: 0.8rem;
}

h1, h2, h3, h4, h5, h6 {
    font-size: 80%;
}

main, .bb-top-row, .content, .form-control, .form-check-input, .validation-message, .blazor-error-boundary, .loading-progress-text, .form-floating, .form-floating>.form-control, .form-floating>.form-control-plaintext {
    font-size: 0.8rem;
}

.form-control, .form-floating>.form-control, .form-floating>.form-control-plaintext {
    padding: 0.32rem 0.64rem;
}

.bb-top-row.px-4, .content.px-4, article.content.px-4 {
    padding-left: 1.28rem !important;
    padding-right: 1.2rem !important;
}

.py-2 {
    padding-top: 0.32rem !important;
    padding-bottom: 0.32rem !important;
}

.card, .card-body, .card-header, .card-footer {
    font-size: 0.8rem;
    padding: 0.64rem;
}

.nav-link, .sidebar, .sidebar .nav-item, .sidebar .nav-link {
    font-size: 0.8rem;
    padding: 0.32rem 0.64rem;
}

/* Home page specific compact styles */
.agent-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.agent-container .card, .agent-container .Card {
    width: 20rem !important;
    font-size: 0.85rem !important;
    padding: 0.75rem !important;
}

.agent-image {
    width: 8rem !important;
    height: 8rem !important;
    object-fit: cover;
    margin: 0.75rem auto 0.75rem auto;
    display: block;
}

.agent-container .metallic-tag {
    font-size: 1em;
    padding: 0.3em 0.6em;
}

.agent-container .list-group-item {
    font-size: 0.85rem !important;
    padding: 0.4rem 0.6rem;
    border: none !important;
}

.agent-container .price, .agent-container .coming-soon, .agent-container .salary {
    font-size: 0.85rem !important;
    padding: 0.4rem 0.6rem !important;
}

.header .logo {
    max-width: 220px !important;
    height: auto !important;
}

/* ---------------- Home Hero (compact) ---------------- */
.home-hero {
    --gap: clamp(.75rem, 2vw, 1.25rem);
    --radius: 22px;
    --grad1: #c40052;
    --grad2: #7a0030;
    --surface: #ffffff;
    --shadow: 0 4px 16px -4px rgba(17, 24, 39, .18), 0 2px 6px -1px rgba(17, 24, 39, .08);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap);
    margin: 1.5rem auto 1.25rem;
    padding: clamp(.9rem, 2.2vw, 1.35rem) clamp(1rem, 2.8vw, 2rem);
    max-width: 1180px;
    background: linear-gradient(95deg, #fff 0%, #fff 40%, rgba(255, 255, 255, .65) 100%);
    border: 1px solid #eaecf0;
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 25%, rgba(196, 0, 82, .15), transparent 55%), radial-gradient(circle at 15% 85%, rgba(122, 0, 48, .12), transparent 60%);
    mix-blend-mode: normal;
    pointer-events: none;
}

.dark .home-hero {
    background: linear-gradient(110deg, #1f2937, #111827);
    border-color: #334155;
}

.hero-text {
    flex: 1 1 460px;
    min-width: 260px;
}

.hero-title {
    font-size: clamp(1.4rem, 2.7vw, 2.15rem);
    line-height: 1.1;
    margin: 0 0 .55rem;
    letter-spacing: .5px;
    background: linear-gradient(90deg, #111827, #4b5563 35%, #c40052 85%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

.dark .hero-title {
    background: linear-gradient(90deg, #f8fafc, #e2e8f0 35%, #ff2d87 75%);
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-sub {
    margin: 0;
    font-size: clamp(.78rem, 1.15vw, .95rem);
    line-height: 1.35;
    max-width: 640px;
    color: #475569;
    font-weight: 500;
}

.dark .hero-sub {
    color: #cbd5e1;
}

.hero-cta {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.cta-primary {
    --btn-pad: clamp(.55rem, .9vw, .75rem) clamp(1rem, 1.4vw, 1.2rem);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: var(--btn-pad);
    font-size: clamp(.72rem, .95vw, .82rem);
    font-weight: 600;
    letter-spacing: .4px;
    border-radius: 14px;
    color: #fff;
    text-decoration: none !important;
    background: linear-gradient(92deg, var(--grad1), var(--grad2));
    box-shadow: 0 6px 18px -6px rgba(196, 0, 82, .55), 0 2px 5px -2px rgba(17, 24, 39, .25);
    min-width: 12rem;
    transition: all .35s cubic-bezier(.4, 0, .2, 1);
}

.cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px -6px rgba(196, 0, 82, .62), 0 3px 6px -2px rgba(17, 24, 39, .35);
}

.cta-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px -4px rgba(196, 0, 82, .6), 0 2px 4px -2px rgba(17, 24, 39, .3);
}

.cta-primary:focus-visible {
    outline: 3px solid rgba(196, 0, 82, .55);
    outline-offset: 3px;
}

.cta-note {
    font-size: clamp(.62rem, .85vw, .7rem);
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: .4rem .6rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    letter-spacing: .3px;
}

.dark .cta-note {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

@media (max-width:860px) {
    .home-hero {
        flex-direction: column;
        text-align: center;
    }

    .hero-text {
        flex: 1 1 auto;
    }

    .hero-sub {
        margin: 0 auto;
    }

    .hero-cta {
        justify-content: center;
    }
     .agent-container .card, .agent-container .Card {
        width: 100% !important;
        font-size: 0.85rem !important;
        padding: 0.75rem !important;
    }
}

@media (max-width:540px) {
    .home-hero {
        padding: 1rem 1rem 1.15rem;
    }

    .cta-primary {
        min-width: 100%;
        justify-content: center;
    }
}


/* ------------------------------------------------------------
    Consolidated Sidebar / Navigation Overrides
    (Moved from former layout-overrides.css for single-bundle simplicity)
    Rationale: Keep a single global stylesheet loaded early; selectors rely
    on structural classes & are order-safe placed at file end for precedence.
------------------------------------------------------------- */
/* Base link reset for our nav items */
.app-shell a {
    text-decoration: none !important;
}

a.nav-item {
    --accent: #c40052;
    --accent-rgb: 196, 0, 82;
    text-decoration: none !important;
    color: #5d6b7b;
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .78rem;
    padding: .5rem .85rem;
    border-radius: 8px;
    position: relative;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: .15px;
}

a.nav-item:hover {
    background: #eef2f6;
    color: #1f2a37;
}

a.nav-item.active {
    background: rgba(196, 0, 82, .08);
    color: #1f2a37;
    box-shadow: 0 0 0 1px rgba(196, 0, 82, .25), 0 1px 2px rgba(0, 0, 0, .06);
}

a.nav-item.active::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #c40052;
    border-radius: 3px;
}

/* Collapse width enforcement */
.app-shell.collapsed .app-sidebar {
    width: 60px !important;
    flex: 0 0 60px !important;
}

.app-shell.collapsed .product-name, .app-shell.collapsed .version-badge, .app-shell.collapsed a.nav-item .label {
    display: none !important;
}

.app-shell.collapsed a.nav-item {
    justify-content: center;
    gap: 0;
    padding: .55rem 0;
}

/* Tooltip flyout when collapsed */
.app-shell.collapsed a.nav-item[data-label]:hover::after {
    content: attr(data-label);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #111827;
    color: #fff;
    font-size: .7rem;
    padding: .4rem .55rem;
    border-radius: 6px;
    margin-left: .55rem;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
    z-index: 200;
}

.app-shell.collapsed a.nav-item[data-label]:hover::before {
    content: "";
    position: absolute;
    left: calc(100% + .25rem);
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    rotate: 45deg;
    background: #111827;
    z-index: 199;
}

/* Focus ring accessibility */
a.nav-item:focus-visible {
    outline: 2px solid rgba(196, 0, 82, .55);
    outline-offset: 2px;
}

/* Guaranteed underline removal */
a.nav-item:link, a.nav-item:visited, a.nav-item:hover, a.nav-item:active {
    text-decoration: none !important;
}

/* Mobile / narrow viewport behavior: slide-out sidebar instead of 60px mini */
@media (max-width: 980px) {
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 120;
        box-shadow: 0 4px 18px -2px rgba(38, 41, 46, .15);
        width: 250px;
        flex: 0 0 250px;
        background: linear-gradient(180deg, #ffffff, #f3f6fa);
        transform: translateX(0);
        transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    }

    /* When collapsed on mobile, fully hide the sidebar off-canvas */
    .app-shell.collapsed .app-sidebar {
        transform: translateX(-102%);
        width: 250px !important;
        flex: 0 0 250px !important;
    }

    /* Restore full nav item layout when expanded on mobile */
    .app-shell:not(.collapsed) a.nav-item {
        justify-content: flex-start;
        gap: .55rem;
        padding: .5rem .85rem;
    }

    /* Ensure toggle (hamburger) button shows */
    .mobile-only {
        display: inline-flex !important;
    }

    /* Prevent the global collapsed mini-width rule from squeezing when hidden */
    /* (Already overridden via width:250px above inside collapsed state) */
}

/* ========================================
   ENHANCED SPLASH SCREEN STYLES
   ======================================== */

/* Enhanced splash screen container - only apply when splash screen is visible */
body.splash-loading #app {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Add subtle background animation - only when splash screen is visible */
body.splash-loading #app::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(196, 0, 82, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(76, 110, 245, 0.05) 0%, transparent 50%);
    animation: backgroundShift 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes backgroundShift {
    0%, 100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1) rotate(1deg);
    }
}

/* Splash screen content wrapper */
.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 10;
    width: 100%;
    max-width: 100%;
    padding: 2rem;
    animation: contentFadeIn 1.5s ease-out;
}

@keyframes contentFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced loading text with gradient */
.loading-status {
    margin-top: 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    background: linear-gradient(90deg, #64748b 0%, #c40052 50%, #64748b 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: textShimmer 3s ease-in-out infinite;
    letter-spacing: 0.5px;
}

@keyframes textShimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Loading dots animation */
.loading-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.5rem;
}

.loading-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #c40052;
    animation: dotBounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Progress container with modern styling */
.progress-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

/* Modern progress bar alternative */
.modern-progress {
    width: 200px;
    height: 4px;
    background: rgba(196, 0, 82, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modern-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    background: linear-gradient(90deg, #c40052, #ff2d87);
    border-radius: 2px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(196, 0, 82, 0.4);
}

/* Responsive design improvements */
@media (max-width: 768px) {
    body.splash-loading #app {
        padding: 1rem;
    }
    
    .loading-logo {
        max-width: 200px;
        margin: 10vh auto 1.5rem auto;
    }
    
    .loading-progress {
        width: 6rem;
        height: 6rem;
        margin: 1.5rem auto 1rem auto;
    }
    
    .loading-status {
        font-size: 0.9rem;
    }
    
    .splash-content {
        padding: 1rem 0.5rem;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .loading-logo {
        max-width: 160px;
        margin: 8vh auto 1rem auto;
    }
    
    .loading-progress {
        width: 5rem;
        height: 5rem;
    }
    
    .loading-status {
        font-size: 0.8rem;
    }
    
    .modern-progress {
        width: 150px;
    }
    
    .splash-content {
        padding: 1rem 0.25rem;
    }
}

@media (min-width: 1200px) {
    .loading-logo {
        max-width: 320px;
        margin: 18vh auto 2.5rem auto;
    }
    
    .loading-progress {
        width: 9rem;
        height: 9rem;
    }
    
    .loading-status {
        font-size: 1.1rem;
    }
}

/* Dark theme support for splash screen */
/* @media (prefers-color-scheme: dark) {
    body.splash-loading #app {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        color: #e2e8f0;
    }
    
    body.splash-loading #app::before {
        background: 
            radial-gradient(circle at 20% 80%, rgba(255, 45, 135, 0.08) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(76, 110, 245, 0.08) 0%, transparent 50%);
    }
    
    .loading-progress circle {
        stroke: #374151;
    }
    
    .loading-status {
        background: linear-gradient(90deg, #94a3b8 0%, #ff2d87 50%, #94a3b8 100%);
        background-size: 200% 100%;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
    
    .modern-progress {
        background: rgba(255, 45, 135, 0.1);
    }
} */
