/* ================================================================
   MIP — Custom overrides on top of Velzon + Bootstrap
   Load order: velzon bootstrap → velzon app → radzen → this file
   ================================================================ */

/* ── Blazor / framework ─────────────────────────────────── */
.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; }
.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; }

/* ── MIP Brand tokens ────────────────────────────────────── */
:root {
    --mip-brand:       #405189;
    --mip-brand-dark:  #2d3a61;
    --mip-accent:      #f7b84b;
    --mip-positive:    #0ab39c;
    --mip-negative:    #f06548;
    --mip-bg:          #f3f3f9;
    --mip-sidebar-w:   320px;
    --mip-topbar-h:    60px;
}

/* ── Base ────────────────────────────────────────────────── */
html, body {
    background: var(--mip-bg);
    font-size: 13px;
}
.fs-11 { font-size: 11px !important; }
.fs-12 { font-size: 12px !important; }

/* ================================================================
   LAYOUT
   ================================================================ */

#mip-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Topbar ──────────────────────────────────────────────── */
#page-topbar {
    position: sticky;
    top: 0;
    z-index: 1002;
    height: var(--mip-topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--vz-border-color, #e9ebec);
    box-shadow: 0 1px 3px rgba(56,65,74,.08);
}

.navbar-header {
    height: var(--mip-topbar-h);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Brand */
.mip-brand { display: flex; align-items: center; flex-shrink: 0; }
.mip-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.mip-brand-logo { height: 34px; width: auto; display: block; }
.mip-brand-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--mip-brand);
    line-height: 1;
}
.mip-brand-sub {
    font-size: 9px;
    color: var(--mip-accent);
    letter-spacing: .1em;
    text-transform: uppercase;
    display: block;
}

/* Top nav links */
.mip-topmenu {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}
.mip-topmenu::-webkit-scrollbar { display: none; }
.mip-topmenu a {
    color: #6c757d;
    font-size: 12px;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.mip-topmenu a:hover { background: #f3f3f9; color: var(--mip-brand); }
.mip-topmenu a.active { color: var(--mip-brand); font-weight: 600; background: #eef1f8; }

/* ── Body (sidebar + main) ───────────────────────────────── */
.mip-body {
    flex: 1;
    display: grid;
    grid-template-columns: var(--mip-sidebar-w) 1fr;
    align-items: start;
    min-height: calc(100vh - var(--mip-topbar-h));
}

/* ── Plain body (Wait List and other standalone sections) ── */
.mip-plain-body { flex: 1; min-height: calc(100vh - var(--mip-topbar-h)); }
.mip-plain-main { padding: 18px 22px; max-width: 1320px; margin: 0 auto; }

/* ── Toast notifications ─────────────────────────────────── */
#mip-toast-container {
    position: fixed; top: 18px; right: 18px; z-index: 1080;
    display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.mip-toast {
    display: flex; align-items: center; gap: 10px;
    min-width: 240px; max-width: 380px;
    background: #fff; color: #33415c;
    border: 1px solid #e2e6ee; border-left: 4px solid var(--mip-positive);
    border-radius: 10px; padding: 12px 16px; font-size: 13.5px;
    box-shadow: 0 12px 28px -10px rgba(30,41,59,.35);
    opacity: 0; transform: translateX(20px); transition: opacity .28s ease, transform .28s ease;
}
.mip-toast.show { opacity: 1; transform: translateX(0); }
.mip-toast i { font-size: 18px; color: var(--mip-positive); }
.mip-toast-error { border-left-color: var(--mip-negative); }
.mip-toast-error i { color: var(--mip-negative); }

/* ── Add-asset modal (Watchlist) ─────────────────────────── */
.mip-aa-dialog { max-width: 640px; }
.mip-aa-modal { border: 0; border-radius: 16px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(15,23,42,.45); }

.mip-aa-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; background: var(--mip-brand); color: #fff;
}
.mip-aa-title { display: flex; flex-direction: column; gap: 2px; }
.mip-aa-title-main { font-size: 18px; font-weight: 700; color: #fff; line-height: 1.2; }
.mip-aa-title-sub  { font-size: 13px; color: rgba(255,255,255,.75); }
.mip-aa-close {
    width: 36px; height: 36px; border: 0; background: rgba(255,255,255,.14); color: #fff;
    border-radius: 10px; font-size: 20px; cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center; transition: background .15s;
}
.mip-aa-close:hover { background: rgba(255,255,255,.28); }

/* Body/footer use standard Bootstrap sizing, matching the New order modal. */
.mip-aa-modal .modal-body { padding: 20px 22px; }
.mip-aa-modal .modal-footer { padding: 14px 22px; }

/* ── Left Sidebar ────────────────────────────────────────── */
.mip-sidebar {
    width: var(--mip-sidebar-w);
    min-height: calc(100vh - var(--mip-topbar-h));
    background: #fff;
    border-right: 1px solid var(--vz-border-color, #e9ebec);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: var(--mip-topbar-h);
    max-height: calc(100vh - var(--mip-topbar-h));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #dee2e6 transparent;
}

/* Performance card */
.mip-perf-card { border: none; box-shadow: none; }
.mip-perf-card .card-header {
    background: linear-gradient(135deg, var(--mip-brand) 0%, #564ab1 100%);
    color: #fff;
    border-radius: 8px 8px 0 0 !important;
    padding: 10px 14px;
    border: none;
}
.mip-perf-card .card-header .text-muted { color: rgba(255,255,255,.75) !important; }
.mip-perf-card .card-header .btn-primary {
    background: rgba(255,255,255,.2);
    border-color: rgba(255,255,255,.35);
    color: #fff;
    font-size: 11px;
}
.mip-perf-card .card-header .btn-primary:hover {
    background: rgba(255,255,255,.35);
}

.mip-perf-pct {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}

/* Stat icon */
.mip-stat-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

/* Sortable table headers */
.mip-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.mip-sortable:hover { background: #eef1f8; }

/* Symbol as a Yahoo Finance link */
.mip-symbol-link {
    text-decoration: none;
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease;
}
.mip-symbol-link:hover {
    background-color: var(--mip-brand) !important;
    color: #fff !important;
}

/* Display-currency toggle */
.mip-ccy-toggle .btn {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 12px;
    line-height: 1.5;
}

/* Stats list */
.mip-stats .list-group-item { border-color: #f0f0f0; }

/* Info tooltip (CSS-only) */
.mip-tip {
    position: relative;
    display: inline-flex;
    cursor: help;
    outline: none;
    z-index: 1;
}
.mip-tip:hover,
.mip-tip:focus-visible {
    z-index: 4000; /* lift the whole trigger above sibling values while shown */
}
.mip-tip-box {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 4000;
    width: max-content;
    max-width: 240px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #2d3a61;
    color: #fff;
    font-size: 11.5px;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-3px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
    pointer-events: none;
}
.mip-tip-box::before {
    content: "";
    position: absolute;
    left: 12px;
    bottom: 100%;
    border: 6px solid transparent;
    border-bottom-color: #2d3a61;
}
.mip-tip:hover .mip-tip-box,
.mip-tip:focus-visible .mip-tip-box {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.mip-tip .mip-stat-icon { cursor: help; }

/* Charts */
.mip-chart-sm { min-height: 160px; }

/* Empty state */
.mip-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 28px 10px;
    color: #adb5bd;
    font-size: 12px;
}
.mip-empty i { font-size: 28px; }

/* ── Main content area ───────────────────────────────────── */
.mip-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Portfolio switcher bar */
.mip-portfolio-bar {
    background: #fff;
    border-bottom: 1px solid var(--vz-border-color, #e9ebec);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    position: sticky;
    top: var(--mip-topbar-h);
    z-index: 100;
}

.mip-portfolio-tabs {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.mip-portfolio-tabs::-webkit-scrollbar { display: none; }

.mip-ptab {
    background: none;
    border: 1px solid transparent;
    border-radius: 20px;
    color: #6c757d;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 14px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .15s, color .15s, border-color .15s;
}
.mip-ptab:hover:not(.active) {
    background: #f3f3f9;
    border-color: #dee2e6;
    color: var(--mip-brand);
}
.mip-ptab.active {
    background: var(--mip-brand);
    border-color: var(--mip-brand);
    color: #fff;
}
.mip-ptab-add {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 12px;
    margin-left: auto;
    flex-shrink: 0;
    color: #6c757d;
}
.mip-ptab.mip-ptab-delete {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 12px;
    color: #c47a85;
}
.mip-ptab.mip-ptab-delete:hover {
    background: #f5e4e7;
    border-color: #ddb8be;
    color: #c47a85;
}

/* Page nav tabs */
.mip-nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 2px;
    background: #fff;
    border-bottom: 2px solid var(--vz-border-color, #e9ebec);
    padding: 0 14px;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
}
.mip-nav-tabs::-webkit-scrollbar { display: none; }

.mip-navtab {
    color: #6c757d;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: 10px 12px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    flex-shrink: 0;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
}
.mip-navtab:hover { color: var(--mip-brand); }
.mip-navtab.active {
    color: var(--mip-brand);
    border-bottom-color: var(--mip-brand);
    font-weight: 600;
}
.mip-navtab-support,
.mip-navtab-support.active {
    color: #fff;
    background: #f06548;
    border-radius: 4px;
    margin: 4px 0;
    padding: 4px 10px;
    border-bottom: 2px solid transparent;
}

/* Page content wrapper */
.mip-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ================================================================
   PAGE COMPONENTS (Home, Portfolio, Income, Operations)
   ================================================================ */

/* Cards */
.card {
    border: 1px solid var(--vz-border-color, #e9ebec);
    border-radius: 8px;
}
.card-header {
    background: #fff;
    border-bottom: 1px solid var(--vz-border-color, #e9ebec);
    border-radius: 8px 8px 0 0 !important;
    padding: 12px 16px;
    font-size: 12px;
}

/* Dashboard grids */
.mip-dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.mip-dash-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Radzen inside cards */
.rz-data-grid { font-size: 12px; }
.rz-card { border: none !important; box-shadow: none !important; }

/* ── Search box ─────────────────────────────────────────── */
.mip-search-box {
    display: flex;
    align-items: center;
    width: 360px;
    height: 36px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    padding: 0 10px;
    gap: 8px;
    transition: border-color .15s, box-shadow .15s;
}
.mip-search-box:focus-within {
    border-color: var(--mip-brand);
    box-shadow: 0 0 0 3px rgba(64,81,137,.1);
}
.mip-search-icon {
    font-size: 16px;
    color: #9aa3af;
    flex-shrink: 0;
}
.mip-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: #495057;
    min-width: 0;
}
.mip-search-input::placeholder { color: #adb5bd; }
.mip-search-clear {
    border: none;
    background: none;
    padding: 0;
    color: #9aa3af;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.mip-search-clear:hover { color: #495057; }

/* ── Rows select ─────────────────────────────────────────── */
.mip-rows-select {
    height: 34px;
    padding: 0 28px 0 10px;
    font-size: 13px;
    color: #495057;
    background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat right 8px center / 12px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    appearance: none;
    cursor: pointer;
    transition: border-color .15s;
    width: 72px;
}
.mip-rows-select:focus {
    outline: none;
    border-color: var(--mip-brand);
    box-shadow: 0 0 0 3px rgba(64,81,137,.1);
}

/* ── Pagination ──────────────────────────────────────────── */
.mip-pagination {
    display: flex;
    align-items: center;
    gap: 3px;
}
.mip-page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    color: #495057;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, border-color .15s, color .15s;
}
.mip-page-btn i { font-size: 17px; line-height: 1; }
.mip-page-btn:hover:not(:disabled):not(.mip-page-active) {
    background: #f3f3f9;
    border-color: var(--mip-brand);
    color: var(--mip-brand);
}
.mip-page-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.mip-page-btn.mip-page-active {
    background: var(--mip-brand);
    border-color: var(--mip-brand);
    color: #fff;
    cursor: default;
}

/* ================================================================
   BOOTSTRAP MODAL OVERRIDES
   ================================================================ */

/* Blur backdrop and tighter sizing on desktop */
.modal.show.d-block {
    backdrop-filter: blur(2px);
}

/* Ensure modal scrolls on small screens */
.modal-dialog {
    margin: 1rem auto;
}
.modal-content {
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(36,44,54,.18);
    border: none;
}
.modal-header {
    padding: 12px 16px 8px;
}
.modal-body {
    padding: 16px;
}
.modal-footer {
    padding: 8px 16px 12px;
    background: #f8f9fa;
    border-radius: 0 0 10px 10px;
}

/* Nav tabs inside modal header (OrderEntryModal Buy/Sell) */
.modal .nav-tabs .nav-link {
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    padding: 7px 16px;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    transition: color .15s, border-color .15s;
}
.modal .nav-tabs .nav-link.active {
    color: var(--mip-brand);
    border-bottom-color: var(--mip-brand);
    font-weight: 600;
    background: transparent;
}
.modal .nav-tabs {
    border-bottom: 1px solid #e9ebec;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}
.modal .nav-tabs::-webkit-scrollbar { display: none; }

/* ── Order entry modal (Buy / Sell) ──────────────────────── */
.mip-order-modal .modal-content { overflow: hidden; }
.mip-order-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px;
    transition: background .2s;
}
.mip-order-header.is-buy  { background: linear-gradient(135deg, #0ab39c, #099885); }
.mip-order-header.is-sell { background: linear-gradient(135deg, #f06548, #d94d33); }
.mip-order-toggle {
    display: inline-flex; background: rgba(255,255,255,.22);
    border-radius: 9px; padding: 3px; gap: 3px;
}
.mip-order-tab {
    border: none; background: transparent; color: #fff;
    font-weight: 600; font-size: 14px; padding: 8px 22px;
    border-radius: 7px; cursor: pointer;
    display: inline-flex; align-items: center;
    transition: background .15s, color .15s;
}
.mip-order-tab:hover { background: rgba(255,255,255,.16); }
.mip-order-tab.active { background: #fff; }
.mip-order-header.is-buy  .mip-order-tab.active { color: #0ab39c; }
.mip-order-header.is-sell .mip-order-tab.active { color: #f06548; }

.mip-order-modal .modal-body { padding: 20px; }
.mip-order-modal .form-label { font-size: 13px; margin-bottom: 4px; }
.mip-order-modal .form-control,
.mip-order-modal .form-select { padding: .55rem .8rem; font-size: 14px; height: auto; }
.mip-order-modal .modal-footer { padding: 12px 18px; background: #f8f9fa; }
.mip-order-modal .modal-footer .btn { padding: .5rem 1.1rem; font-weight: 500; }

.mip-order-quote {
    background: #f3f6fb; border: 1px solid #e4e9f2;
    border-radius: 8px; padding: 10px 12px;
}
.mip-order-price { font-weight: 700; color: var(--mip-brand); }

/* ================================================================
   AUTH PAGES
   ================================================================ */
/* The Identity login/forgot-password/etc. forms post back to the server
   (required so ASP.NET Core Identity can write the auth cookie on the
   raw HTTP response), so this is a real cross-document navigation, not
   a Blazor enhanced-nav patch. This opts supporting browsers (Chromium)
   into a cross-document view transition so the reload cross-fades
   instead of flashing white. */
@view-transition {
    navigation: auto;
}

.auth-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    background: linear-gradient(135deg, #eef1fa 0%, #dfe6f5 45%, #eef2fb 100%);
}
.auth-shell::before,
.auth-shell::after {
    content: "";
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .5;
    pointer-events: none;
}
.auth-shell::before {
    width: 420px; height: 420px; top: -140px; left: -120px;
    background: radial-gradient(circle at 30% 30%, var(--mip-brand), transparent 70%);
}
.auth-shell::after {
    width: 380px; height: 380px; bottom: -160px; right: -100px;
    background: radial-gradient(circle at 70% 70%, var(--mip-accent), transparent 70%);
}

.auth-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    width: 100%;
    animation: auth-rise .45s ease both;
}
@keyframes auth-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-brand      { display: flex; align-items: center; justify-content: center; }
.auth-brand-logo { height: 76px; width: auto; filter: drop-shadow(0 6px 14px rgba(64,81,137,.18)); }

.auth-card {
    position: relative;
    width: min(100%, 440px);
    background: #fff;
    border: 1px solid #e9ebec;
    border-radius: 16px;
    padding: 34px 30px 30px;
    box-shadow: 0 20px 45px -12px rgba(36,44,84,.18), 0 2px 8px rgba(36,44,54,.06);
    overflow: hidden;
}
.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--mip-brand), var(--mip-accent));
}

.auth-login-header   { text-align: center; }
.auth-login-header h1 { font-size: 21px; font-weight: 700; margin-bottom: 4px; color: var(--mip-brand); outline: none; box-shadow: none; border: none; }
.auth-login-header p  { color: #6c757d; margin-bottom: 22px; font-size: 13px; }

.auth-field { position: relative; }
.auth-field .auth-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #98a1b3;
    font-size: 16px;
    z-index: 4;
    pointer-events: none;
    transition: color .15s;
}
.auth-field .form-control.auth-input             { padding-left: 42px; }
.auth-field .form-control.auth-input ~ label     { left: 42px; }
.auth-field .form-control.auth-input:focus       { border-color: var(--mip-brand); box-shadow: 0 0 0 .2rem rgba(64,81,137,.12); }
.auth-field .form-control.auth-input:focus ~ .auth-field-icon { color: var(--mip-brand); }

/* Blazor marks inputs valid/modified while the user is still typing —
   suppress the global green outline here; flag only the invalid state. */
.auth-field .form-control.auth-input.valid.modified:not([type=checkbox]) { outline: none; }
.auth-field .form-control.auth-input.invalid {
    outline: none;
    border-color: var(--mip-negative);
}
.auth-field .form-control.auth-input.invalid:focus { box-shadow: 0 0 0 .2rem rgba(240,101,72,.12); }
.auth-field .form-control.auth-input.invalid ~ .auth-field-icon { color: var(--mip-negative); }
.auth-field .validation-message { display: block; margin-top: 4px; font-size: 12px; color: var(--mip-negative); }

.auth-login-actions   { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; font-size: 12.5px; }
.auth-login-actions a { color: var(--mip-brand); font-weight: 600; text-decoration: none; }
.auth-login-actions a:hover { text-decoration: underline; }
.auth-checkbox        { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }

.auth-submit {
    width: 100%;
    background: var(--mip-positive);
    border: 1px solid var(--mip-positive);
    color: #fff;
    border-radius: 8px;
    padding: 11px 0;
    font-weight: 600;
    letter-spacing: .01em;
    box-shadow: 0 8px 18px -8px rgba(10,179,156,.55);
    transition: background-color .15s, transform .1s, box-shadow .15s;
}
.auth-submit:hover:not(:disabled)  { background: #099885; border-color: #099885; color: #fff; transform: translateY(-1px); }
.auth-submit:active:not(:disabled) { transform: translateY(0); }
.auth-submit:disabled              { opacity: .75; cursor: progress; }

/* Velzon-style plain fields (label above input) */
.auth-field-label { display: block; font-size: 13px; font-weight: 600; color: #495057; margin-bottom: 6px; }
.auth-field-labelrow { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.auth-field-labelrow .auth-field-label { margin-bottom: 0; }
.auth-field-link { font-size: 12.5px; color: #6c757d; text-decoration: none; }
.auth-field-link:hover { color: var(--mip-brand); text-decoration: underline; }
.auth-input-plain {
    width: 100%; border: 1px solid #ced4da; border-radius: 8px;
    padding: 10px 12px; font-size: 14px; background: #fff; color: #212529;
    transition: border-color .15s, box-shadow .15s;
}
.auth-input-plain:focus { border-color: var(--mip-positive); box-shadow: 0 0 0 .2rem rgba(10,179,156,.12); outline: none; }
.auth-input-plain.invalid { border-color: var(--mip-negative); }
.auth-input-group { position: relative; }
.auth-input-group .auth-input-plain { padding-right: 42px; }
.auth-eye {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: transparent; border: 0; color: #98a1b3; width: 32px; height: 32px;
    border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.auth-eye:hover { color: var(--mip-brand); background: #f1f4fa; }

.auth-login-header-center { text-align: center; }
.auth-terms { font-size: 12.5px; color: #878a99; margin: -4px 0 16px; }
.auth-terms a { color: var(--mip-brand); font-weight: 600; text-decoration: none; }
.auth-terms a:hover { text-decoration: underline; }

/* Social sign-in (square colored icon buttons) */
.auth-social { margin-top: 20px; }
.auth-social-divider {
    display: flex; align-items: center; gap: 12px; justify-content: center;
    color: #878a99; font-size: 13px; margin-bottom: 16px;
}
.auth-social-divider::before,
.auth-social-divider::after { content: ""; flex: 1; border-top: 1px dashed #dfe3ec; }
.auth-social-divider span { font-weight: 500; }
.auth-social-buttons { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0; }
.auth-social-btn {
    width: 42px; height: 42px; border: 0; border-radius: 8px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 19px; transition: transform .1s, filter .15s, box-shadow .15s;
}
.auth-social-btn:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 8px 16px -8px rgba(0,0,0,.4); }
.auth-social-btn:active { transform: translateY(0); }
.auth-social-facebook  { background: #2f5bea; }
.auth-social-google    { background: #ea4335; }
.auth-social-microsoft { background: #0a2a45; }

.auth-login-register { text-align: center; font-size: 13px; color: #878a99; }
.auth-login-register a { color: var(--mip-brand); font-weight: 700; text-decoration: none; margin-left: 4px; }
.auth-login-register a:hover { text-decoration: underline; }

/* Top-bar user dropdown menu */
.mip-user-menu { position: relative; }
.mip-menu-backdrop { position: fixed; inset: 0; z-index: 1040; background: transparent; }
.mip-user-dropdown {
    z-index: 1050; min-width: 230px; padding: 6px;
    border: 1px solid #e2e6ee; border-radius: 10px;
    box-shadow: 0 12px 28px -10px rgba(30,41,59,.35);
}
.mip-user-dropdown .dropdown-item {
    display: flex; align-items: center; border-radius: 7px;
    padding: 8px 10px; font-size: 13px; color: #33415c;
}
.mip-user-dropdown .dropdown-item:hover { background: #f1f4fa; color: var(--mip-brand); }
.mip-user-dropdown .dropdown-item i { font-size: 16px; color: #8993a4; }
.mip-user-dropdown .dropdown-item:hover i { color: var(--mip-brand); }
.mip-user-dropdown .dropdown-divider { margin: 6px 4px; }

.auth-footnote { color: #8993a4; font-size: 11.5px; text-align: center; }

.auth-back-link { color: var(--mip-brand); font-weight: 600; font-size: 12.5px; text-decoration: none; display: inline-flex; align-items: center; }
.auth-back-link:hover { text-decoration: underline; color: var(--mip-brand-dark); }

/* ================================================================
   SETTINGS PAGE
   ================================================================ */
.mip-settings { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.mip-settings-card .card-header { background: #fff; border-bottom: 1px solid #e9ebec; padding: 14px 16px; }
.mip-settings-icon {
    width: 34px; height: 34px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 17px; flex-shrink: 0;
}

/* ================================================================
   MISC UTILITIES
   ================================================================ */
.positive { color: var(--mip-positive) !important; }
.negative { color: var(--mip-negative) !important; }

/* Portfolio holdings — "good price" alert (current price below ceiling price) */
.mip-good-price > td { background-color: rgba(10,179,156,.07); }
.table-hover > tbody > tr.mip-good-price:hover > td { background-color: rgba(10,179,156,.13); }
.empty-state { padding: 2rem 0; color: #adb5bd; text-align: center; }

/* Radzen overrides for Velzon palette */
.rz-primary { background-color: var(--mip-brand) !important; }

/* ── Responsive ─────────────────────────────────────────── */

/* Tablet: 1100px — collapse sidebar above content */
@media (max-width: 1100px) {
    .mip-body {
        grid-template-columns: 1fr;
    }
    .mip-sidebar {
        position: static;
        max-height: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--vz-border-color, #e9ebec);
    }
    .mip-dash-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile: 768px */
@media (max-width: 768px) {
    :root {
        --mip-topbar-h: 56px;
    }
    .mip-dash-grid-3 {
        grid-template-columns: 1fr;
    }
    .mip-content {
        padding: 12px;
        gap: 12px;
    }
    .mip-perf-pct {
        font-size: 28px;
    }
    /* Portfolio bar — single scroll row */
    .mip-portfolio-bar {
        padding: 6px 10px;
    }
    /* Modal fills screen width */
    .modal-dialog {
        margin: 0.5rem;
    }
    .modal-sm {
        max-width: calc(100vw - 1rem);
    }
}

/* Mobile: 480px */
@media (max-width: 480px) {
    .navbar-header {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }
    .mip-brand-sub {
        display: none;
    }
}
