/* ==========================================================================
   DESIGN VARIABLES & CUSTOM VALUES
   ========================================================================== */
:root {
    /* Color Palette */
    --bg-main: #0b0514;
    --surface-header: rgba(17, 8, 38, 0.9);
    --surface-card: rgba(21, 10, 45, 0.8);
    --surface-dropdown: #1a0c38;
    --surface-table-header: #0f0722;
    --surface-ytd: rgba(6, 182, 212, 0.05);
    --surface-ytd-hover: rgba(6, 182, 212, 0.1);
    --surface-row-hover: rgba(26, 12, 56, 0.6);
    
    /* Typography Palette */
    --text-primary: #cbd5e1;    /* slate-300 */
    --text-bright: #e2e8f0;     /* slate-200 */
    --text-muted: #a78bfa;      /* violet-400 */
    
    /* Neon Status Indicators & Glowing Accents */
    --color-cyan: #22d3ee;
    --color-cyan-glow: rgba(6, 182, 212, 0.5);
    --color-rose: #fb7185;
    --color-rose-glow: rgba(251, 113, 133, 0.5);
    --color-violet: #8b5cf6;
    
    /* Border Rules */
    --border-purple-light: rgba(139, 92, 246, 0.2);
    --border-purple-medium: rgba(139, 92, 246, 0.4);
    --border-purple-heavy: rgba(139, 92, 246, 0.5);
}

/* ==========================================================================
   BASE & STRUCTURE SETUP
   ========================================================================== */
.app-body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

[v-cloak] {
    display: none !important;
}

.main-content {
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Atmospheric Ambient Orbs */
.bg-orb {
    position: absolute;
    width: 40%;
    height: 40%;
    border-radius: 9999px;
    filter: blur(120px);
    pointer-events: none;
}
.orb-top-left {
    top: -10%;
    left: -10%;
    background-color: rgba(109, 40, 217, 0.2);
}
.orb-bottom-right {
    bottom: -10%;
    right: -10%;
    background-color: rgba(6, 95, 114, 0.1);
}

/* ==========================================================================
   NAVIGATION HEADER ARCHITECTURE
   ========================================================================== */
.app-header {
    background-color: var(--surface-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-purple-heavy);
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    user-select: none;
}

.logo-text {
    font-weight: 900;
    font-size: 1.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: linear-gradient(to right, var(--color-violet), #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.3));
}

.logo-subtext {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.025em;
}

@media (max-width: 640px) {
    .logo-subtext { display: none; }
}

/* User Context Actions */
.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-purple-light);
}

.avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 1px solid rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.username {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-bright);
}

/* Custom Action Buttons */
.btn-nav {
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    height: 1.875rem;
    padding: 0.375rem 1rem;
    line-height: 1;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: #67e8f9;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background-color 0.3s, border-color 0.3s;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
    cursor: pointer;
}

.btn-nav:hover {
    background-color: rgba(76, 29, 149, 0.4);
    border-color: rgba(34, 211, 238, 0.5);
}

.btn-theme-toggle {
    min-width: 1.875rem;
    width: 1.875rem;
    justify-content: center;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
}

.btn-theme-toggle i {
    font-size: 0.75rem;
}

.btn-logout {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #f43f5e; /* Rose 400 trait */
    border: 1px solid rgba(159, 18, 57, 0.5);
    background: transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

.btn-logout:hover {
    background-color: rgba(76, 5, 25, 0.4);
    border-color: rgba(190, 24, 74, 0.5);
}

/* ==========================================================================
   FILTER FRAMEWORKS & SELECTION BOXES
   ========================================================================== */
.dashboard-view {
    flex: 1 1 0%;
    overflow: auto;
    padding: 2rem;
    z-index: 10;
}

.content-card {
    background-color: var(--surface-card);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 0.75rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-purple-medium);
    overflow: hidden;
}

.card-filter-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-purple-medium);
    background-color: rgba(17, 8, 38, 0.5);
}

.filter-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .filter-layout { flex-direction: row; }
}

/* Input Enclosures */
.search-wrapper {
    position: relative;
    flex: 1 1 0%;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 0.625rem;
    width: 1.25rem;
    height: 1.25rem;
    color: rgba(139, 92, 246, 0.7);
    pointer-events: none;
}

.input-search {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border-radius: 0.5rem;
    background-color: var(--bg-main);
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: var(--text-bright);
    box-sizing: border-box;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.input-search::placeholder {
    color: rgba(216, 180, 254, 0.4);
}

.input-search:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.5);
    border-color: rgba(34, 211, 238, 0.5);
}

/* Custom Dropdown Styling */
.dropdown-wrapper {
    width: 100%;
    position: relative;
}

@media (min-width: 640px) {
    .dropdown-wrapper { width: 16rem; }
}

.btn-dropdown {
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(139, 92, 246, 0.5);
    background-color: var(--bg-main);
    color: var(--text-bright);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    box-sizing: border-box;
    transition: box-shadow 0.2s;
}

.btn-dropdown:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.5);
}

.dropdown-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.dropdown-arrow {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.dropdown-menu {
    position: absolute;
    z-index: 30;
    margin-top: 0.5rem;
    width: 100%;
    min-width: 16rem;
    background-color: var(--surface-dropdown);
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    padding: 0.75rem;
    box-sizing: border-box;
}

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.dropdown-title {
    color: rgba(216, 180, 254, 0.7);
}

.btn-clear {
    background: transparent;
    border: none;
    color: #22d3ee;
    cursor: pointer;
    padding: 0;
}

.btn-clear:hover {
    color: #67e8f9;
    text-decoration: underline;
}

.dropdown-list {
    max-height: 13rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
    user-select: none;
}

.dropdown-item:hover {
    background-color: rgba(139, 92, 246, 0.15);
}

.dropdown-item input[type="checkbox"] {
    accent-color: #06b6d4;
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    background-color: var(--bg-main);
    border: 1px solid #7c3aed;
}

.filter-label-icon {
    width: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(216, 180, 254, 0.55);
    font-weight: 700;
}

.filter-label-icon.is-selected {
    color: var(--text-bright);
}

.filter-label-icon.is-starred {
    color: rgba(245, 158, 11, 0.55);
}

.filter-label-icon.is-starred.is-selected {
    color: #f59e0b;
}

.dropdown-divider {
    margin: 0.25rem 0;
    border-top: 1px solid var(--border-purple-light);
}

.dropdown-footer {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-purple-light);
    font-size: 0.75rem;
    color: rgba(216, 180, 254, 0.7);
}

/* ==========================================================================
   METRIC DATA TABLE COMPONENT
   ========================================================================== */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
}

.table-head-row {
    background-color: var(--surface-table-header);
    border-bottom: 1px solid var(--border-purple-medium);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.th-clickable {
    padding: 1rem 1.5rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    border-right: 1px solid var(--border-purple-light);
}

.th-clickable:hover {
    background-color: rgba(139, 92, 246, 0.1);
}

.th-span-header {
    padding: 0.5rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-purple-medium);
    background-color: #150a2d;
    letter-spacing: 0.2em;
    font-weight: 700;
    color: #c084fc;
    border-right: 1px solid var(--border-purple-light);
}

.th-ytd-highlight {
    padding: 1rem 1.5rem;
    text-align: right;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    font-weight: 700;
    color: #67e8f9;
    background-color: var(--surface-ytd);
    border-right: 1px solid var(--border-purple-light);
}

.th-ytd-highlight:hover {
    background-color: var(--surface-ytd-hover);
}

.th-sub-header {
    padding: 0.75rem 1.5rem;
    text-align: right;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    border-right: 1px solid var(--border-purple-light);
    border-top: 1px solid var(--border-purple-light);
}

.th-sub-header:hover {
    background-color: rgba(139, 92, 246, 0.1);
}

/* Body Cell Parameters */
.table-body {
    font-size: 0.875rem;
}

.table-body tr {
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    transition: background-color 0.2s;
}

.table-body tr:hover {
    background-color: var(--surface-row-hover);
}

.cell-fund-name {
    padding: 1rem 1.5rem;
    font-weight: 500;
    color: var(--text-bright);
    border-right: 1px solid rgba(139, 92, 246, 0.05);
}

.fund-flex-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.label-toggle-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

/* Star Configurations */
.btn-favorite {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(139, 92, 246, 0.18);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
}

.btn-favorite:active {
    transform: scale(0.95);
}

.btn-favorite:hover,
.btn-label:hover {
    background-color: rgba(139, 92, 246, 0.08);
}

.btn-favorite.is-active {
    background-color: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.35);
}

.btn-label {
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    border: 1px solid rgba(139, 92, 246, 0.18);
    background: rgba(255, 255, 255, 0.02);
    color: rgba(216, 180, 254, 0.55);
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s, border-color 0.2s, color 0.2s;
    padding: 0;
}

.btn-label:active {
    transform: scale(0.95);
}

.btn-label.is-active {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.32);
    color: #34d399;
}

.label-icon {
    line-height: 1;
}

.icon-star {
    width: 1.25rem;
    height: 1.25rem;
    fill: transparent;
    stroke: rgba(139, 92, 246, 0.5);
    stroke-width: 2;
    transition: stroke 0.2s, fill 0.2s;
}

tr:hover .icon-star {
    stroke: var(--text-muted);
}

.icon-star.active {
    fill: #22d3ee;
    stroke: #22d3ee;
    filter: drop-shadow(0 0 5px rgba(6, 182, 212, 0.8));
}

.fund-details {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.fund-link-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.link-fund {
    color: #22d3ee;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: filter 0.2s;
}

.link-fund:hover {
    color: #67e8f9;
    filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.4));
}

.link-source {
    color: var(--color-violet);
    transition: color 0.2s;
    display: inline-flex;
}

.link-source:hover {
    color: #67e8f9;
}

.link-source-icon {
    width: 0.875rem;
    height: 0.875rem;
}

.broker-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.broker-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.375rem;
    border-radius: 0.125rem;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid rgba(139, 92, 246, 0.4);
    background-color: #150a2d;
    color: #c084fc;
}

.cell-fund-type {
    padding: 1rem 1.5rem;
    white-space: nowrap;
    border-right: 1px solid rgba(139, 92, 246, 0.05);
}

.badge-type {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.025em;
    background-color: rgba(139, 92, 246, 0.3);
    color: #67e8f9;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.cell-metric {
    padding: 1rem 1.5rem;
    text-align: right;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 0.025em;
    border-right: 1px solid rgba(139, 92, 246, 0.05);
}

.cell-ytd-highlight {
    padding: 1rem 1.5rem;
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.025em;
    background-color: rgba(6, 182, 212, 0.03);
    border-right: 1px solid rgba(139, 92, 246, 0.05);
}

.cell-actions {
    padding: 1rem 1.5rem;
    text-align: center;
    white-space: nowrap;
}

.btn-metrics {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: rgba(139, 92, 246, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: #67e8f9;
    border-radius: 0.25rem;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
}

.btn-metrics:hover {
    background-color: #7c3aed;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

/* ==========================================================================
   DYNAMIC VALUATION COLORS (Vue Hook Targets)
   ========================================================================== */
.metric-positive {
    color: var(--color-cyan) !important;
    filter: drop-shadow(0 0 2px var(--color-cyan-glow));
}

.metric-negative {
    color: var(--color-rose) !important;
    filter: drop-shadow(0 0 2px var(--color-rose-glow));
}

.sort-icon {
    color: #06b6d4;
    margin-left: 0.25rem;
}

.flex-end-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* ==========================================================================
   INTERACTIVE USER EXPERIENCE STATES (Loading / Empty States)
   ========================================================================== */
.table-state-msg {
    text-align: center;
    padding: 4rem 0;
    color: rgba(167, 139, 250, 0.5);
    font-weight: 500;
    letter-spacing: 0.025em;
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.spinner {
    animation: spin 1s linear infinite;
    height: 1.25rem;
    width: 1.25rem;
    color: #06b6d4;
}

.spinner circle {
    opacity: 0.25;
    stroke: currentColor;
    stroke-width: 4;
}

.spinner path {
    opacity: 0.75;
    fill: currentColor;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   GLOBAL FOOTER BLOCK
   ========================================================================== */
.app-footer {
    background-color: var(--bg-main);
    border-top: 1px solid rgba(139, 92, 246, 0.4);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 10;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0.75;
}

.logo-text-small {
    font-weight: 900;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: linear-gradient(to right, var(--color-violet), #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-copy {
    font-size: 0.75rem;
    color: rgba(139, 92, 246, 0.8);
    letter-spacing: 0.05em;
}

.footer-tagline {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(167, 139, 250, 0.5);
    font-weight: 600;
}

/* ==========================================================================
   CUSTOM WEBKIT SCROLLBAR ENHANCEMENTS
   ========================================================================== */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--bg-main);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #4c1d95;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #6d28d9;
}

.w-35 {
    width: 0.875rem;
    height: 0.875rem;
}
.ml-1 {
    margin-left: 0.25rem;
}
.relative {
    position: relative;
}


/* ==========================================================================
   LIGHT MODE
   ========================================================================== */


/* ==========================================================================
   LIGHT MODE DESIGN OVERRIDES
   ========================================================================== */
.app-body.light-mode {
    /* Color Palette Overrides */
    --bg-main: #f8fafc;                  /* slate-50 */
    --surface-header: rgba(255, 255, 255, 0.95);
    --surface-card: #ffffff;
    --surface-dropdown: #ffffff;
    --surface-table-header: #f1f5f9;     /* slate-100 */
    --surface-ytd: rgba(6, 182, 212, 0.04);
    --surface-ytd-hover: rgba(6, 182, 212, 0.08);
    --surface-row-hover: rgba(139, 92, 246, 0.04);
    
    /* Typography Overrides */
    --text-primary: #334155;             /* slate-700 */
    --text-bright: #0f172a;              /* slate-900 */
    --text-muted: #370b7d;               /* violet-700 */
    
    /* Contrast Enhancements for Status Identifiers */
    --color-cyan: #085f74;               /* cyan-600 */
    --color-cyan-glow: rgba(8, 145, 178, 0.15);
    --color-rose: #e11d48;               /* rose-600 */
    --color-rose-glow: rgba(225, 29, 72, 0.15);
    --color-violet: #8b5cf6;             /* keep logo/title styling identical to dark mode */
    
    /* Softer Border Systems */
    --border-purple-light: rgba(139, 92, 246, 0.12);
    --border-purple-medium: rgba(139, 92, 246, 0.2);
    --border-purple-heavy: rgba(139, 92, 246, 0.25);
}

/* Specific Component Refinements for Light Mode */
.app-body.light-mode .app-header {
    background-color: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom-color: #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.app-body.light-mode .user-profile {
    border-left-color: #e2e8f0;
}

.app-body.light-mode .username {
    color: #334155;
}

.app-body.light-mode .btn-nav {
    border-color: #bfdbfe;
    color: #2563eb;
    box-shadow: none;
    background: #ffffff;
}

.app-body.light-mode .btn-nav:hover {
    background-color: #eff6ff;
    border-color: #93c5fd;
}

.app-body.light-mode .btn-logout {
    color: #dc2626;
    border-color: #fecaca;
}

.app-body.light-mode .btn-logout:hover {
    background-color: #fef2f2;
    border-color: #fca5a5;
}

.app-body.light-mode .content-card {
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    border-color: #e2e8f0;
}

.app-body.light-mode .card-filter-header {
    background-color: #ffffff;
    border-bottom-color: #e2e8f0;
}

.app-body.light-mode .search-icon {
    color: #94a3b8;
}

.app-body.light-mode .input-search,
.app-body.light-mode .btn-dropdown {
    background-color: #ffffff;
    border-color: #e2e8f0;
    color: #0f172a;
}

.app-body.light-mode .input-search:focus,
.app-body.light-mode .btn-dropdown:focus {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
    border-color: #60a5fa;
}

.app-body.light-mode .dropdown-arrow,
.app-body.light-mode .dropdown-title,
.app-body.light-mode .dropdown-footer {
    color: #64748b;
}

.app-body.light-mode .dropdown-menu {
    background-color: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.app-body.light-mode .dropdown-item:hover {
    background-color: #f8fafc;
}

.app-body.light-mode .dropdown-item {
    color: #334155;
}

.app-body.light-mode .dropdown-item input[type="checkbox"] {
    accent-color: #2563eb;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
}

.app-body.light-mode .dropdown-divider,
.app-body.light-mode .dropdown-footer {
    border-color: #e2e8f0;
}

.app-body.light-mode .btn-clear {
    color: #2563eb;
}

.app-body.light-mode .th-span-header {
    background-color: #f1f5f9;
    color: #1e3a8a;
}

.app-body.light-mode .table-head-row {
    background-color: #f8fafc;
    border-bottom-color: #e2e8f0;
    color: #64748b;
}

.app-body.light-mode .th-clickable,
.app-body.light-mode .th-sub-header,
.app-body.light-mode .th-span-header,
.app-body.light-mode .th-ytd-highlight,
.app-body.light-mode .cell-fund-name,
.app-body.light-mode .cell-fund-type,
.app-body.light-mode .cell-metric,
.app-body.light-mode .cell-ytd-highlight {
    border-right: none;
}

/* Keep only table outer vertical limits in light mode */
.app-body.light-mode .data-table thead tr > *:first-child,
.app-body.light-mode .data-table tbody tr > *:first-child {
    border-left: 1px solid #e2e8f0;
}

.app-body.light-mode .data-table thead tr > *:last-child,
.app-body.light-mode .data-table tbody tr > *:last-child {
    border-right: 1px solid #e2e8f0;
}

.app-body.light-mode .th-clickable:hover,
.app-body.light-mode .th-sub-header:hover {
    background-color: #f1f5f9;
}

.app-body.light-mode .th-ytd-highlight {
    color: #1d4ed8;
    background-color: rgba(59, 130, 246, 0.06);
}

.app-body.light-mode .th-ytd-highlight:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.app-body.light-mode .table-body tr {
    border-bottom-color: #e2e8f0;
}

.app-body.light-mode .table-body tr:hover {
    background-color: rgba(248, 250, 252, 0.9);
}

.app-body.light-mode .sort-icon {
    color: #60a5fa;
}

.app-body.light-mode .cell-fund-name {
    color: #0f172a;
}

.app-body.light-mode .link-fund {
    color: #2563eb;
}

.app-body.light-mode .link-fund:hover {
    color: #1d4ed8;
    filter: none;
}

.app-body.light-mode .link-source {
    color: #2563eb;
}

.app-body.light-mode .link-source:hover {
    color: #1d4ed8;
}

.app-body.light-mode .badge-type {
    background-color: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}

.app-body.light-mode .cell-ytd-highlight {
    background-color: rgba(99, 102, 241, 0.04);
}

.app-body.light-mode .btn-metrics {
    background-color: #ffffff;
    border-color: #bfdbfe;
    color: #2563eb;
    box-shadow: none;
}

.app-body.light-mode .btn-metrics:hover {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.app-body.light-mode .btn-favorite,
.app-body.light-mode .btn-label {
    background-color: #ffffff;
    border-color: #e2e8f0;
}

.app-body.light-mode .btn-favorite:hover,
.app-body.light-mode .btn-label:hover {
    background-color: #f8fafc;
}

.app-body.light-mode .btn-favorite.is-active {
    background-color: #fff7ed;
    border-color: #fcd34d;
}

.app-body.light-mode .btn-label {
    color: #94a3b8;
}

.app-body.light-mode .btn-label.is-active {
    background-color: #ecfdf5;
    border-color: #86efac;
    color: #047857;
}

.app-body.light-mode .btn-favorite.is-active {
    background-color: #fff7ed;
    border-color: #fcd34d;
}

.app-body.light-mode .btn-label.is-active {
    background-color: #ecfdf5;
    border-color: #86efac;
    color: #047857;
}

.app-body.light-mode .btn-label:hover,
.app-body.light-mode .btn-favorite:hover {
    background-color: #f8fafc;
}

.app-body.light-mode .icon-star {
    stroke: #cbd5e1;
}

.app-body.light-mode tr:hover .icon-star {
    stroke: #94a3b8;
}

.app-body.light-mode .icon-star.active {
    fill: #f59e0b;
    stroke: #f59e0b;
    filter: none;
}

.app-body.light-mode .filter-label-icon {
    color: #94a3b8;
}

.app-body.light-mode .filter-label-icon.is-selected {
    color: #334155;
}

.app-body.light-mode .filter-label-icon.is-starred {
    color: rgba(245, 158, 11, 0.65);
}

.app-body.light-mode .filter-label-icon.is-starred.is-selected {
    color: #f59e0b;
}

.app-body.light-mode .bg-orb {
    opacity: 0;
}

.app-body.light-mode .app-footer {
    background-color: #ffffff;
    border-top-color: #e2e8f0;
}

.app-body.light-mode .footer-copy,
.app-body.light-mode .footer-tagline {
    color: #64748b;
}

.app-body.light-mode .footer-left {
    opacity: 1;
}

.app-body.light-mode .spinner {
    color: #2563eb;
}

.app-body.light-mode .table-state-msg {
    color: #64748b;
}

.app-body.light-mode .input-search::placeholder {
    color: #94a3b8;
}

.app-body.light-mode .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

.app-body.light-mode .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   DETAIL PAGE (NO TAILWIND DEPENDENCY)
   ========================================================================== */
.detail-page .dashboard-view {
    padding: 2rem;
}

.detail-layout {
    max-width: 64rem;
    margin: 0 auto;
}

/* Utility shims scoped to detail page */
.detail-page .bg-white { background-color: var(--surface-card); }
.detail-page .bg-red-50 { background-color: rgba(239, 68, 68, 0.08); }
.detail-page .border { border: 1px solid var(--border-purple-light); }
.detail-page .border-b { border-bottom: 1px solid var(--border-purple-light); }
.detail-page .border-red-200 { border-color: rgba(248, 113, 113, 0.5); }
.detail-page .border-slate-200,
.detail-page .border-slate-100,
.detail-page .border-slate-300,
.detail-page .border-slate-200\/60 { border-color: var(--border-purple-light); }

.detail-page .rounded-lg { border-radius: 0.5rem; }
.detail-page .rounded-xl { border-radius: 0.75rem; }
.detail-page .rounded-md { border-radius: 0.375rem; }
.detail-page .rounded-full { border-radius: 9999px; }

.detail-page .shadow-sm { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22); }

.detail-page .p-8 { padding: 2rem; }
.detail-page .p-6 { padding: 1.5rem; }
.detail-page .p-4 { padding: 1rem; }
.detail-page .p-3 { padding: 0.75rem; }
.detail-page .p-1 { padding: 0.25rem; }
.detail-page .px-8 { padding-left: 2rem; padding-right: 2rem; }
.detail-page .px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.detail-page .px-4 { padding-left: 1rem; padding-right: 1rem; }
.detail-page .px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.detail-page .py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.detail-page .py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.detail-page .py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.detail-page .py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.detail-page .py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.detail-page .py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.detail-page .py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }

.detail-page .mb-8 { margin-bottom: 2rem; }
.detail-page .mb-6 { margin-bottom: 1.5rem; }
.detail-page .mb-4 { margin-bottom: 1rem; }
.detail-page .mb-2 { margin-bottom: 0.5rem; }
.detail-page .mt-2 { margin-top: 0.5rem; }
.detail-page .mr-4 { margin-right: 1rem; }
.detail-page .mr-3 { margin-right: 0.75rem; }
.detail-page .mr-1\.5 { margin-right: 0.375rem; }

.detail-page .flex { display: flex; }
.detail-page .inline-flex { display: inline-flex; }
.detail-page .grid { display: grid; }
.detail-page .items-center { align-items: center; }
.detail-page .items-start { align-items: flex-start; }
.detail-page .justify-between { justify-content: space-between; }
.detail-page .justify-center { justify-content: center; }
.detail-page .text-right { text-align: right; }
.detail-page .text-left { text-align: left; }
.detail-page .text-center { text-align: center; }
.detail-page .flex-wrap { flex-wrap: wrap; }
.detail-page .flex-col { flex-direction: column; }
.detail-page .shrink-0 { flex-shrink: 0; }
.detail-page .flex-1 { flex: 1 1 0%; }

.detail-page .gap-2 { gap: 0.5rem; }
.detail-page .gap-3 { gap: 0.75rem; }
.detail-page .gap-1\.5 { gap: 0.375rem; }
.detail-page .gap-x-4 { column-gap: 1rem; }
.detail-page .gap-y-2 { row-gap: 0.5rem; }
.detail-page .space-x-4 > * + * { margin-left: 1rem; }
.detail-page .space-x-3 > * + * { margin-left: 0.75rem; }
.detail-page .space-y-4 > * + * { margin-top: 1rem; }

.detail-page .w-full { width: 100%; }
.detail-page .w-8 { width: 2rem; }
.detail-page .w-4 { width: 1rem; }
.detail-page .h-8 { height: 2rem; }
.detail-page .h-4 { height: 1rem; }
.detail-page .h-64 { height: 16rem; }
.detail-page .max-h-60 { max-height: 15rem; }
.detail-page .overflow-hidden { overflow: hidden; }
.detail-page .overflow-x-auto { overflow-x: auto; }
.detail-page .overflow-y-auto { overflow-y: auto; }

.detail-page .grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
@media (min-width: 640px) {
    .detail-page .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-page .sm\:flex-row { flex-direction: row; }
    .detail-page .sm\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
}

.detail-page .text-red-700 { color: #fda4af; }
.detail-page .text-red-600 { color: #f43f5e; }
.detail-page .text-slate-900 { color: var(--text-bright); }
.detail-page .text-slate-800,
.detail-page .text-slate-700,
.detail-page .text-slate-600,
.detail-page .text-slate-500,
.detail-page .text-slate-400,
.detail-page .text-slate-300 { color: var(--text-primary); }
.detail-page .text-blue-600 { color: #60a5fa; }
.detail-page .text-blue-800 { color: #93c5fd; }

.detail-page .text-xs { font-size: 0.75rem; }
.detail-page .text-sm { font-size: 0.875rem; }
.detail-page .text-base { font-size: 1rem; }
.detail-page .text-lg { font-size: 1.125rem; }
.detail-page .text-2xl { font-size: 1.5rem; }
.detail-page .font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.detail-page .font-medium { font-weight: 500; }
.detail-page .font-semibold { font-weight: 600; }
.detail-page .font-bold { font-weight: 700; }
.detail-page .uppercase { text-transform: uppercase; }
.detail-page .tracking-wide { letter-spacing: 0.025em; }
.detail-page .tracking-wider { letter-spacing: 0.05em; }

.detail-page .hover\:underline:hover { text-decoration: underline; }
.detail-page .hover\:bg-red-50:hover { background-color: rgba(239, 68, 68, 0.12); }
.detail-page .hover\:bg-slate-50:hover,
.detail-page .hover\:bg-slate-50\/50:hover,
.detail-page .hover\:bg-slate-300:hover,
.detail-page .hover\:bg-blue-50\/20:hover { background-color: rgba(139, 92, 246, 0.1); }
.detail-page .hover\:text-blue-800:hover { color: #93c5fd; }
.detail-page .transition,
.detail-page .transition-colors { transition: all 0.2s ease; }

.detail-page input[type="text"],
.detail-page input[type="url"] {
    background: var(--bg-main);
    color: var(--text-bright);
    border: 1px solid var(--border-purple-light);
    border-radius: 0.5rem;
    outline: none;
}

.detail-page input[type="text"]:focus,
.detail-page input[type="url"]:focus,
.detail-page input[type="checkbox"]:focus {
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.35);
}

.detail-page .table-body tr {
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.detail-page canvas#valuationChart {
    width: 100% !important;
    height: 100% !important;
}

.app-body.light-mode.detail-page .text-slate-900,
.app-body.light-mode.detail-page .text-slate-800,
.app-body.light-mode.detail-page .text-slate-700 {
    color: #0f172a;
}

.app-body.light-mode.detail-page .text-slate-600,
.app-body.light-mode.detail-page .text-slate-500,
.app-body.light-mode.detail-page .text-slate-400 {
    color: #64748b;
}

.app-body.light-mode.detail-page .text-blue-600 { color: #2563eb; }
.app-body.light-mode.detail-page .text-blue-800 { color: #1d4ed8; }

.app-body.light-mode.detail-page .text-red-700 { color: #b91c1c; }
.app-body.light-mode.detail-page .bg-red-50 { background-color: #fef2f2; }

.app-body.light-mode.detail-page .bg-white { background: #ffffff; }
.app-body.light-mode.detail-page .border,
.app-body.light-mode.detail-page .border-slate-200,
.app-body.light-mode.detail-page .border-slate-100,
.app-body.light-mode.detail-page .border-slate-300,
.app-body.light-mode.detail-page .border-slate-200\/60 {
    border-color: #e2e8f0;
}

.app-body.light-mode.detail-page .hover\:bg-slate-50:hover,
.app-body.light-mode.detail-page .hover\:bg-slate-50\/50:hover,
.app-body.light-mode.detail-page .hover\:bg-slate-300:hover,
.app-body.light-mode.detail-page .hover\:bg-blue-50\/20:hover {
    background-color: #f8fafc;
}

.app-body.light-mode.detail-page input[type="text"],
.app-body.light-mode.detail-page input[type="url"] {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}