/* ClimaWallet 2026 shell and shared application surfaces.
   Loaded last so the visual system can evolve without changing domain markup. */

.cw-investment-icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.cw-investment-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    flex: 0 0 auto;
    fill: currentColor;
    vertical-align: -.2em;
}

.investment-icon-select {
    position: relative;
}

.investment-icon-dropdown { display: none; }
.investment-icon-select.is-enhanced > .investment-icon-native-select { display: none; }
.investment-icon-select.is-enhanced > .investment-icon-dropdown { display: block; }
.investment-icon-dropdown-toggle {
    display: flex;
    width: 100%;
    min-height: 2.75rem;
    align-items: center;
    padding-top: .3rem;
    padding-bottom: .3rem;
    text-align: left;
}
.investment-icon-select-value,
.investment-icon-dropdown-option {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: .65rem;
}
.investment-icon-dropdown-menu {
    width: 100%;
    max-height: 17rem;
    overflow-y: auto;
    padding: .35rem;
}
.investment-icon-dropdown-option {
    min-height: 2.65rem;
    border-radius: .45rem;
}
.investment-icon-dropdown-option.is-selected {
    color: var(--cw-primary);
    background: var(--cw-primary-subtle);
    font-weight: 650;
}
.investment-icon-select-preview {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: .5rem;
    background: var(--cw-primary-subtle);
    font-size: 1.15rem;
}
.investment-icon-option-preview {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: .5rem;
    background: var(--cw-bg-elevated);
    font-size: 1.1rem;
}

.cw-investment-icon[data-icon-key="currency-bitcoin"] { color: #f7931a !important; }
.cw-investment-icon[data-icon-key="currency-ethereum"] { color: #627eea !important; }
.cw-investment-icon[data-icon-key="currency-solana"] { color: #8b5cf6 !important; }
.cw-investment-icon[data-icon-key="wallet"] { color: #0878ff !important; }
.cw-investment-icon[data-icon-key="briefcase"] { color: #6366f1 !important; }
.cw-investment-icon[data-icon-key="chart-pie"] { color: #8b5cf6 !important; }
.cw-investment-icon[data-icon-key="building-bank"] { color: #2563eb !important; }
.cw-investment-icon[data-icon-key="rocket"] { color: #f97316 !important; }
.cw-investment-icon[data-icon-key="pig-money"] { color: #ec4899 !important; }
.cw-investment-icon[data-icon-key="coin"] { color: #eab308 !important; }
.cw-investment-icon[data-icon-key="home"] { color: #0d9488 !important; }
.cw-investment-icon[data-icon-key="target-arrow"] { color: #ef4444 !important; }
.cw-investment-icon[data-icon-key="shield-dollar"] { color: #16a34a !important; }
.cw-investment-icon[data-icon-key="building-skyscraper"] { color: #475569 !important; }
.cw-investment-icon[data-icon-key="chart-candle"] { color: #0891b2 !important; }
.cw-investment-icon[data-icon-key="certificate"] { color: #d97706 !important; }
.cw-investment-icon[data-icon-key="cash-banknote"] { color: #059669 !important; }
.cw-investment-icon[data-icon-key="brand-tether"] { color: #26a17b !important; }
.cw-investment-icon[data-icon-key="brand-tesla"] { color: #e82127 !important; }
.cw-investment-icon[data-icon-key="brand-spotify"] { color: #1ed760 !important; }
.cw-investment-icon[data-icon-key="brand-apple"] { color: #8b95a5 !important; }
.cw-investment-icon[data-icon-key="brand-windows"] { color: #00a4ef !important; }
.cw-investment-icon[data-icon-key="brand-google"] { color: #4285f4 !important; }
.cw-investment-icon[data-icon-key="brand-amazon"] { color: #ff9900 !important; }
.cw-investment-icon[data-icon-key="brand-meta"] { color: #0866ff !important; }
.cw-investment-icon[data-icon-key="currency-euro"] { color: #0878ff !important; }
.cw-investment-icon[data-icon-key="currency-dollar"] { color: #00a86b !important; }
.cw-investment-icon[data-icon-key="currency-pound"] { color: #7c3aed !important; }
.cw-investment-icon[data-icon-key="currency-yen"] { color: #dc2626 !important; }
.cw-investment-icon[data-icon-key="currency-yuan"] { color: #ef4444 !important; }
.cw-investment-icon[data-icon-key="currency-frank"] { color: #e11d48 !important; }
.cw-investment-icon[data-icon-key="barrel"] { color: #b7791f !important; }

:root {
    --cw-primary: #0878ff;
    --cw-primary-dark: #075ed1;
    --cw-primary-light: #3b9cff;
    --cw-primary-subtle: #e8f2ff;
    --cw-success: #00b894;
    --cw-success-light: #dcfbf3;
    --cw-danger: #f23f55;
    --cw-danger-light: #ffeaed;
    --cw-warning: #f59f00;
    --cw-warning-light: #fff6d9;
    --cw-info: #0878ff;
    --cw-bg: #f3f7fc;
    --cw-bg-card: #ffffff;
    --cw-bg-elevated: #ffffff;
    --cw-border: #dce6f2;
    --cw-border-strong: #c9d8e9;
    --cw-text: #10203a;
    --cw-text-muted: #63738d;
    --cw-text-light: #8b9ab0;
    --cw-sidebar-width: 15.75rem;
    --cw-sidebar-collapsed-width: 4.75rem;
    --cw-topbar-height: 4rem;
    --cw-radius: 0.875rem;
    --cw-shadow-sm: 0 1px 2px rgba(35, 59, 93, 0.04);
    --cw-shadow: 0 8px 24px rgba(35, 59, 93, 0.07);
    --cw-shadow-lg: 0 18px 48px rgba(14, 39, 76, 0.14);
    --tblr-primary: #0878ff;
    --tblr-primary-rgb: 8, 120, 255;
    --tblr-font-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-bs-theme="dark"] {
    --cw-primary: #1789ff;
    --cw-primary-dark: #0878ff;
    --cw-primary-light: #54a8ff;
    --cw-primary-subtle: rgba(23, 137, 255, 0.14);
    --cw-success: #19d3ad;
    --cw-success-light: rgba(25, 211, 173, 0.13);
    --cw-danger: #ff5368;
    --cw-danger-light: rgba(255, 83, 104, 0.13);
    --cw-warning: #ffb020;
    --cw-warning-light: rgba(255, 176, 32, 0.13);
    --cw-bg: #061526;
    --cw-bg-card: #0b1e33;
    --cw-bg-elevated: #10263e;
    --cw-border: #1d3a58;
    --cw-border-strong: #2c4c6d;
    --cw-text: #f5f8fc;
    --cw-text-muted: #a5b6ca;
    --cw-text-light: #7e93aa;
    --cw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.22);
    --cw-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
    --cw-shadow-lg: 0 20px 54px rgba(0, 0, 0, 0.42);
    --tblr-primary: #1789ff;
    --tblr-primary-rgb: 23, 137, 255;
}

html {
    background: var(--cw-bg);
    scroll-padding-top: calc(var(--cw-topbar-height) + 1rem);
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 74% -12%, rgba(8, 120, 255, 0.08), transparent 24rem),
        var(--cw-bg);
    color: var(--cw-text);
}

.cw-tabular-number {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.cw-demo-banner {
    position: relative;
    z-index: 1034;
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.45rem 1rem;
    color: #fff;
    background: linear-gradient(135deg, #f59f00, #e67800);
    box-shadow: 0 4px 14px rgba(99, 54, 0, 0.2);
    font-size: 0.8125rem;
    font-weight: 600;
}

/* Brand */
.cw-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--cw-text) !important;
    font-size: 1.12rem;
    font-weight: 750;
    letter-spacing: -0.035em;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.cw-brand,
.cw-brand:hover,
.cw-brand:focus,
.cw-brand:focus-visible,
.cw-brand *,
.cw-brand:hover * { text-decoration: none !important; }

.cw-brand-mark {
    display: inline-grid;
    width: 1.55rem;
    height: 1.65rem;
    place-items: center;
    flex: 0 0 auto;
    color: var(--cw-primary);
    font-size: 1.65rem;
    filter: drop-shadow(0 0 6px rgba(8, 120, 255, 0.22));
}

.cw-brand-mark--compact { width: 1.1rem; height: 1.15rem; font-size: 1.15rem; }

/* Desktop shell */
.cw-page-shell {
    min-height: 100vh;
}

.cw-page-shell--app {
    padding-left: 0;
}

.cw-page-shell--app > .cw-shell-main {
    margin-inline-start: var(--cw-sidebar-width) !important;
}

.cw-sidebar.navbar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1032;
    width: var(--cw-sidebar-width);
    min-height: 100vh;
    padding: 0;
    border: 0;
    border-right: 1px solid var(--cw-border);
    background: color-mix(in srgb, var(--cw-bg-card) 96%, transparent);
    box-shadow: none;
    backdrop-filter: blur(18px);
}

body:has(.cw-demo-banner) .cw-sidebar.navbar {
    top: 2.75rem;
    min-height: calc(100vh - 2.75rem);
}

.cw-sidebar > .container-fluid {
    display: flex;
    height: 100%;
    min-height: inherit;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
}

.cw-sidebar-brand {
    position: relative;
    display: flex;
    min-height: var(--cw-topbar-height);
    align-items: center;
    padding: 0 1.45rem;
    border-bottom: 1px solid var(--cw-border);
}

.cw-sidebar-toggle {
    position: static;
    width: 2.45rem;
    height: 2.45rem;
    min-height: 2.45rem !important;
    flex: 0 0 2.45rem;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: var(--cw-text-muted);
    box-shadow: none;
    font-size: 1.35rem;
}
.cw-sidebar-toggle:hover,
.cw-sidebar-toggle:focus-visible { color: var(--cw-text); background: var(--cw-primary-subtle); }

.cw-sidebar .navbar-collapse {
    display: flex !important;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    overflow-y: auto;
}

.cw-sidebar-nav {
    width: 100%;
    padding: 1rem 0.75rem;
    gap: 0.22rem;
}

body .cw-sidebar .nav-link {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    gap: 0.8rem;
    padding: 0.65rem 0.85rem !important;
    border-radius: 0.62rem;
    color: var(--cw-text-muted) !important;
    font-size: 0.875rem;
    font-weight: 560;
}

.cw-sidebar .nav-link > .ti {
    width: 1.25rem;
    color: currentColor;
    font-size: 1.22rem;
    text-align: center;
}

body .cw-sidebar .nav-link:hover,
body .cw-sidebar .nav-item.active > .nav-link {
    color: var(--cw-primary) !important;
    background: var(--cw-primary-subtle);
}

.cw-sidebar .dropdown-menu {
    position: static !important;
    min-width: 0;
    margin: 0.2rem 0 0.35rem 2.05rem;
    transform: none !important;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.cw-sidebar-submenu {
    margin: 0.2rem 0 0.35rem 2.05rem;
}

.cw-sidebar-submenu .dropdown-item.active {
    color: var(--cw-primary);
    background: var(--cw-primary-subtle);
}

.cw-sidebar-chevron { font-size: 0.85rem !important; transition: transform .18s ease; }
.cw-sidebar .nav-link[aria-expanded="true"] .cw-sidebar-chevron { transform: rotate(180deg); }

.cw-sidebar .dropdown-item {
    padding: 0.52rem 0.7rem;
    border-radius: 0.5rem;
    color: var(--cw-text-muted);
    font-size: 0.8125rem;
}

.cw-sidebar .dropdown-item:hover,
.cw-sidebar .dropdown-item:focus {
    color: var(--cw-primary);
    background: var(--cw-primary-subtle);
}

.cw-sidebar-footer {
    margin-top: auto;
    padding: 0.8rem;
    border-top: 1px solid var(--cw-border);
}

.cw-sidebar-user {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.6rem;
    border-radius: 0.65rem;
    color: var(--cw-text);
    text-decoration: none;
}

.cw-sidebar-user,
.cw-sidebar-user:hover,
.cw-sidebar-user:focus,
.cw-sidebar-user *,
.cw-sidebar-user:hover *,
.cw-sidebar-user:focus * { text-decoration: none !important; }
.cw-sidebar-user:hover { background: var(--cw-primary-subtle); color: var(--cw-primary); }
.cw-sidebar-user .avatar,
.cw-user-menu .avatar { background: color-mix(in srgb, var(--cw-primary) 18%, var(--cw-bg-card)); color: var(--cw-primary); font-weight: 700; }
.cw-sidebar-user-copy { display: flex; min-width: 0; flex-direction: column; line-height: 1.2; }
.cw-sidebar-user-copy strong { overflow: hidden; font-size: 0.79rem; text-overflow: ellipsis; white-space: nowrap; }
.cw-sidebar-user-copy small { color: var(--cw-text-muted); font-size: 0.68rem; }

@media (min-width: 992px) {
    body.cw-sidebar-is-collapsed .cw-sidebar.navbar { width: var(--cw-sidebar-collapsed-width); }
    body.cw-sidebar-is-collapsed .cw-page-shell--app > .cw-shell-main {
        margin-inline-start: var(--cw-sidebar-collapsed-width) !important;
    }
    body.cw-sidebar-is-collapsed .cw-sidebar-brand { justify-content: center; padding-inline: .75rem; }
    body.cw-sidebar-is-collapsed .cw-sidebar-brand .cw-brand { width: 100%; justify-content: center; }
    body.cw-sidebar-is-collapsed .cw-brand-label,
    body.cw-sidebar-is-collapsed .cw-sidebar-chevron,
    body.cw-sidebar-is-collapsed .cw-sidebar-user-copy,
    body.cw-sidebar-is-collapsed .cw-sidebar-user > .ti,
    body.cw-sidebar-is-collapsed .cw-sidebar-submenu,
    body.cw-sidebar-is-collapsed .cw-sidebar .dropdown-menu { display: none !important; }
    body.cw-sidebar-is-collapsed .cw-sidebar-nav { align-items: stretch; padding-inline: .65rem; }
    body.cw-sidebar-is-collapsed .cw-sidebar .nav-item { width: 100%; }
    body.cw-sidebar-is-collapsed .cw-sidebar .nav-link {
        display: grid;
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
        place-items: center;
        gap: 0;
        padding-inline: 0 !important;
    }
    body.cw-sidebar-is-collapsed .cw-sidebar .nav-link > .ti:first-child {
        width: 100%;
        margin: 0 !important;
        text-align: center;
    }
    body.cw-sidebar-is-collapsed .cw-sidebar .nav-link::after { display: none !important; }
    body.cw-sidebar-is-collapsed .cw-sidebar .nav-link-title {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
    body.cw-sidebar-is-collapsed .cw-sidebar-footer { padding-inline: .65rem; }
    body.cw-sidebar-is-collapsed .cw-sidebar-user { display: flex; width: 100%; justify-content: center; padding-inline: .35rem; }
    .cw-sidebar.navbar,
    .cw-page-shell--app > .cw-shell-main { transition: width .2s ease, margin-inline-start .2s ease; }
}

@media (max-width: 991.98px) {
    .cw-sidebar-toggle { display: none; }
}

.cw-shell-main {
    min-width: 0;
    min-height: 100vh;
    background: transparent;
}

.cw-topbar {
    position: sticky;
    top: 0;
    z-index: 1028;
    height: var(--cw-topbar-height);
    border-bottom: 1px solid var(--cw-border);
    background: color-mix(in srgb, var(--cw-bg-card) 90%, transparent);
    backdrop-filter: blur(18px);
}

body:has(.cw-demo-banner) .cw-topbar { top: 2.75rem; }

.cw-topbar-inner {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    gap: 1rem;
    padding: 0 1.25rem;
}

.cw-topbar-date {
    position: absolute;
    left: 50%;
    top: 50%;
    max-width: 35%;
    transform: translate(-50%, -50%);
    overflow: hidden;
    color: var(--cw-text-muted);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .045em;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cw-topbar-context {
    align-items: center;
    gap: 0.55rem;
    color: var(--cw-text-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.cw-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.cw-icon-button {
    width: 2.45rem;
    height: 2.45rem;
    border: 1px solid transparent;
    border-radius: 0.68rem;
    color: var(--cw-text-muted);
}

.cw-icon-button:hover,
.cw-icon-button:focus-visible {
    border-color: var(--cw-border);
    background: var(--cw-primary-subtle);
    color: var(--cw-primary);
}

.cw-notification-button { position: relative; }
.cw-notification-dot {
    position: absolute;
    top: .3rem;
    right: .28rem;
    width: .5rem;
    height: .5rem;
    border: 2px solid var(--cw-bg-card);
    border-radius: 50%;
    background: var(--cw-danger);
    box-shadow: 0 0 0 1px rgba(242, 63, 85, .2);
}

.cw-stat-help {
    display: inline-grid;
    width: 1.15rem;
    height: 1.15rem;
    padding: 0;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--cw-text-muted);
    font-size: 1rem;
    line-height: 1;
}
.cw-stat-help:hover,
.cw-stat-help:focus-visible { color: var(--cw-primary); }

.cw-icon-button .flag { width: 1.3rem; }

.cw-user-menu {
    display: inline-flex;
    min-height: 2.45rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.35rem;
    border: 0;
    border-radius: 0.68rem;
    background: transparent;
    color: var(--cw-text);
    font-size: 0.78rem;
    font-weight: 600;
}

.cw-user-menu:hover { background: var(--cw-primary-subtle); }
.cw-language-menu .flag { width: 1.35rem; }

.cw-main-content {
    flex: 1 0 auto;
    min-width: 0;
}

/* Shared page surfaces */
.cw-authenticated .container-xl {
    width: 100%;
    max-width: none;
    padding-right: clamp(1rem, 2vw, 1.75rem);
    padding-left: clamp(1rem, 2vw, 1.75rem);
}

.cw-authenticated .page-header {
    padding: 1.45rem 0 0.7rem;
}

.cw-authenticated .page-header .page-title {
    color: var(--cw-text);
    font-size: clamp(1.45rem, 2vw, 1.9rem);
    font-weight: 760;
    letter-spacing: -0.035em;
}

.cw-authenticated .page-header .text-muted {
    margin-top: 0.22rem;
    color: var(--cw-text-muted) !important;
    font-size: 0.84rem;
}

.cw-authenticated .page-body {
    padding: 0.5rem 0 1.75rem;
}

.cw-authenticated .card {
    border: 1px solid var(--cw-border);
    border-radius: var(--cw-radius);
    background: color-mix(in srgb, var(--cw-bg-card) 97%, transparent);
    box-shadow: var(--cw-shadow-sm);
}

.cw-authenticated .card:hover {
    border-color: var(--cw-border-strong);
    box-shadow: var(--cw-shadow);
    transform: none;
}

.cw-authenticated .card-header {
    min-height: 3.35rem;
    padding: 0.85rem 1rem;
    border-color: var(--cw-border);
}

.cw-authenticated .card-title {
    color: var(--cw-text);
    font-size: 0.9rem;
    font-weight: 680;
}

.cw-authenticated .card-body { padding: 1rem; }
.cw-authenticated .card-footer { padding: 0.85rem 1rem; border-color: var(--cw-border); background: transparent; }

.cw-authenticated .btn {
    min-height: 2.45rem;
    border-radius: 0.62rem;
    font-weight: 620;
}

.cw-authenticated .btn-sm { min-height: 2rem; border-radius: 0.52rem; }
.cw-authenticated .btn:not(.btn-icon) > .ti { margin-right: 0.32rem; }
.cw-authenticated .btn-primary { background: linear-gradient(135deg, #1287ff, #006cf0); border-color: #0878ff; box-shadow: 0 6px 16px rgba(8, 120, 255, 0.2); }
.cw-authenticated .btn-primary:hover { background: linear-gradient(135deg, #3098ff, #0878ff); border-color: #1789ff; box-shadow: 0 8px 20px rgba(8, 120, 255, 0.28); transform: none; }
.cw-authenticated .btn-outline-primary { border-color: color-mix(in srgb, var(--cw-primary) 62%, var(--cw-border)); color: var(--cw-primary); }
.cw-authenticated .btn-outline-primary:hover { background: var(--cw-primary-subtle); color: var(--cw-primary); }

.cw-authenticated .form-control,
.cw-authenticated .form-select,
.cw-authenticated .input-group-text,
.cw-authenticated .ts-control {
    min-height: 2.45rem;
    border-color: var(--cw-border-strong);
    border-radius: 0.58rem;
    background-color: var(--cw-bg-card);
    color: var(--cw-text);
    box-shadow: none;
}

.cw-authenticated .form-control:focus,
.cw-authenticated .form-select:focus,
.cw-authenticated .ts-wrapper.focus .ts-control {
    border-color: var(--cw-primary);
    box-shadow: 0 0 0 0.2rem rgba(8, 120, 255, 0.11);
}

.cw-authenticated .form-label,
.cw-authenticated .stat-label,
.cw-authenticated .subheader {
    color: var(--cw-text-muted);
    font-size: 0.7rem;
    font-weight: 620;
    letter-spacing: 0;
    text-transform: none;
}

.cw-authenticated .stat-card::before { display: none; }
.cw-authenticated .stat-card .stat-icon {
    width: 2.45rem;
    height: 2.45rem;
    margin: 0 0 0 auto;
    order: 2;
    border-radius: 0.62rem;
    background: var(--cw-primary-subtle);
    color: var(--cw-primary);
}

.cw-authenticated .stat-card .card-body > .d-flex { width: 100%; }
.cw-authenticated .stat-card .stat-value { color: var(--cw-text); font-size: clamp(1.15rem, 1.65vw, 1.55rem); font-weight: 760; letter-spacing: -0.025em; }

.cw-authenticated .table thead th {
    padding: 0.7rem 0.8rem;
    border-bottom-width: 1px;
    border-color: var(--cw-border);
    background: color-mix(in srgb, var(--cw-bg) 66%, var(--cw-bg-card));
    color: var(--cw-text-muted);
    font-size: 0.66rem;
    letter-spacing: 0.02em;
}

.cw-authenticated .table td {
    padding: 0.72rem 0.8rem;
    border-color: var(--cw-border);
    color: var(--cw-text);
    font-size: 0.78rem;
}

.cw-authenticated .table tbody tr:hover { background: var(--cw-primary-subtle); }
.cw-authenticated .badge { border-radius: 0.38rem; font-weight: 650; }
.cw-authenticated .modal-content { border: 1px solid var(--cw-border); border-radius: 1rem; background: var(--cw-bg-card); box-shadow: var(--cw-shadow-lg); }
.cw-authenticated .modal-header,
.cw-authenticated .modal-footer { border-color: var(--cw-border); }
.cw-authenticated .modal-title { color: var(--cw-text); font-weight: 740; }
.cw-authenticated .alert { border: 1px solid color-mix(in srgb, currentColor 14%, transparent); border-radius: 0.72rem; }

.cw-app-footer {
    padding: 0.8rem 0 1.2rem;
    border: 0;
    background: transparent;
}

.cw-app-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    color: var(--cw-text-light);
    font-size: 0.7rem;
}

.cw-app-footer-inner span:last-child { display: flex; gap: 1rem; }
.cw-app-footer-inner a { color: inherit; text-decoration: none; }
.cw-app-footer-inner a:hover { color: var(--cw-primary); }

/* Dashboard */
.cw-route-dashboard .dashboard-grid { --dashboard-grid-gap: 0.85rem; }
.cw-route-dashboard .dashboard-widget-card { overflow: hidden; }
.cw-route-dashboard .dashboard-widget-card .card-body { min-height: 0; }
.cw-route-dashboard .dashboard-chart-wrap { padding: 0.85rem 1rem 1rem; }
.cw-route-dashboard .dashboard-quick-actions { gap: 0.6rem; }
.cw-route-dashboard .dashboard-quick-actions .btn { flex: 1 1 calc(50% - 0.3rem); justify-content: flex-start; }

/* Portfolio list: desktop cards become the wide summary rows in the reference. */
.cw-route-investments-portfolios #portfolios-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
}

.cw-route-investments-portfolios #portfolios-grid > [class*="col-"] { width: 100%; padding: 0; }
.cw-route-investments-portfolios .card-portfolio { min-height: 12rem; overflow: hidden; }
.cw-route-investments-portfolios .card-portfolio > .card-body {
    display: grid !important;
    min-width: 0;
    grid-template-columns: minmax(12rem, 0.9fr) minmax(25rem, 1.8fr) minmax(14rem, 1fr);
    align-items: stretch;
    gap: 1rem;
    padding: 1rem 1.15rem;
}
.cw-route-investments-portfolios .portfolio-card-identity { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: center; gap: 0.75rem; }
.cw-route-investments-portfolios .portfolio-card-icon { display: grid; width: 3rem; height: 3rem; place-items: center; border-radius: 50%; background: var(--cw-primary-subtle); color: var(--cw-primary); font-size: 1.55rem; }
.cw-route-investments-portfolios .card-portfolio .card-title { font-size: 1.08rem; }
.cw-route-investments-portfolios .portfolio-card-note { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.cw-route-investments-portfolios .portfolio-card-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; }
.cw-route-investments-portfolios .portfolio-card-metrics > div { min-width: 0; padding: 0.2rem 0.8rem; border-left: 1px solid var(--cw-border); }
.cw-route-investments-portfolios .card-portfolio .h3 { margin-top: 0.25rem; color: var(--cw-text); font-size: 1.12rem; font-weight: 730; }
.cw-route-investments-portfolios .portfolio-card-history { min-width: 0; padding-left: 1rem; border-left: 1px solid var(--cw-border); }
.cw-route-investments-portfolios .portfolio-sparkline-wrap { position: relative; height: 5.5rem; }
.cw-route-investments-portfolios .portfolio-sparkline-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.cw-route-investments-portfolios .card-portfolio > .card-footer { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; }
.cw-route-investments-portfolios .card-portfolio > .card-footer .btn { display: inline-flex; align-items: center; justify-content: center; }
.portfolio-icon-picker,
.asset-icon-picker { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.45rem; margin-bottom: 0.45rem; }
.asset-icon-picker { grid-template-columns: repeat(auto-fill, minmax(2.75rem, 1fr)); max-height: 12rem; padding: .15rem; overflow-y: auto; }
.portfolio-icon-option,
.asset-icon-option { position: relative; cursor: pointer; }
.portfolio-icon-option input,
.asset-icon-option input { position: absolute; opacity: 0; pointer-events: none; }
.portfolio-icon-option > span,
.asset-icon-option > span { display: grid; aspect-ratio: 1; place-items: center; border: 1px solid var(--cw-border); border-radius: 0.6rem; color: var(--cw-text-muted); font-size: 1.25rem; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.portfolio-icon-option input:checked + span,
.asset-icon-option input:checked + span,
.asset-icon-option.is-selected > span { border-color: var(--cw-primary); background: var(--cw-primary-subtle); color: var(--cw-primary); box-shadow: 0 0 0 1px var(--cw-primary); }
.portfolio-icon-option input:focus-visible + span,
.asset-icon-option input:focus-visible + span { outline: 2px solid var(--cw-primary); outline-offset: 2px; }

/* Portfolio detail and analytics */
.cw-route-investments-portfolios .breadcrumb,
[class*="cw-route-investments-allocation"] .breadcrumb { margin-bottom: 0.45rem; font-size: 0.72rem; }
.cw-route-investments-analytics .page-body > .container-xl > .card:first-child,
.cw-route-investments-trades .page-body > .container-xl > .card:first-child { box-shadow: none; }
.cw-route-investments-analytics .row-cards,
[class*="cw-route-investments-portfolios-"] .row-cards { --tblr-gutter-y: 0.75rem; }
.cw-route-investments-analytics .row-cards .card .h2,
[class*="cw-route-investments-portfolios-"] .row-cards .card .h2 { color: var(--cw-text); font-size: 1.15rem; font-weight: 740; }

/* Trades and alerts */
.cw-route-investments-trades .page-body > .container-xl > .card.mb-3 .card-body { padding: 0.85rem; }
.cw-route-investments-trades .page-body > .container-xl > .card.mb-3 .row { --tblr-gutter-y: 0.65rem; --tblr-gutter-x: 0.65rem; }
.cw-route-alerts .page-body section.card:first-of-type { overflow: hidden; }
.cw-route-alerts .page-body section.card:first-of-type .card-header::before { content: '\f898'; display: grid; width: 2.5rem; height: 2.5rem; margin-right: 0.8rem; place-items: center; border-radius: 0.68rem; background: var(--cw-primary-subtle); color: var(--cw-primary); font-family: 'tabler-icons'; font-size: 1.25rem; }

/* Mobile navigation */
.cw-mobile-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 1035;
    display: grid;
    height: calc(4.35rem + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    padding: 0.38rem 0.35rem env(safe-area-inset-bottom);
    border-top: 1px solid var(--cw-border);
    background: color-mix(in srgb, var(--cw-bg-card) 94%, transparent);
    box-shadow: 0 -10px 30px rgba(20, 49, 86, 0.09);
    backdrop-filter: blur(18px);
}

.cw-mobile-nav a,
.cw-mobile-nav button {
    display: flex;
    min-width: 0;
    height: 3.45rem;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.18rem;
    padding: 0.2rem;
    border: 0;
    background: transparent;
    color: var(--cw-text-muted);
    font-size: 0.6rem;
    font-weight: 620;
    line-height: 1.05;
    text-align: center;
    text-decoration: none;
}

.cw-mobile-nav .ti { font-size: 1.28rem; }
.cw-mobile-nav .active { color: var(--cw-primary); }
.cw-mobile-nav-trade .ti { display: grid; width: 2.55rem; height: 2.55rem; margin-top: -1.05rem; place-items: center; border: 4px solid var(--cw-bg-card); border-radius: 50%; background: linear-gradient(135deg, #1287ff, #006cf0); color: #fff; box-shadow: 0 8px 18px rgba(8, 120, 255, 0.3); font-size: 1.35rem; }
.cw-mobile-menu { background: var(--cw-bg-card); color: var(--cw-text); }
.cw-mobile-menu .offcanvas-header { border-bottom: 1px solid var(--cw-border); }
.cw-mobile-menu .list-group-item { display: flex; align-items: center; border-radius: 0.6rem; color: var(--cw-text); }
.cw-mobile-menu .list-group-item:hover { background: var(--cw-primary-subtle); color: var(--cw-primary); }
.cw-mobile-menu-section { display: flex; align-items: center; margin-top: 0.35rem; padding: 0.65rem 1rem 0.35rem; color: var(--cw-text); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .035em; }
.cw-mobile-menu .cw-mobile-menu-child { padding-left: 2.15rem; font-size: 0.86rem; }
.cw-mobile-menu-languages { padding-top: 1rem; border-top: 1px solid var(--cw-border); }
.cw-mobile-menu-languages form + form { margin-top: 0.2rem; }
.cw-mobile-menu-languages .flag { width: 1.45rem; }

@media (max-width: 1199.98px) {
    .cw-route-investments-portfolios .card-portfolio > .card-body { grid-template-columns: minmax(12rem, 0.8fr) minmax(22rem, 1.7fr); }
    .cw-route-investments-portfolios .portfolio-card-history { grid-column: 1 / -1; height: 6.5rem; padding: 0.75rem 0 0; border-top: 1px solid var(--cw-border); border-left: 0; }
}

@media (max-width: 991.98px) {
    :root { --cw-topbar-height: 3.9rem; }
    .cw-page-shell--app > .cw-shell-main {
        margin-inline-start: 0 !important;
        padding-bottom: calc(5.35rem + env(safe-area-inset-bottom));
    }
    .cw-topbar-inner { padding: 0 0.85rem; }
    .cw-topbar-actions { gap: 0.05rem; }
    .cw-topbar-actions .cw-icon-button { width: 2.3rem; height: 2.3rem; }
    .cw-user-menu { padding: 0.2rem; }
    .cw-user-menu .avatar { width: 2rem; height: 2rem; }
    .cw-app-footer { display: none; }
    .cw-authenticated .page-header { padding-top: 1.1rem; }
    .cw-authenticated .page-body { padding-bottom: 1rem; }
    .cw-authenticated .container-xl { padding-right: 0.85rem; padding-left: 0.85rem; }
    .cw-route-investments-portfolios .card-portfolio > .card-body { grid-template-columns: 1fr; }
    .cw-route-investments-portfolios .portfolio-card-history { grid-column: auto; }
}

@media (max-width: 767.98px) {
    body { background: var(--cw-bg); }
    .cw-topbar { position: sticky; }
    .cw-authenticated .cw-topbar .dropdown:has(.cw-language-menu) { display: none; }
    .cw-authenticated .page-header { padding: 1rem 0 0.55rem; }
    .cw-authenticated .page-header .container-xl > .row { gap: 0.7rem; }
    .cw-authenticated .page-header .col-auto { margin-top: 0; }
    .cw-authenticated .page-header .page-title { font-size: 1.35rem; }
    .cw-authenticated .page-body { padding-top: 0.25rem; }
    .cw-authenticated .card { border-radius: 0.75rem; }
    .cw-authenticated .card-body { padding: 0.85rem; }
    .cw-authenticated .card-header { padding: 0.75rem 0.85rem; }
    .cw-authenticated .btn { min-height: 2.55rem; }
    .cw-authenticated .page-header .col-auto.ms-auto { width: 100%; }
    .cw-authenticated .page-header .col-auto.ms-auto > .btn,
    .cw-authenticated .page-header .btn-list .btn { flex: 1 1 auto; }
    .cw-route-dashboard .dashboard-header-actions { align-items: stretch; }
    .cw-route-dashboard .dashboard-currency-control { flex: 1 1 100%; }
    .cw-route-dashboard .dashboard-currency-control .input-group { width: 100%; }
    .cw-route-dashboard .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
    .cw-route-dashboard .dashboard-grid > .dashboard-widget-column.col-sm-6 { grid-column: span 1; }
    .cw-route-dashboard .dashboard-grid > .dashboard-widget-column[data-dashboard-widget="net_worth"],
    .cw-route-dashboard .dashboard-grid > .dashboard-widget-column:not(.col-sm-6) { grid-column: 1 / -1; }
    .cw-route-dashboard .stat-card { min-height: 6.1rem; }
    .cw-route-dashboard .stat-card .card-body { padding: 0.75rem; }
    .cw-route-dashboard .stat-card .stat-icon { width: 2.15rem; height: 2.15rem; }
    .cw-route-dashboard .dashboard-grid .stat-value { font-size: 1rem; white-space: normal; }
    .cw-route-dashboard .dashboard-quick-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .cw-route-dashboard .dashboard-quick-actions .btn { min-width: 0; font-size: 0.72rem; }
    .cw-route-investments-portfolios .card-portfolio { min-height: 0; }
    .cw-route-investments-portfolios .card-portfolio > .card-body { padding: 0.9rem; }
    .cw-route-investments-portfolios .portfolio-card-metrics { grid-template-columns: 1fr 1fr; }
    .cw-route-investments-portfolios .portfolio-card-metrics > div { padding: 0.55rem 0.4rem; border-left: 0; }
    .cw-route-investments-portfolios .portfolio-card-metrics > div:nth-child(even) { border-left: 1px solid var(--cw-border); }
    .cw-route-investments-portfolios .card-portfolio > .card-footer { grid-template-columns: 1fr 1fr; min-width: 0; padding: 0.75rem 0.85rem; }
    .cw-route-investments-trades .page-body > .container-xl > .card:first-of-type { background: transparent; border: 0; }
    .cw-route-investments-trades .page-body > .container-xl > .card:first-of-type .card-body { padding: 0; }
    .cw-route-investments-trades table.table-cards tbody tr { padding: 0.75rem; border-radius: 0.72rem; box-shadow: none; }
    .cw-route-alerts .page-body section.card:first-of-type .card-header {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
    }
    .cw-route-alerts .page-body section.card:first-of-type .card-header::before { grid-column: 1; grid-row: 1; }
    .cw-route-alerts .page-body section.card:first-of-type .card-header > div:first-of-type { grid-column: 2; grid-row: 1; }
    .cw-route-alerts .page-body section.card:first-of-type .card-actions { width: 100%; grid-column: 1 / -1; grid-row: 2; margin-top: 0.75rem; }
    .cw-route-alerts .page-body section.card:first-of-type .card-actions .btn { width: 100%; }
    .cw-authenticated .modal-dialog { min-height: 100dvh; margin: 0; align-items: flex-end; }
    .cw-authenticated .modal-dialog-centered { min-height: 100dvh; }
    .cw-authenticated .modal-content { max-height: 96dvh; border-radius: 1rem 1rem 0 0; }
    .cw-authenticated .modal-body { overflow-y: auto; }
}

@media (max-width: 374.98px) {
    .cw-brand { gap: 0.45rem; font-size: 0.98rem; }
    .cw-brand-mark { width: 1.25rem; height: 1.35rem; }
    .cw-topbar-inner { padding: 0 0.55rem; }
    .cw-topbar-actions .cw-icon-button { width: 2.1rem; height: 2.1rem; }
    .cw-mobile-nav a,
    .cw-mobile-nav button { font-size: 0.54rem; }
}

@media print {
    .cw-page-shell--app { padding-left: 0; }
    .cw-shell-main { min-height: auto; }
}
