<style >
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --font-size: 16px;
    /* Dark Theme (Default) */
    --background: #0f172a;
    --foreground: #e2e8f0;
    --card: #1e293b;
    --card-foreground: #e2e8f0;
    --primary: #3b82f6;
    --primary-foreground: #ffffff;
    --secondary: #334155;
    --secondary-foreground: #f1f5f9;
    --muted: #475569;
    --muted-foreground: #94a3b8;
    --accent: #334155;
    --accent-foreground: #f1f5f9;
    --border: #334155;
    --input: #1e293b;
    --input-background: #1e293b;
    --ring: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --destructive: #ef4444;
    --sidebar: #0f172a;
    --sidebar-foreground: #e2e8f0;
    --sidebar-accent: #1e293b;
    --sidebar-border: #1e293b;
}

/* Light Theme */
body.light-theme {
    --background: #f8fafc;
    --foreground: #0f172a;
    --card: #ffffff;
    --card-foreground: #0f172a;
    --primary: #0d9488;
    --primary-foreground: #ffffff;
    --secondary: #ccfbf1;
    --secondary-foreground: #134e4a;
    --muted: #94a3b8;
    --muted-foreground: #475569;
    --accent: #f0fdfa;
    --accent-foreground: #115e59;
    --border: #cbd5e1;
    --input: #ffffff;
    --input-background: #ffffff;
    --ring: #0d9488;
    --success: #059669;
    --warning: #d97706;
    --destructive: #dc2626;
    --sidebar: #ffffff;
    --sidebar-foreground: #0f172a;
    --sidebar-accent: #f0fdfa;
    --sidebar-border: #e2e8f0;
}

    body.light-theme .card {
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    }

    body.light-theme .nav-item.active {
        background: #ccfbf1;
        color: #0f766e;
        font-weight: 600;
    }

    body.light-theme .tab.active {
        color: #0d9488;
        border-bottom-color: #0d9488;
    }

    body.light-theme .header-nav-link.active {
        color: #dc2626;
        background: #fef2f2;
    }

    body.light-theme .ticker-cell,
    body.light-theme .portfolio-ticker {
        color: #0d9488;
        font-weight: 600;
    }

    body.light-theme .return-positive {
        color: #059669;
        font-weight: 600;
    }

    body.light-theme .return-high {
        color: #0d9488;
        font-weight: 600;
    }

    body.light-theme tbody tr:hover {
        background: #f0fdfa;
    }

    body.light-theme tbody tr.highlighted {
        background: #ccfbf1;
    }

    body.light-theme .portfolio-stock-row:hover {
        background: #f0fdfa;
    }

    body.light-theme .compare-result {
        background: #ccfbf1;
        border-color: #99f6e4;
    }

    body.light-theme .chart-container {
        background: #ffffff;
        border-color: #99f6e4;
    }

    body.light-theme .table-footer,
    body.light-theme thead tr {
        background: #f0fdfa;
    }

    body.light-theme .btn-primary {
        background: #0d9488;
        color: #ffffff;
    }

        body.light-theme .btn-primary:hover {
            background: #0f766e;
        }

    body.light-theme .performance-tab.active {
        background: #0d9488;
        color: #ffffff;
    }

    body.light-theme .btn-success {
        background: #059669;
    }

        body.light-theme .btn-success:hover {
            background: #047857;
        }

    body.light-theme .btn-secondary {
        background: #e0f2fe;
        color: #0c4a6e;
    }

        body.light-theme .btn-secondary:hover {
            background: #bae6fd;
        }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--foreground);
    font-size: var(--font-size);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 256px;
    background: var(--sidebar);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    padding: 1.5rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-foreground);
    font-weight: 600;
    font-size: 0.875rem;
}

.logo-text {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--sidebar-foreground);
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0.75rem;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    width: 100%; 
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: transparent;
    color: rgba(226, 232, 240, 0.7);
    font-size: 0.875rem;
    font-family: inherit;
    text-align: left;
}

    .nav-item:hover {
        background: rgba(30, 41, 59, 0.5);
        color: var(--sidebar-foreground);
    }

    .nav-item.active {
        background: var(--sidebar-accent);
        color: var(--sidebar-foreground);
        font-weight: 500;
    }

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

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

.footer-text {
    font-size: 0.75rem;
    color: rgba(226, 232, 240, 0.5);
}

/* Main Content */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    height: 64px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-logo-icon {
    width: 32px;
    height: 32px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo-text {
    font-weight: 600;
    font-size: 1.125rem;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.header-nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: transparent;
    color: rgba(226, 232, 240, 0.7);
    font-family: inherit;
}

    .header-nav-link:hover {
        color: var(--foreground);
        background: rgba(51, 65, 85, 0.5);
    }

    .header-nav-link.active {
        color: #ef4444;
        font-weight: 500;
    }

        .header-nav-link.active:hover {
            background: rgba(239, 68, 68, 0.1);
        }

/* Page Content */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Card */
.card {
    background: var(--card);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.card-padding {
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

/* Stock Analysis Page */
.stock-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stock-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stock-group-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(226, 232, 240, 0.8);
}

.select, .input {
    padding: 0.5rem 0.75rem;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--foreground);
    font-family: inherit;
    transition: all 0.2s;
}

    .select:focus, .input:focus {
        outline: none;
        ring: 2px;
        ring-color: rgba(59, 130, 246, 0.2);
        border-color: var(--ring);
    }

.button-group {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

    .btn-primary:hover {
        background: #2563eb;
    }

.btn-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

    .btn-secondary:hover {
        background: #475569;
    }

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

    .btn-success:hover {
        background: #059669;
    }

.stock-count {
    font-size: 0.875rem;
    color: rgba(226, 232, 240, 0.6);
}

.stock-count-number {
    font-weight: 600;
    color: var(--foreground);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: transparent;
    color: rgba(226, 232, 240, 0.6);
    font-family: inherit;
}

    .tab:hover {
        color: var(--foreground);
        border-bottom-color: var(--border);
    }

    .tab.active {
        border-bottom-color: var(--primary);
        color: var(--primary);
    }

/* Filter Section */
.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.filter-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem 1rem;
    margin-bottom: 0.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(226, 232, 240, 0.8);
}

body.light-theme .form-label {
    color: #1e293b !important;
    font-weight: 600;
}

body.light-theme .stock-group-label {
    color: #1e293b !important;
    font-weight: 600;
}

body.light-theme .portfolio-example-label {
    color: #475569 !important;
    font-weight: 600;
}

body.light-theme .portfolio-table-header {
    color: #475569 !important;
    font-weight: 600;
}

body.light-theme .sector-label {
    color: #475569 !important;
    font-weight: 600;
}

body.light-theme th {
    color: #1e293b !important;
    font-weight: 600;
}

body.light-theme .sector-cell {
    color: #475569 !important;
}

body.light-theme .stock-count {
    color: #475569 !important;
}

body.light-theme .portfolio-weight-symbol {
    color: #475569 !important;
    font-weight: 500;
}

body.light-theme .compare-result-subtitle {
    color: #475569 !important;
}

body.light-theme .empty-state {
    color: #64748b !important;
}

body.light-theme .footer-text {
    color: #94a3b8 !important;
}

body.light-theme .filter-title {
    color: #0f172a !important;
}

body.light-theme .page-title {
    color: #0f172a !important;
}

body.light-theme .portfolio-title {
    color: #0f172a !important;
}

body.light-theme .performance-title {
    color: #0f172a !important;
}

body.light-theme .chart-title {
    color: #0f172a !important;
}

body.light-theme .compare-result-title {
    color: #0f172a !important;
}

body.light-theme .card-title {
    color: #0f172a !important;
}

.input-number {
    padding: 0.625rem 0.75rem;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--foreground);
    font-family: inherit;
    transition: all 0.2s;
}

    .input-number:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
        border-color: var(--ring);
    }

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead tr {
    border-bottom: 1px solid var(--border);
    background: rgba(51, 65, 85, 0.3);
}

th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(226, 232, 240, 0.8);
}

    th.text-right {
        text-align: right;
    }

tbody tr {
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    transition: background 0.2s;
}

    tbody tr:hover {
        background: rgba(51, 65, 85, 0.2);
    }

    tbody tr.highlighted {
        background: rgba(59, 130, 246, 0.05);
    }

td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

    td.text-right {
        text-align: right;
    }

.ticker-cell {
    font-weight: 500;
    color: var(--primary);
}

.sector-cell {
    color: rgba(226, 232, 240, 0.7);
}

.return-positive {
    color: var(--success);
    font-weight: 500;
}

.return-high {
    color: var(--primary);
    font-weight: 500;
}

.return-negative {
    color: var(--destructive);
    font-weight: 500;
}

.table-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    background: rgba(51, 65, 85, 0.1);
    font-size: 0.75rem;
    color: rgba(226, 232, 240, 0.6);
}

/* Portfolio Page */
.portfolio-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 1.5rem;
}

/* Portfolio List */
.portfolio-header {
    margin-bottom: 1rem;
}

.portfolio-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: rgba(226, 232, 240, 0.7);
}

.portfolio-example {
    margin-bottom: 1rem;
}

.portfolio-example-label {
    font-size: 0.875rem;
    color: rgba(226, 232, 240, 0.7);
    margin-bottom: 0.5rem;
    display: block;
}

.portfolio-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--foreground);
    font-family: inherit;
    transition: all 0.2s;
}

    .portfolio-select:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
        border-color: var(--ring);
    }

.portfolio-table-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(226, 232, 240, 0.7);
    margin-bottom: 0.5rem;
}

    .portfolio-table-header span:nth-child(2) {
        text-align: center;
    }

.portfolio-stocks {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.portfolio-stock-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem; 
    border-radius: 8px;
    transition: background 0.2s;
}

    .portfolio-stock-row:hover {
        background: rgba(51, 65, 85, 0.2);
    }

.portfolio-ticker {
    font-size: 1.2rem; /* 0.875rem; */
    font-weight: 500;
    background: var(--input);
}

.portfolio-weight-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.portfolio-weight-input {
    width: 100%;
    padding: 0.375rem 0.5rem;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.875rem;
    text-align: center;
    color: var(--foreground);
    font-family: inherit;
}

    .portfolio-weight-input:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
        border-color: var(--ring);
    }

    .portfolio-weight-input:read-only {
        background: rgba(30, 41, 59, 0.5);
        border-color: rgba(51, 65, 85, 0.5);
    }

.portfolio-weight-symbol {
    font-size: 0.875rem;
    color: rgba(226, 232, 240, 0.7);
}

.portfolio-menu-btn {
    padding: 0.25rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: rgba(226, 232, 240, 0.5);
    transition: all 0.2s;
}

    .portfolio-menu-btn:hover {
        background: var(--accent);
    }

.portfolio-actions {
    display: flex;
    gap: 0.5rem;
}

    .portfolio-actions .btn {
        flex: 1;
    }

.portfolio-sector-section {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

.sector-label {
    font-size: 0.875rem;
    color: rgba(226, 232, 240, 0.7);
    margin-bottom: 0.75rem;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.radio-input {
    accent-color: var(--primary);
}

.update-btn {
    width: 100%;
    margin-top: 0.75rem;
}

/* Performance Section */
.performance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.performance-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.performance-toggle {
    padding: 0.375rem 0.75rem;
    background: var(--accent);
    color: var(--accent-foreground);
    font-size: 0.875rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

    .performance-toggle:hover {
        background: #475569;
    }

.performance-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.performance-tab {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

    .performance-tab:not(.active) {
        background: var(--secondary);
        color: var(--secondary-foreground);
    }

        .performance-tab:not(.active):hover {
            background: #475569;
        }

    .performance-tab.active {
        background: var(--primary);
        color: var(--primary-foreground);
    }

.compare-result {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(51, 65, 85, 0.3);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.compare-result-title {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.compare-result-subtitle {
    font-size: 0.875rem;
    color: rgba(226, 232, 240, 0.7);
}

/* Chart */
.chart-container {
    background: rgba(51, 65, 85, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid rgba(51, 65, 85, 0.5);
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 0;
    color: rgba(226, 232, 240, 0.6);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--muted);
    }

/* Hide content by default */
.page-section {
    display: none;
}

    .page-section.active {
        display: block;
    }

.tab-content {
    display: none;
}

    .tab-content.active {
        display: block;
    }

/* SVG Icons */
.icon-svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.icon-scale {
    width: 20px;
    height: 20px;
}

/* Theme Toggle Button */
.theme-toggle {
    padding: 0.5rem;
    background: var(--accent);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--foreground);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .theme-toggle:hover {
        background: var(--muted);
    }

</style >
