/* ============================================================================
   Design tokens — single source of truth for the app's visual language.
   The public/auth pages established the brand (navy #173B74, dark-red accent
   #7D0D1B, Helvetica Neue); these carry it into the authenticated app too.
   ============================================================================ */
:root {
    --brand: #173B74;
    --brand-dark: #102a52;
    --brand-light: #1f4a8a;
    --accent: #7D0D1B;
    --accent-dark: #5f0a14;

    --ink: #1f2733;
    --muted: #6c757d;
    --line: #e7ebf2;
    --line-strong: #cfd9e6;
    --surface: #ffffff;
    --bg: #f5f7fb;

    --danger: #dc3545;
    --danger-dark: #b52a37;
    --success: #1f8a4c;
    --success-bg: #e8f5ee;
    --warning: #b06a00;
    --warning-bg: #fdf3e2;
    --info: var(--brand);
    --info-bg: #eef2f9;

    --radius: 8px;
    --radius-lg: 12px;
    --shadow-card: 0 6px 18px rgba(23, 59, 116, 0.06);

    --font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html, body {
    font-family: var(--font-sans);
}

a, .btn-link {
    color: var(--brand);
}

/* Legacy bordered form look, kept behind an opt-in class. The bare `form`
   selector used to force a grey border + flex column onto every form in the
   app (including interactive @onsubmit forms), which pages then had to undo
   with `no-border-form`; scoping it here removes that bleed. */
.legacy-form {
    display: flex;
    border: 3px solid #f1f1f1;
    flex-direction: column;
    align-items: flex-start;
}

input[type=text], input[type=password] {
    width: 100%;
    padding: 12px 20px;
    display: inline-block;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

/* ============================================================================
   Shared button system — one set of roles (primary / secondary / danger /
   ghost) replacing the per-page duplicates (liquidity-btn-*, usd-exposure-btn-*,
   ac-btn-*, cr-btn-pdf, btn-*-custom). Self-contained: does not rely on the
   bare `button` element rule below.
   ============================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: auto;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.55rem 1.25rem;
    margin: 0;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn:disabled, .btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-dark); color: #fff; }

.btn--secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn--secondary:hover:not(:disabled) { background: var(--accent); color: #fff; }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled) { background: var(--danger-dark); color: #fff; }

.btn--ghost { background: transparent; color: var(--brand); border-color: var(--line-strong); }
.btn--ghost:hover:not(:disabled) { background: var(--bg); }

.btn--sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; }
.btn--block { width: 100%; }

/* Bare-element fallback: a neutral, sane default for any unclassed <button>.
   The previous global rule forced white text, full width and a 25% (oval)
   border-radius onto every button, which every page then had to fight. */
button {
    font-family: inherit;
    cursor: pointer;
}

    button:hover {
        opacity: 0.9;
    }

Icon {
    display: inline-block;
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    top: -1px;
    background-size: cover;
}



.cancelbtn {
    width: auto;
    padding: 10px 20px;
    background-color: #929292;
    margin:10px 0px;
    border-radius:8px;
}

.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;
}

.container {
    padding: 16px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    flex-direction: column;
}

.btncontainer {
    padding: 10px;
    display: grid;
    grid-auto-flow: column;
    align-content: center;
    justify-items: center;
    gap:10px;
}

.wrapper {
    display: block;
    flex-wrap: wrap;
    flex-direction: row;
    align-content: center;
    justify-content: space-evenly;
    justify-items: center;
    align-items: center;
    gap:5px !important;
}

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;
}

/*
========== Global Account and Admin page CSS ==========
 */

/* Style each listed file upload */
.persona-upload-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #edf0f2;
    background: transparent;
    border-radius: 0;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    color: inherit;
}

.persona-upload-item:hover {
    background: #f8fbff;
}

.persona-upload-item-selected {
    background: #eef4ff;
}

.persona-upload-title {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    color: #173B74;
    font-size: 0.88rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.persona-upload-meta {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.78rem;
    color: #6c757d;
    margin-top: 0;
}

.persona-upload-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 1rem;
}

.persona-upload-modal {
    width: min(1100px, 100%);
    height: 80vh;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.persona-upload-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #e9ecef;
}

.persona-upload-modal-body {
    padding: 1rem 1.15rem 1.15rem;
    flex: 1;
    min-height: 0;
}

.persona-upload-modal-grid {
    display: grid;
    gap: 1rem;
    max-height: 88%;
}

.persona-upload-modal-detail {
    overflow-y: auto;
    padding-right: 0.25rem;
}

.persona-upload-modal {
    width: min(1100px, 100%);
    height: 80vh;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.persona-upload-modal-body {
    padding: 1rem 1.15rem 1.15rem;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.persona-upload-modal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
}

.persona-upload-modal-grid > :first-child {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.persona-upload-modal-detail {
    overflow-y: auto;
    padding-left: 1.5rem;
    border-left: 1px solid #edf0f2; 
}

.persona-upload-modal-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 900px) {
    .persona-upload-modal-grid {
        grid-template-columns: 1fr;
    }
}

/* The scroll section for upload history */
.persona-upload-scroll {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* The scroll section for upload history specifically in the modal */
.persona-upload-scroll.persona-modal-upload-scroll {
    max-height: 100%;
    flex: 1;
    min-height: 0;
}

/*
========== Media ==========
 */

/* Added to make the label-based file picker match the Forecast "Browse file..." button */
.forecast-form-browse-button {
    border: 1px solid #8f8f9d;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    background-color: #e9e9ed;
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Old versions of Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none;
}

    .forecast-form-browse-button:hover {
        border: 1px solid #73737f;
        border-radius: 8px;
        padding: 0.55rem 0.75rem;
        font-size: 0.95rem;
        outline: none;
        transition: border-color 0.2s, box-shadow 0.2s;
        width: 100%;
        background-color: #d0d0d7;
        -webkit-touch-callout: none; /* iOS Safari */
        -webkit-user-select: none; /* Safari */
        -moz-user-select: none; /* Old versions of Firefox */
        -ms-user-select: none; /* Internet Explorer/Edge */
        user-select: none;
    }

.forecast-form-browse-button-disabled {
    border: 1px solid #d3d3da;
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    background-color: #ececef;
    cursor: not-allowed;
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Old versions of Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none;
}

/* ============================================================================
   Shared forecast table + chart styling. Previously lived in an inline (global)
   <style> block on ForecastDaily; kept global here because ForecastDaily,
   ForecastUsdBalance and ConsolidatedReport all use these classes (scoping them
   to one component would break the other two). Colours use the design tokens.
   ============================================================================ */
.forecast-table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.forecast-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

    .forecast-table thead th {
        padding: 0.6rem 0.75rem;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--muted);
        border-bottom: 2px solid var(--line);
        background: var(--bg);
    }

        .forecast-table thead th:not(:first-child) {
            text-align: right;
        }

    .forecast-table tbody td {
        padding: 0.5rem 0.75rem;
        border-bottom: 1px solid var(--line);
        color: var(--ink);
    }

        .forecast-table tbody td:not(:first-child) {
            text-align: right;
        }

    .forecast-table tbody tr:hover {
        background: var(--bg);
    }

    /* Summary/subtotal row (UX review §2.2) */
    .forecast-table tfoot td {
        padding: 0.6rem 0.75rem;
        border-top: 2px solid var(--line-strong);
        font-weight: 700;
        color: var(--brand);
        background: var(--bg);
    }

        .forecast-table tfoot td:not(:first-child) {
            text-align: right;
        }

/* Frozen header for long forecast tables: the wrapper scrolls, the header row stays put.
   border-collapse hides the sticky header's own borders, so draw them as a box-shadow. */
.forecast-table-wrapper--sticky {
    overflow-y: auto;
    max-height: clamp(320px, 60vh, 680px);
}

    .forecast-table--sticky-head thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        /* var(--bg) is inherited from the base rule but must be opaque here so rows
           scrolling underneath do not show through. */
        background: var(--bg);
        box-shadow: inset 0 -2px 0 var(--line);
    }

/* Prediction interval reads as supporting detail, not a headline figure. */
.forecast-range-cell {
    color: var(--muted);
    white-space: nowrap;
}

.amt-neg {
    color: var(--danger);
}

.amt-pos {
    color: var(--ink);
}

.na-cell {
    color: #ced4da;
    font-style: italic;
}

.forecast-inline-message {
    font-size: 0.85rem;
    color: var(--danger);
    margin-top: 0.75rem;
}

.forecast-foot-note {
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-top: 0.1rem;
}

/* Shared empty / info / error state panel (StatusPanel component, §2.6). */
.status-panel {
    border-radius: var(--radius);
    padding: 1rem 1.15rem;
    margin: 0.75rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.status-panel-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.status-panel--empty {
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--muted);
}

.status-panel--info {
    background: var(--info-bg);
    border: 1px solid var(--line-strong);
    color: var(--brand);
}

.status-panel--warning {
    background: #fdf4e3;
    border: 1px solid #f0d9a8;
    color: #7a5300;
}

.status-panel--error {
    background: #fde8e8;
    border: 1px solid #f9c3c3;
    color: var(--accent);
}

    .status-panel a {
        color: inherit;
        font-weight: 600;
    }

/* Responsive chart height — replaces fixed 650px / 400px wrappers (§2.5). */
.chart-wrapper,
.forecast-chart-wrapper {
    position: relative;
    width: 100%;
    height: clamp(320px, 42vh, 520px);
}

    .chart-wrapper canvas,
    .forecast-chart-wrapper canvas {
        width: 100% !important;
        height: 100% !important;
        display: block;
    }

.usd-exposure-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
}
/* Hide the native input file elements inside the upload wrappers */
.usd-exposure-file-upload input[type="file"],
.liquidity-file-upload input[type="file"] {
    display: none !important;
}

@media(max-width: 700px) {

}

@media(min-width: 701px) {
    .wrapper{
        display:contents;
    }

    .btncontainer{
        display:block;

    }
}

@media print {
    /* Hide nav and chrome */
    .sidebar,
    .top-row,
    .no-print {
        display: none !important;
    }

    /* Allow html/body to grow past viewport height */
    html, body {
        height: auto !important;
        overflow: visible !important;
    }

    /* Switch page layout from flex-row to block so content flows freely */
    .page {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* Main area takes full width and can grow across pages */
    main {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        margin-left: 0 !important;
    }

    article.content {
        height: auto !important;
        overflow: visible !important;
        padding: 0 !important;
    }
}