/* ====================================================================== */
/* Blazor / Radzen Base */
/* ====================================================================== */

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    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;
    }

:root {
    font-size: var(--rz-root-font-size);
}

body {
    margin: 0;
    font-family: var(--rz-text-font-family);
    color: var(--rz-text-color);
    font-size: var(--rz-body-font-size);
    line-height: var(--rz-body-line-height);
    background-color: var(--rz-body-background-color);
}

.rz-body {
    --rz-body-padding: 0;
}

a {
    color: var(--rz-link-color);
}

    a:hover,
    a:focus {
        color: var(--rz-link-hover-color);
    }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* ====================================================================== */
/* Blazor Loading */
/* ====================================================================== */

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text::after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

/* ====================================================================== */
/* Application Shell */
/* ====================================================================== */

.im-app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #F6F8FB;
    color: #07142F;
}

.im-main {
    flex: 1 0 auto;
    min-height: 0;
    overflow: hidden;
}

.im-page {
    padding: 0;
}

/* ====================================================================== */
/* Top Navigation */
/* ====================================================================== */

.im-topbar {
    height: 68px;
    flex: 0 0 auto;
    padding: 0 28px;
    display: grid;
    grid-template-columns: 260px minmax(340px, 820px) minmax(460px, 1fr) 260px;
    align-items: center;
    gap: 22px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #E5E9F2;
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
}

.im-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-self: start;
    color: #0F233E;
    text-decoration: none;
    white-space: nowrap;
    min-width: 0;
}

    .im-brand:hover {
        color: #0F233E;
        text-decoration: none;
    }

.im-logo {
    height: 64px;
    width: auto;
    display: block;
    flex: 0 0 auto;
}

.im-brand-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.035em;
    color: #07142F;
    white-space: nowrap;
}

.im-command--empty {
    display: block;
}

.im-command {
    min-width: 0;
    width: 100%;
    justify-self: center;
}

    .im-command .gcb-root {
        width: 100%;
        max-width: 640px;
    }

.im-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
    font-size: 13px;
    white-space: nowrap;
    min-width: 0;
}

    .im-nav a,
    .im-nav-link,
    .im-link {
        position: relative;
        color: #334155;
        text-decoration: none;
        font-weight: 700;
        transition: color 0.15s ease;
        white-space: nowrap;
    }

        .im-nav a:hover,
        .im-nav-link:hover,
        .im-link:hover {
            color: #0F233E;
            text-decoration: none;
        }

        .im-nav a.active,
        .im-nav .im-nav-link.active {
            color: #0F233E;
            font-weight: 800;
        }

            .im-nav a.active::after,
            .im-nav .im-nav-link.active::after {
                content: "";
                position: absolute;
                left: 0;
                right: 0;
                bottom: -5px;
                height: 2px;
                background: #0F233E;
            }

.im-actions {
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 18px;
    white-space: nowrap;
    min-width: 0;
}

@@media (max-width: 1400px) {
    .im-topbar {
        grid-template-columns: 240px minmax(320px, 560px) minmax(360px, 1fr) 230px;
        gap: 18px;
        padding: 0 22px;
    }

    .im-nav {
        gap: 20px;
        font-size: 12px;
    }

    .im-brand-text {
        font-size: 1.2rem;
    }
}

@@media (max-width: 1180px) {
    .im-topbar {
        grid-template-columns: 240px minmax(320px, 1fr) 220px;
    }

    .im-nav {
        display: none;
    }

    .im-command .gcb-root {
        max-width: 560px;
    }
}

@@media (max-width: 820px) {
    .im-topbar {
        height: auto;
        min-height: 68px;
        grid-template-columns: 1fr auto;
        gap: 12px;
        padding: 14px 20px;
    }

    .im-command {
        display: none;
    }

    .im-brand {
        justify-self: start;
    }

    .im-actions {
        justify-self: end;
    }
}

/* ====================================================================== */
/* Account Split Button */
/* ====================================================================== */

.im-account-button,
.im-account-button .rz-button,
.im-account-button .rz-splitbutton-menubutton {
    background: #FFFFFF !important;
    color: #0F233E !important;
    border-color: #D8E1EC !important;
    box-shadow: none !important;
}

    .im-account-button .rz-button {
        border-radius: 4px 0 0 4px !important;
        font-weight: 850 !important;
        letter-spacing: .03em;
        text-transform: uppercase;
    }

    .im-account-button .rz-splitbutton-menubutton {
        border-left: 1px solid #D8E1EC !important;
        border-radius: 0 4px 4px 0 !important;
    }

        .im-account-button .rz-button:hover,
        .im-account-button .rz-splitbutton-menubutton:hover {
            background: #F6F8FB !important;
            color: #0F233E !important;
            border-color: #B8C7D9 !important;
        }

    .im-account-button .rz-button-icon-left,
    .im-account-button .rz-button-icon {
        color: #0F233E !important;
    }

/* ====================================================================== */
/* Footer */
/* ====================================================================== */

.im-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 28px;
    border-top: 1px solid #E5EAF2;
    background: #FFFFFF;
}

.im-footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.im-footer-logo {
    height: 32px;
    width: 32px;
    object-fit: contain;
    display: block;
    flex: 0 0 auto;
}

.im-footer-copyright {
    color: #64748B;
    font-size: 11px;
    font-weight: 600;
}

.im-footer-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

    .im-footer-nav a {
        color: #334155;
        font-size: 12px;
        font-weight: 750;
        text-decoration: none;
    }

        .im-footer-nav a:hover {
            color: #0F233E;
            text-decoration: underline;
        }

/* ====================================================================== */
/* Generic Buttons */
/* ====================================================================== */

.im-button {
    padding: 10px 18px;
    border-radius: 999px;
    background: #0F233E;
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: background-color 0.15s ease;
}

    .im-button:hover {
        background: #07142F;
        color: #FFFFFF;
    }

/* ====================================================================== */
/* Section Navigation */
/* ====================================================================== */

.im-section-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: #FFFFFF;
    border-bottom: 1px solid #E5E9F2;
}

.im-section-nav-link {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 6px;
    color: #17233F;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

    .im-section-nav-link:hover {
        background: #F1F4F9;
        color: #0F233E;
    }

.im-section-nav-link--active,
.im-section-nav-link--active:hover {
    background: #07142F;
    color: #FFFFFF;
}

/* ====================================================================== */
/* Content Shell / Placeholder Pages */
/* ====================================================================== */

.im-content-shell {
    padding: 24px;
}

.im-content-header {
    margin-bottom: 18px;
}

.im-content-eyebrow {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1D4ED8;
}

.im-content-header h2 {
    margin: 4px 0 6px 0;
    color: #07142F;
    font-size: 26px;
    font-weight: 850;
    letter-spacing: -0.03em;
}

.im-content-header p {
    margin: 0;
    color: #516078;
    font-size: 14px;
    line-height: 1.5;
}

.im-placeholder-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.im-placeholder-card {
    min-height: 160px;
}

    .im-placeholder-card h3 {
        margin: 0 0 8px 0;
        color: #07142F;
        font-size: 18px;
        font-weight: 800;
    }

    .im-placeholder-card p {
        color: #516078;
        font-size: 13px;
        line-height: 1.45;
    }

    .im-placeholder-card a {
        font-size: 13px;
        font-weight: 800;
        color: #1D4ED8;
        text-decoration: none;
    }

/* ====================================================================== */
/* Market Overview Panels */
/* ====================================================================== */

.im-market-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.im-overview-panel {
    min-height: 270px;
    padding: 18px;
    background: #FFFFFF;
    border: 1px solid #DFE5EE;
    border-radius: 2px;
    box-shadow: 0 3px 10px rgba(2, 6, 23, 0.06);
}

.im-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.im-panel-eyebrow {
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1D4ED8;
}

.im-panel-header h3 {
    margin: 4px 0 5px 0;
    color: #07142F;
    font-size: 20px;
    font-weight: 850;
    letter-spacing: -0.025em;
}

.im-panel-header p {
    margin: 0;
    color: #516078;
    font-size: 13px;
    line-height: 1.45;
}

.im-panel-link {
    flex: 0 0 auto;
    color: #1D4ED8;
    text-decoration: none;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

/* ====================================================================== */
/* Market Tape */
/* ====================================================================== */

.im-tape {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.im-tape-row {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) 90px 54px;
    gap: 12px;
    align-items: center;
    padding: 11px 12px;
    border: 1px solid #EEF2F6;
    border-radius: 2px;
    background: #FFFFFF;
}

    .im-tape-row:nth-child(even) {
        background: #FCFDFE;
    }

.im-tape-issuer {
    color: #07142F;
    font-size: 12px;
    font-weight: 900;
}

.im-tape-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .im-tape-main strong {
        color: #07142F;
        font-size: 13px;
        font-weight: 850;
    }

    .im-tape-main span {
        color: #64748B;
        font-size: 12px;
    }

.im-tape-notional {
    color: #07142F;
    font-size: 13px;
    font-weight: 850;
    text-align: right;
}

.im-tape-time {
    color: #64748B;
    font-size: 12px;
    text-align: right;
}

/* ====================================================================== */
/* Maturity Wall */
/* ====================================================================== */

.im-wall {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 4px;
}

.im-wall-row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) 74px;
    gap: 12px;
    align-items: center;
}

.im-wall-label,
.im-wall-value {
    color: #07142F;
    font-size: 12px;
    font-weight: 850;
}

.im-wall-value {
    text-align: right;
}

.im-wall-bar-shell {
    height: 14px;
    border-radius: 999px;
    background: #E2E8F0;
    overflow: hidden;
}

.im-wall-bar {
    height: 100%;
    border-radius: 999px;
    background: #2563EB;
}

/* ====================================================================== */
/* Market Themes / League Leaders */
/* ====================================================================== */

.im-theme-grid,
.im-leaders-grid {
    display: grid;
    gap: 12px;
}

.im-theme-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.im-leaders-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.im-theme-card {
    min-height: 128px;
    padding: 14px;
    border-radius: 2px;
    background: #0F233E;
    border: 1px solid #1E2E4D;
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.im-theme-name {
    font-size: 13px;
    font-weight: 850;
}

.im-theme-change {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: #F8FAFC;
}

.im-theme-meta {
    color: #CBD5E1;
    font-size: 12px;
    font-weight: 700;
}

.im-leader-card {
    min-height: 142px;
    padding: 14px;
    border-radius: 2px;
    border: 1px solid #DCE8F8;
    background: #FFFFFF;
}

.im-leader-rank {
    color: #1D4ED8;
    font-size: 12px;
    font-weight: 900;
}

.im-leader-name {
    margin-top: 16px;
    color: #07142F;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.2;
}

.im-leader-value {
    margin-top: 8px;
    color: #07142F;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.im-leader-label {
    margin-top: 4px;
    color: #64748B;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ====================================================================== */
/* Workspace Page Shells */
/* Use on dense application pages that should occupy the viewport while
   allowing internal panels to scroll independently.
   (Product Details, Issuer Workspace, Analysis, etc.)
/* ====================================================================== */

body:has(.im-workspace-page) {
    overflow: hidden;
}

.im-workspace-page {
    height: calc(100dvh - 68px - 77px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.im-workspace-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.im-workspace-fill {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.im-workspace-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

@media (max-width: 1280px) {

    body:has(.im-workspace-page) {
        overflow: auto;
    }

    .im-workspace-page {
        height: auto;
        overflow: visible;
    }

    .im-workspace-content,
    .im-workspace-fill,
    .im-workspace-scroll {
        overflow: visible;
    }
}

/* ====================================================================== */
/* Responsive */
/* ====================================================================== */

@media (max-width: 1200px) {
    .im-topbar {
        grid-template-columns: 260px 1fr 260px;
        padding: 0 24px;
    }

    .im-market-overview-grid {
        grid-template-columns: 1fr;
    }

    .im-theme-grid,
    .im-leaders-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .im-topbar {
        height: auto;
        min-height: 68px;
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px 20px;
    }

    .im-brand,
    .im-actions {
        justify-self: center;
    }

    .im-nav {
        order: 2;
        overflow-x: auto;
        width: 100%;
        justify-content: center;
    }

    .im-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .im-footer-nav {
        flex-wrap: wrap;
    }
}

@media (max-width: 720px) {
    .im-section-nav {
        overflow-x: auto;
    }

    .im-placeholder-grid,
    .im-theme-grid,
    .im-leaders-grid {
        grid-template-columns: 1fr;
    }

    .im-tape-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .im-tape-notional,
    .im-tape-time,
    .im-wall-value {
        text-align: left;
    }

    .im-wall-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}
