/* DIRCKS FAMILY OFFICE - SHARED THEME SYSTEM */
/* Premium design system — professional beyond measure */

/* ============================================
   CSS CUSTOM PROPERTIES - LIGHT THEME (DEFAULT)
   ============================================ */
:root {
    /* Background colors — warm ivory palette */
    --bg-primary: #FAF8F5;
    --bg-secondary: #F3F0EB;
    --bg-card: #ffffff;
    --bg-card-hover: #F5F2ED;
    --bg-nav: #1A1A18;
    --bg-glass: rgba(250,248,245,0.72);

    /* Text colors — warm neutrals */
    --text-primary: #1A1A18;
    --text-secondary: #6B6560;
    --text-muted: #A89F91;
    --text-tertiary: #C4BBB0;
    --text-nav: rgba(255,255,255,0.6);
    --text-nav-active: #f8fafc;

    /* Border colors */
    --border: rgba(0,0,0,0.08);
    --border-light: rgba(0,0,0,0.04);
    --border-accent: rgba(42,111,111,0.2);

    /* Accent colors — deep teal */
    --accent: #2A6F6F;
    --accent-hover: #1F5555;
    --accent-light: rgba(42,111,111,0.08);
    --accent-glow: rgba(42,111,111,0.15);

    /* Status colors */
    --green: #3A7D44;
    --green-light: rgba(58,125,68,0.08);
    --red: #C4493C;
    --red-light: rgba(196,73,60,0.06);
    --orange: #B8860B;
    --orange-light: rgba(184,134,11,0.07);
    --purple: #7c3aed;
    --purple-light: rgba(124,58,237,0.06);

    /* Data visualization palette */
    --viz-blue: #3b82f6;
    --viz-purple: #8b5cf6;
    --viz-green: #10b981;
    --viz-orange: #f59e0b;
    --viz-pink: #ec4899;
    --viz-indigo: #6366f1;
    --viz-teal: #14b8a6;
    --viz-cyan: #06b6d4;

    /* Entity accent colors */
    --entity-llc: #3b82f6;
    --entity-llc-light: rgba(59,130,246,0.1);
    --entity-llc-text: #1d4ed8;
    --entity-tom: #8b5cf6;
    --entity-tom-light: rgba(139,92,246,0.1);
    --entity-tom-text: #6d28d9;
    --entity-taf: #10b981;
    --entity-taf-light: rgba(16,185,129,0.1);
    --entity-taf-text: #047857;

    /* Hero gradient */
    --hero-gradient: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    --hero-bg: #ffffff;
    --hero-text: #0f172a;
    --hero-text-muted: #64748b;
    --hero-border: rgba(0,0,0,0.08);

    /* Shadows — layered for depth */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 1px rgba(0,0,0,0.02);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.04), 0 4px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.04), 0 8px 16px rgba(0,0,0,0.06), 0 16px 32px rgba(0,0,0,0.04);
    --shadow-xl: 0 8px 16px rgba(0,0,0,0.06), 0 16px 32px rgba(0,0,0,0.08), 0 32px 64px rgba(0,0,0,0.06);
    --shadow-glow: 0 0 20px rgba(37,99,235,0.15);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);

    /* Nav background for hover states */
    --nav-hover-bg: rgba(255,255,255,0.08);
    --nav-active-bg: rgba(255,255,255,0.12);

    /* Radius tokens — sharper, more professional */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-full: 100px;

    /* Transition */
    --transition-fast: 0.12s cubic-bezier(0.4,0,0.2,1);
    --transition-normal: 0.2s cubic-bezier(0.4,0,0.2,1);
    --transition-slow: 0.35s cubic-bezier(0.4,0,0.2,1);
    --transition-spring: 0.5s cubic-bezier(0.34,1.56,0.64,1);

    /* Z-index scale */
    --z-nav: 100;
    --z-dropdown: 200;
    --z-overlay: 500;
    --z-modal: 9999;
}

/* ============================================
   CSS CUSTOM PROPERTIES - DARK THEME
   Perplexity Finance aesthetic: neutral blacks, minimal, data-dense
   ============================================ */
[data-theme="dark"] {
    /* Background colors — warm near-black */
    --bg-primary: #141210;
    --bg-secondary: #1C1A17;
    --bg-card: #1E1B18;
    --bg-card-hover: #262320;
    --bg-nav: #141210;
    --bg-glass: rgba(20,18,16,0.92);

    /* Text colors — warm off-white hierarchy */
    --text-primary: #E8E4DF;
    --text-secondary: #8A857D;
    --text-muted: #6A655E;
    --text-tertiary: #5E5A54;
    --text-nav: rgba(255,255,255,0.55);
    --text-nav-active: #E8E4DF;

    /* Border colors — barely visible */
    --border: rgba(255,255,255,0.06);
    --border-light: rgba(255,255,255,0.04);
    --border-accent: rgba(255,255,255,0.12);

    /* Accent colors — warm teal for dark */
    --accent: #5CB87A;
    --accent-hover: #6EC88A;
    --accent-light: rgba(92,184,122,0.08);
    --accent-glow: rgba(92,184,122,0.12);

    /* Status colors — brightened for dark backgrounds */
    --green: #5CB87A;
    --green-light: rgba(92,184,122,0.10);
    --red: #E85B5B;
    --red-light: rgba(232,91,91,0.10);
    --orange: #E5A832;
    --orange-light: rgba(229,168,50,0.08);
    --purple: #a78bfa;
    --purple-light: rgba(167,139,250,0.08);

    /* Data visualization palette — warm for dark backgrounds */
    --viz-blue: #5CA8D4;
    --viz-purple: #a78bfa;
    --viz-green: #5CB87A;
    --viz-orange: #E5A832;
    --viz-pink: #D48BA3;
    --viz-indigo: #818cf8;
    --viz-teal: #4DBBA8;
    --viz-cyan: #4DC8D4;

    /* Entity accent colors — warm */
    --entity-llc: #5CA8D4;
    --entity-llc-light: rgba(92,168,212,0.10);
    --entity-llc-text: #7DBDE5;
    --entity-tom: #a78bfa;
    --entity-tom-light: rgba(167,139,250,0.10);
    --entity-tom-text: #c4b5fd;
    --entity-taf: #5CB87A;
    --entity-taf-light: rgba(92,184,122,0.10);
    --entity-taf-text: #7DCF96;

    /* Hero gradient — warm dark */
    --hero-gradient: linear-gradient(135deg, #141210 0%, #1C1A17 100%);
    --hero-bg: #1C1A17;
    --hero-text: #E8E4DF;
    --hero-text-muted: rgba(232,228,223,0.45);
    --hero-border: rgba(255,255,255,0.06);

    /* Shadows — minimal, nearly flat */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 2px 6px rgba(0,0,0,0.25);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-xl: 0 8px 24px rgba(0,0,0,0.35);
    --shadow-glow: none;
    --shadow-card: 0 1px 2px rgba(0,0,0,0.2);

    /* Nav background for hover states */
    --nav-hover-bg: rgba(255,255,255,0.05);
    --nav-active-bg: rgba(255,255,255,0.08);
}

/* ============================================
   GLOBAL RESETS & BASE STYLES
   ============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

::selection {
    background: var(--accent);
    color: white;
}

/* ============================================
   NAVIGATION - CONSISTENT ACROSS ALL PAGES
   ============================================ */
.nav {
    background: var(--bg-nav);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    padding: 0 32px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-nav);
}

/* Spacer to offset fixed nav height — injected by shared-theme.js */
#nav-mount {
    height: 56px;
}

.nav-brand {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-nav-active);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: opacity var(--transition-fast);
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}
.nav-brand-name {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: 18px;
}
.nav-brand-label {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.6;
}

.nav-brand:hover {
    opacity: 0.85;
}

.nav-center {
    display: flex;
    gap: 4px;
}

.nav-links {
    display: flex;
    flex: 1;
    gap: 4px;
    align-items: center;
}

.nav-links a {
    color: var(--text-nav);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    transition: all var(--transition-fast);
}

.nav-links a:hover {
    color: var(--text-nav-active);
    background: var(--nav-hover-bg);
}

.nav-links a.active {
    color: var(--text-nav-active);
    background: var(--nav-active-bg);
}

/* Dark mode in dark theme shows active link with white text */
[data-theme="dark"] .nav-links a.active {
    color: var(--text-nav-active);
    background: rgba(255,255,255,0.08);
}

/* ============================================
   HAMBURGER MENU BUTTON (hidden on desktop)
   ============================================ */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 200;
    flex-direction: column;
    gap: 5px;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-nav-active);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   MOBILE NAV OVERLAY
   ============================================ */
.nav-overlay {
    display: none;
}

/* ============================================
   NAV DROPDOWN (Holdings/Stock menu)
   ============================================ */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    color: var(--text-nav);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    transition: all var(--transition-fast);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-family: inherit;
}

.nav-dropdown-trigger:hover {
    color: var(--text-nav-active);
    background: var(--nav-hover-bg);
}

.nav-dropdown-trigger.active {
    color: var(--text-nav-active);
    background: var(--nav-active-bg);
}

.nav-dropdown-trigger .arrow {
    font-size: 8px;
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-trigger .arrow,
.nav-dropdown.open .nav-dropdown-trigger .arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--bg-card);
    backdrop-filter: blur(16px) saturate(1.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 6px;
    z-index: var(--z-dropdown);
    margin-top: 4px;
    max-height: 400px;
    overflow-y: auto;
    animation: dropdownIn 0.15s cubic-bezier(0.2,0,0.13,1.5);
}

/* Invisible hover bridge — fills the 4px margin gap so mouse doesn't lose hover */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 0;
    right: 0;
    height: 4px;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.nav-dropdown.hover-open .nav-dropdown-menu,
.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text-primary) !important;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-dropdown-menu a:hover {
    background: var(--accent-light) !important;
    color: var(--accent) !important;
}

.nav-dropdown-menu .ticker-symbol {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    min-width: 44px;
}

.nav-dropdown-menu .stock-label {
    color: var(--text-secondary);
    font-size: 11px;
}

.nav-dropdown-menu .divider {
    height: 1px;
    background: var(--border);
    margin: 4px 6px;
}

.dropdown-filter {
    padding: 4px 4px 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.dropdown-filter-input {
    width: 100%;
    background: var(--bg-tertiary, rgba(255,255,255,0.06));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
    box-sizing: border-box;
}

.dropdown-filter-input::placeholder {
    color: var(--text-muted);
}

.dropdown-filter-input:focus {
    border-color: var(--accent);
}

/* ============================================
   GLOBAL SEARCH
   ============================================ */
.nav-search {
    position: relative;
    margin-left: 8px;
}

.nav-search-input {
    background: var(--nav-hover-bg);
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 7px 12px 7px 28px;
    color: var(--text-nav-active);
    font-size: 12px;
    font-family: inherit;
    width: 140px;
    transition: all 0.2s ease;
}

.nav-search-input::placeholder {
    color: var(--text-nav);
    opacity: 0.7;
}

.nav-search-input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.20);
    background: rgba(255,255,255,0.10);
    width: 220px;
    box-shadow: none;
}

.nav-search-icon {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--text-nav);
    pointer-events: none;
}

.search-results {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 320px;
    background: var(--bg-card);
    backdrop-filter: blur(16px) saturate(1.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: 6px;
    z-index: 300;
    margin-top: 4px;
    max-height: 360px;
    overflow-y: auto;
}

.search-results.visible {
    display: block;
    animation: dropdownIn 0.15s cubic-bezier(0.2,0,0.13,1.5);
}

.search-results a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.search-results a:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.search-results .sr-ticker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    min-width: 44px;
}

.search-results .sr-name {
    flex: 1;
    color: var(--text-secondary);
    font-size: 11px;
}

.search-results .sr-page {
    color: var(--text-muted);
    font-size: 10px;
}

.search-no-results {
    padding: 12px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle {
    background: var(--nav-hover-bg);
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-nav);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
    font-family: inherit;
    margin-left: 8px;
}

.theme-toggle:hover {
    background: var(--nav-active-bg);
    color: var(--text-nav-active);
}

.theme-toggle .icon {
    display: flex;
    align-items: center;
    line-height: 1;
}

.theme-toggle .icon svg {
    display: block;
}

/* Nav right area: timestamp + export + theme */
.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}
.nav-timestamp {
    font-size: 12px;
    color: var(--text-nav);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.nav-export-btn {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    background: transparent;
    color: var(--text-nav);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.nav-export-btn:hover {
    border-color: rgba(255,255,255,0.3);
    color: var(--text-nav-active);
}

/* ============================================
   PASSWORD OVERLAY - CONSISTENT STYLING
   ============================================ */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('login-bg.jpg') center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

.password-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 0;
}

.password-box {
    background: rgba(15, 15, 20, 0.55);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 48px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.06);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.5s cubic-bezier(0.2,0,0.13,1);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.password-box .logo {
    font-size: 26px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 6px;
    letter-spacing: -0.7px;
}

.password-box .tagline {
    color: #94a3b8;
    margin-bottom: 36px;
    font-size: 14px;
    font-weight: 400;
}

.password-box input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.07);
    color: #f1f5f9;
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.password-box input::placeholder {
    color: #94a3b8;
}

.password-box input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.05);
}

.password-box button {
    width: 100%;
    padding: 14px 24px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all var(--transition-fast);
}

.password-box button:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.2);
}

.password-box button:active {
    background: rgba(255,255,255,0.1);
}

.password-error {
    color: var(--red);
    margin-top: 16px;
    display: none;
    font-size: 13px;
}

/* ============================================
   MAIN CONTENT VISIBILITY
   ============================================ */
.main-content {
    display: none;
}

.main-content.visible,
.dfo-authed .main-content {
    display: block;
}

.dfo-authed .password-overlay {
    display: none;
}

/* ============================================
   FINANCIAL VALUE TYPOGRAPHY — Mono for all numbers
   ============================================ */
.summary-card .value,
.metric-val,
.ent-nw,
.nw-hero-value,
.nw-change-amount,
.bar-value,
.alloc-val,
.tier-val,
.mover-val,
.event-amount,
td.amount,
.amount,
[data-dfo-format="currency"],
[data-dfo-format="currency-compact"],
[data-dfo-format="pct"],
[data-dfo-format="number"] {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 32px;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    line-height: 1.2;
}

.page-header .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

.page-header .date {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
    font-variant-numeric: tabular-nums;
}

/* ============================================
   SECTION TITLES (consolidated)
   ============================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 22px;
    font-weight: 400;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: -0.01em;
}

.sec-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.sec-title svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color var(--transition-base);
}

.section-card:hover {
    border-color: var(--border-accent);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: none;
    transition: border-color 0.15s ease;
}

.card:hover {
    border-color: var(--border);
}

[data-theme="dark"] .card:hover {
    border-color: rgba(255,255,255,0.10);
}

.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 20px;
    font-weight: 400;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: -0.01em;
}

.card-body {
    padding: 18px;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.badge.blue {
    background: var(--accent-light);
    color: var(--accent);
}

.badge.green {
    background: var(--green-light);
    color: var(--green);
}

.badge.red {
    background: var(--red-light);
    color: var(--red);
}

.badge.orange {
    background: var(--orange-light);
    color: var(--orange);
}

.badge.purple {
    background: var(--purple-light);
    color: var(--purple);
}

/* ============================================
   SUMMARY CARDS
   ============================================ */
.summary-grid {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.summary-card {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    transition: none;
}

.summary-card + .summary-card {
    border-left: 1px solid var(--border);
    padding-left: 24px;
    margin-left: 24px;
}

.summary-card:hover {
    border-color: transparent;
}

.summary-card .label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
}

.summary-card .value {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 28px;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.summary-card .change,
.summary-card .sub {
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
}

.summary-card .change.positive,
.summary-card .sub.positive {
    color: var(--green);
}

.summary-card .change.negative,
.summary-card .sub.negative {
    color: var(--red);
}

.summary-card.highlight {
    border-left: none;
}

/* ============================================
   TABLES
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 11px 16px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border);
    background: transparent;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: var(--bg-secondary);
}

/* ============================================
   METRIC LABELS & VALUES (shared across pages)
   ============================================ */
.metric-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.metric-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   COMMON TEXT STYLES
   ============================================ */
.ticker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
}

.positive {
    color: var(--green);
}

.negative {
    color: var(--red);
}

.muted {
    color: var(--text-muted);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 32px 0;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2px;
    border-top: 1px solid var(--border);
    margin-top: 48px;
}

/* ============================================
   ALERT BANNERS
   ============================================ */
.alert-banner {
    background: var(--orange-light);
    border: 1px solid rgba(217,119,6,0.2);
    border-left: 3px solid var(--orange);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-banner .icon {
    font-size: 16px;
}

.alert-banner .content {
    flex: 1;
}

.alert-banner .title {
    font-weight: 600;
    color: var(--orange);
    font-size: 13px;
}

.alert-banner .desc {
    color: var(--text-secondary);
    font-size: 12px;
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 1200px) {
    .summary-grid {
        flex-wrap: wrap;
    }
    .summary-card {
        flex: 1 1 45%;
    }
    .summary-card:nth-child(3) {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        margin-top: 20px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE (Hamburger Nav)
   ============================================ */
@media (max-width: 768px) {
    .summary-grid {
        flex-direction: column;
        gap: 20px;
    }
    .summary-card + .summary-card {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        border-top: 1px solid var(--border);
        padding-top: 20px;
    }

    /* Show hamburger button */
    .nav-hamburger {
        display: flex;
    }

    /* Nav bar stays fixed, minimal */
    .nav {
        padding: 0 16px;
        height: 52px;
    }

    #nav-mount {
        height: 52px;
    }

    .nav-brand {
        font-size: 14px;
    }

    /* Nav links become slide-in panel */
    .nav-links {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: var(--bg-nav);
        flex-direction: column;
        align-items: stretch;
        padding: 72px 20px 24px;
        gap: 2px;
        z-index: 150;
        transition: right 0.3s ease;
        box-shadow: -4px 0 20px rgba(0,0,0,0.2);
        overflow-y: auto;
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links a {
        padding: 12px 16px;
        font-size: 15px;
        border-radius: 8px;
    }

    .nav-links a.active {
        background: var(--nav-active-bg);
    }

    /* Dropdown in mobile nav */
    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-trigger {
        color: var(--text-nav);
        padding: 12px 16px;
        font-size: 15px;
        border-radius: 8px;
        width: 100%;
        justify-content: space-between;
    }

    .nav-dropdown-menu {
        position: static;
        display: none;
        background: rgba(255,255,255,0.05);
        border: none;
        box-shadow: none;
        margin-top: 2px;
        padding: 4px 8px;
        max-height: none;
        border-radius: 6px;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown:hover .nav-dropdown-menu {
        display: none;
    }

    .nav-dropdown.open:hover .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown-menu a {
        color: var(--text-nav) !important;
        padding: 8px 12px;
        font-size: 13px;
    }

    .nav-dropdown-menu a:hover {
        background: rgba(255,255,255,0.08) !important;
        color: var(--text-nav-active) !important;
    }

    /* Search in mobile nav */
    .nav-search {
        margin: 8px 0;
        width: 100%;
    }

    .nav-search-input {
        width: 100%;
        padding: 10px 12px 10px 32px;
        font-size: 14px;
    }

    .nav-search-input:focus {
        width: 100%;
    }

    .search-results {
        position: static;
        margin-top: 4px;
        min-width: 0;
    }

    /* Theme toggle at bottom of panel */
    .nav-links .theme-toggle {
        margin-left: 0;
        margin-top: 16px;
        padding: 12px 16px;
        justify-content: center;
        border-top: 1px solid rgba(255,255,255,0.1);
        border-radius: 0;
        padding-top: 20px;
    }

    .theme-toggle .text {
        display: inline;
    }

    .container {
        padding: 16px;
    }

    .page-header h1 {
        font-size: 24px;
    }

    .page-header .subtitle {
        font-size: 13px;
    }

    .summary-card .value {
        font-size: 22px;
    }

    .alert-banner {
        flex-direction: column;
        text-align: center;
    }

    .password-box {
        margin: 16px;
        padding: 32px 24px;
    }
}

/* ============================================
   RESPONSIVE - SMALL PHONES
   ============================================ */
@media (max-width: 480px) {
    .page-header h1 {
        font-size: 22px;
    }

    .summary-card .value {
        font-size: 20px;
    }
}

/* ============================================
   CIO INSIGHTS SUMMARY CARD
   Compact observation strip for entity pages
   ============================================ */
.cio-strip {
    background: transparent;
    border: none;
    border-radius: 0;
    margin-bottom: 24px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    box-shadow: none;
    transition: none;
}

.cio-strip:hover {
    box-shadow: none;
}
.cio-strip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--border);
}
.cio-strip-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cio-strip-title svg {
    width: 14px;
    height: 14px;
    color: var(--accent);
}
.cio-strip-badges {
    display: flex;
    gap: 6px;
}
.cio-sev-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
}
.cio-sev-badge.high { background: rgba(239,68,68,0.1); color: #ef4444; }
.cio-sev-badge.medium { background: rgba(245,158,11,0.1); color: #f59e0b; }
.cio-sev-badge.low { background: rgba(59,130,246,0.1); color: #3b82f6; }
[data-theme="dark"] .cio-sev-badge.high { background: rgba(239,68,68,0.12); color: #ef4444; }
[data-theme="dark"] .cio-sev-badge.medium { background: rgba(245,158,11,0.12); color: #f59e0b; }
[data-theme="dark"] .cio-sev-badge.low { background: rgba(255,255,255,0.06); color: #9ca3af; }
.cio-strip-link {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}
.cio-strip-link:hover { text-decoration: underline; }
.cio-strip-items {
    display: flex;
    flex-direction: column;
}
.cio-strip-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.15s ease;
}
.cio-strip-item:last-child { border-bottom: none; }
.cio-strip-item:hover { background: var(--bg-secondary); }
.cio-strip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cio-strip-dot.high { background: #ef4444; }
.cio-strip-dot.medium { background: #f59e0b; }
.cio-strip-dot.low { background: #3b82f6; }
.cio-strip-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
}
.cio-strip-item-detail {
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
    text-align: right;
}
.cio-strip-item-metric {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 60px;
    text-align: right;
    flex-shrink: 0;
}
.cio-strip-item.high .cio-strip-item-metric { color: #ef4444; }
.cio-strip-item.medium .cio-strip-item-metric { color: #f59e0b; }
.cio-strip-item.low .cio-strip-item-metric { color: #3b82f6; }
[data-theme="dark"] .cio-strip-item.high .cio-strip-item-metric { color: #f87171; }
[data-theme="dark"] .cio-strip-item.medium .cio-strip-item-metric { color: #fbbf24; }
[data-theme="dark"] .cio-strip-item.low .cio-strip-item-metric { color: #60a5fa; }

@media (max-width: 768px) {
    .cio-strip-item { flex-wrap: wrap; gap: 6px; }
    .cio-strip-item-detail { flex-basis: 100%; text-align: left; padding-left: 19px; }
    .cio-strip-badges { display: none; }
}

/* ═══════════════════════════════════════════
   CIO ADVISOR — MANDATE HEADER PANEL
   ═══════════════════════════════════════════ */
.mandate-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 22px 26px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
}
.mandate-header:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.mandate-header-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}
.mandate-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(139,92,246,0.1));
    flex-shrink: 0;
}
.mandate-icon svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
}
.mandate-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-tertiary);
}
.mandate-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}
.mandate-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 14px;
}
.mandate-params {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.mandate-param {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.mandate-philosophy {
    font-size: 12px;
    color: var(--text-tertiary);
    font-style: italic;
}
[data-theme="dark"] .mandate-icon {
    background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(139,92,246,0.15));
}

/* Strategy observation card accent */
.obs-card.strategy::before,
.obs-card.mandate-obs::before {
    background: linear-gradient(180deg, #8b5cf6, #6d28d9);
}
.obs-card .obs-icon.strategy-icon {
    background: rgba(139,92,246,0.1);
    color: #8b5cf6;
}
[data-theme="dark"] .obs-card .obs-icon.strategy-icon {
    background: rgba(139,92,246,0.15);
}

@media (max-width: 768px) {
    .mandate-header { padding: 16px; }
    .mandate-params { gap: 6px; }
    .mandate-param { font-size: 10px; padding: 3px 10px; }
    .mandate-name { font-size: 16px; }
}

/* ── Freshness Badge Strip ──────────────────────────────── */
.freshness-strip {
    padding: 4px 32px;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    font-family: 'Inter', sans-serif;
}
.freshness-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.freshness-green { background: var(--green-light); color: var(--green); }
.freshness-green .freshness-dot { background: var(--green); }
.freshness-yellow { background: var(--orange-light); color: var(--orange); }
.freshness-yellow .freshness-dot { background: var(--orange); }
.freshness-red { background: var(--red-light); color: var(--red); }
.freshness-red .freshness-dot { background: var(--red); }

/* ── Sortable Table Headers ─────────────────────────────── */
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 18px;
    transition: color var(--transition-fast);
}
th.sortable:hover {
    color: var(--accent);
}
th.sortable::after {
    content: '⇕';
    position: absolute;
    right: 4px;
    font-size: 8px;
    opacity: 0.3;
}
th.sortable.sorted-asc::after {
    content: '▲';
    opacity: 1;
    color: var(--accent);
}
th.sortable.sorted-desc::after {
    content: '▼';
    opacity: 1;
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   GLOBAL ANIMATIONS & UTILITIES
   ═══════════════════════════════════════════════════════════ */

/* Page load fade-in — apply to .container */
@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.container {
    animation: pageIn 0.35s cubic-bezier(0.2,0,0.13,1);
}

/* Stagger children animation */
@keyframes staggerIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Skeleton loading shimmer */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card-hover) 50%, var(--bg-secondary) 75%);
    background-size: 400px 100%;
    animation: shimmer 1.5s infinite ease-in-out;
    border-radius: var(--radius-sm);
}

.skeleton-text { height: 12px; margin-bottom: 8px; }
.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 65%; }
.skeleton-text.long { width: 90%; }
.skeleton-value { height: 24px; width: 50%; }
.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

/* Pulse animation for live indicators */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.pulse { animation: pulse 2s ease-in-out infinite; }

/* Highlight flash for value changes */
@keyframes flashGreen {
    0% { background: rgba(5,150,105,0.2); }
    100% { background: transparent; }
}

@keyframes flashRed {
    0% { background: rgba(220,38,38,0.15); }
    100% { background: transparent; }
}

.flash-green { animation: flashGreen 0.8s ease-out; }
.flash-red { animation: flashRed 0.8s ease-out; }

/* Monospace numbers — use on any financial value */
.mono {
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
}

/* Updated timestamp at bottom of pages */
.updated {
    text-align: center;
    padding: 20px 0;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

/* Highlight classes for gain/loss values */
.highlight-green { color: var(--green); }
.highlight-red { color: var(--red); }
.highlight-orange { color: var(--orange); }
.highlight-purple { color: var(--purple); }
.highlight-blue { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════
   FOCUS RING — ACCESSIBLE & PREMIUM
   ═══════════════════════════════════════════════════════════ */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}
button:focus-visible, a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════
   STAGGER CHILDREN — Add to parent for cascading entrance
   ═══════════════════════════════════════════════════════════ */
.stagger-children > * {
    opacity: 0;
    transform: translateY(8px);
    animation: staggerIn 0.4s cubic-bezier(0.4,0,0.2,1) forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }

@keyframes staggerIn {
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════
   REDUCED MOTION — Respect user preference
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .stagger-children > * {
        opacity: 1;
        transform: none;
        animation: none;
    }
    html { scroll-behavior: auto; }
}

/* ═══════════════════════════════════════════════════════════
   UTILITY — Subtle text shadow for values on dark backgrounds
   ═══════════════════════════════════════════════════════════ */
.text-glow {
    text-shadow: 0 0 20px currentColor;
}

/* Gradient text — disabled for clean aesthetic */
.gradient-text {
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR STYLING (WEBKIT)
   ═══════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.25);
}

/* ═══════════════════════════════════════════════════════════
   ADDEPAR-STYLE COMPONENTS (2026-02-15)
   Split panels, sub-nav, period selectors, chart containers
   ═══════════════════════════════════════════════════════════ */

/* ─── Chart Height Tokens ─── */
:root {
    --chart-height-sm: 200px;
    --chart-height-md: 320px;
    --chart-height-lg: 420px;
    --sub-nav-height: 44px;
}

/* ─── SPLIT PANEL (Addepar's signature table+chart side-by-side) ─── */
.split-panel {
    display: block;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    margin-bottom: 24px;
}

.split-panel.chart-narrow,
.split-panel.chart-wide {
    display: block;
}

.split-panel-header {
    padding: 0;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.split-panel-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 22px;
    font-weight: 400;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: -0.01em;
}

.split-panel-left,
.split-panel-right {
    padding: 0;
}

.split-panel-left {
    border-right: none;
}

@media (max-width: 900px) {
    .split-panel,
    .split-panel.chart-narrow,
    .split-panel.chart-wide {
        display: block;
    }
    .split-panel-left {
        border-right: none;
        border-bottom: none;
    }
}

/* ─── SUB-NAVIGATION (contextual page tabs) ─── */
.sub-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 56px;
    z-index: 99;
    overflow: hidden;
}

.sub-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 0;
    overflow-x: auto;
    padding: 0 32px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.sub-nav-inner::-webkit-scrollbar {
    display: none;
}

.sub-nav-link {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sub-nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.sub-nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

[data-theme="dark"] .sub-nav {
    background: var(--bg-card);
    border-bottom-color: var(--border);
}

/* ─── PERIOD SELECTOR (MTD/QTD/YTD/1Y/3Y/ALL toggle) ─── */
.period-selector {
    display: inline-flex;
    gap: 2px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 3px;
    border: 1px solid var(--border-light);
}

.period-btn {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    letter-spacing: 0.3px;
}

.period-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.period-btn.active {
    color: var(--text-primary);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

/* ─── DATA CARD (unified section container) ─── */
.data-card {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    margin-bottom: 24px;
    transition: none;
}

.data-card:hover {
    border-color: transparent;
}

.data-card-header {
    padding: 0;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.data-card-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 22px;
    font-weight: 400;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: -0.01em;
}

.data-card-body {
    padding: 0;
}

.data-card-footer {
    padding: 12px 0;
    border-top: 1px solid var(--border);
    background: transparent;
    font-size: 11px;
    color: var(--text-muted);
}

/* ─── ALLOCATION BAR (shared horizontal stacked bar) ─── */
.alloc-bar-container {
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    margin-bottom: 24px;
}
.alloc-bar-segment {
    height: 100%;
    transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.alloc-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 48px;
}
.alloc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}
.alloc-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}
.alloc-name {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
    font-weight: 400;
}
.alloc-val {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.alloc-pct {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 40px;
    text-align: right;
    font-weight: 500;
}

/* ─── CHART WRAPPER (standard chart container) ─── */
.chart-wrapper {
    position: relative;
    width: 100%;
}

.chart-wrapper.sm { height: var(--chart-height-sm); }
.chart-wrapper.md { height: var(--chart-height-md); }
.chart-wrapper.lg { height: var(--chart-height-lg); }

.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ─── RANGE BAR (52-week range indicator for stock pages) ─── */
.range-bar {
    position: relative;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    overflow: visible;
    margin: 8px 0;
}

.range-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--red) 0%, var(--orange) 40%, var(--green) 100%);
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.range-bar-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--accent);
    border: 2px solid var(--bg-card);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.range-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

/* ─── STAT STRIP (horizontal key metrics row) ─── */
.stat-strip {
    display: flex;
    gap: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    margin-bottom: 24px;
    padding: 20px 0;
}

.stat-strip-item {
    flex: 1;
    padding: 0;
    text-align: left;
    border-right: none;
    transition: none;
}

.stat-strip-item:last-child {
    border-right: none;
}

.stat-strip-item:hover {
    background: transparent;
}

.stat-strip-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 6px;
}

.stat-strip-value {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
}

.stat-strip-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

@media (max-width: 768px) {
    .stat-strip {
        flex-wrap: wrap;
    }
    .stat-strip-item {
        flex: 1 1 50%;
        border-bottom: 1px solid var(--border-light);
    }
    .stat-strip-item:nth-last-child(-n+2) {
        border-bottom: none;
    }
}

/* ─── WATERFALL CHART SUPPORT ─── */
.waterfall-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.waterfall-label {
    width: 120px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: right;
}

.waterfall-track {
    flex: 1;
    height: 32px;
    position: relative;
    background: transparent;
}

.waterfall-segment {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
    min-width: 40px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.waterfall-segment.positive { background: var(--green); }
.waterfall-segment.negative { background: var(--red); }
.waterfall-segment.total { background: var(--accent); }
.waterfall-segment.neutral { background: var(--text-muted); }

/* ─── TRAILING RETURNS TABLE ─── */
.returns-table {
    width: 100%;
    border-collapse: collapse;
}

.returns-table th {
    padding: 10px 16px;
    text-align: right;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.returns-table th:first-child {
    text-align: left;
}

.returns-table td {
    padding: 10px 16px;
    text-align: right;
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.returns-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.returns-table td.positive { color: var(--green); }
.returns-table td.negative { color: var(--red); }

.returns-table tr.benchmark {
    background: var(--bg-secondary);
    font-style: italic;
}

.returns-table tr.benchmark td {
    color: var(--text-secondary);
    font-weight: 400;
}

.returns-table tr:hover {
    background: var(--accent-light);
}
