/* White Oak Allocation Model - Styles */

/* CSS Variables */
:root {
    --bg-primary: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --accent: #1a1a2e;
    --accent-hover: #2d2d4a;
    --positive: #059669;
    --positive-bg: #ecfdf5;
    --negative: #dc2626;
    --negative-bg: #fef2f2;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-container {
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.last-updated {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.refresh-icon {
    display: inline-block;
    margin-right: 4px;
}

/* Navigation */
.nav {
    display: flex;
    gap: 4px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.nav-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.15s ease;
}

.nav-btn:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--accent);
    color: white;
}

/* Main Content */
.main-content {
    padding: 24px 0;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.view-header h2 {
    font-size: 20px;
    font-weight: 600;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h3 {
    margin-bottom: 0;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: -12px;
    margin-bottom: 16px;
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    text-align: center;
    padding: 24px 16px;
}

.summary-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.summary-value.positive { color: var(--positive); }
.summary-value.negative { color: var(--negative); }

.summary-sub {
    font-size: 13px;
    color: var(--text-secondary);
}

.summary-sub.positive { color: var(--positive); }
.summary-sub.negative { color: var(--negative); }

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 16px;
}

/* Charts */
.chart-card {
    height: fit-content;
}

.chart-container {
    position: relative;
    height: 280px;
}

.chart-container.chart-large {
    height: 350px;
}

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

.holdings-table,
.transactions-table,
.projection-table,
.snapshots-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.holdings-table th,
.holdings-table td,
.transactions-table th,
.transactions-table td,
.projection-table th,
.projection-table td,
.snapshots-table th,
.snapshots-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.holdings-table th,
.transactions-table th,
.projection-table th,
.snapshots-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.holdings-table tbody tr:hover,
.transactions-table tbody tr:hover {
    background: var(--border-light);
    cursor: pointer;
}

.text-right {
    text-align: right !important;
}

.holdings-table .ticker {
    font-family: var(--font-mono);
    font-weight: 600;
}

.holdings-table .value,
.projection-table .value {
    font-family: var(--font-mono);
}

.full-table {
    font-size: 12px;
}

.loading {
    text-align: center;
    color: var(--text-muted);
    padding: 24px !important;
}

/* Positive/Negative Colors */
.positive { color: var(--positive); }
.negative { color: var(--negative); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border-light);
}

.btn-danger {
    background: var(--negative);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Alerts */
.alerts-card {
    border-left: 4px solid var(--warning);
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.alert-item:last-child {
    border-bottom: none;
}

.alert-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.alert-icon.high {
    background: var(--negative-bg);
    color: var(--negative);
}

.alert-icon.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 500;
    margin-bottom: 2px;
}

.alert-action {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Empty State Banner */
.empty-state-banner {
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.empty-state-banner strong {
    display: block;
    color: var(--warning);
    margin-bottom: 4px;
}

.empty-state-banner p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* Performance Table */
.performance-table {
    width: 100%;
    border-collapse: collapse;
}

.performance-table th,
.performance-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.performance-table th {
    text-align: left;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.performance-table .total-row {
    font-weight: 600;
    border-top: 2px solid var(--border);
}

/* P/L Breakdown */
.pl-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pl-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.pl-row.total {
    border-top: 2px solid var(--border);
    padding-top: 12px;
    margin-top: 4px;
    font-weight: 600;
}

/* Projections */
.projections-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.horizon-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.horizon-selector label {
    font-size: 13px;
    color: var(--text-secondary);
}

.horizon-selector select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 13px;
}

/* Monte Carlo Summary */
.mc-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.mc-stat {
    text-align: center;
    padding: 12px 8px;
    background: var(--border-light);
    border-radius: var(--radius);
}

.mc-stat.highlight {
    background: var(--accent);
    color: white;
}

.mc-stat.highlight .mc-label {
    color: rgba(255, 255, 255, 0.8);
}

.mc-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.mc-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.settings-grid > .card:first-child {
    grid-row: span 2;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group input[readonly] {
    background: var(--border-light);
    color: var(--text-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content form {
    padding: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.modal-actions .btn-danger {
    margin-right: auto;
}

/* Action Buttons in Tables */
.action-btn {
    padding: 4px 8px;
    font-size: 11px;
    background: var(--border-light);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
}

.action-btn:hover {
    background: var(--border);
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .projections-grid {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-grid > .card:first-child {
        grid-row: auto;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 0 16px;
    }

    .header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav::-webkit-scrollbar {
        display: none;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .summary-value {
        font-size: 24px;
    }

    .mc-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .view-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* Summary Grid Variants */
.summary-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* View Header Actions */
.view-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.view-header-actions select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 13px;
    background: var(--bg-card);
}

/* Action Badges */
.action-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.action-buy {
    background: var(--positive-bg);
    color: var(--positive);
}

.action-sell {
    background: var(--negative-bg);
    color: var(--negative);
}

.action-dividend {
    background: #dbeafe;
    color: #2563eb;
}

/* Source Badges */
.source-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 500;
}

.source-live {
    background: var(--positive-bg);
    color: var(--positive);
}

.source-manual {
    background: var(--warning-bg);
    color: var(--warning);
}

.source-unavailable {
    background: var(--negative-bg);
    color: var(--negative);
}

/* Action Buttons */
.action-btn-danger {
    background: var(--negative-bg);
    color: var(--negative);
}

.action-btn-danger:hover {
    background: var(--negative);
    color: white;
}

/* Warning Text */
.warning-text {
    color: var(--warning);
    font-weight: 500;
}

/* Comparison Grid */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.comparison-column {
    padding: 20px;
    background: var(--border-light);
    border-radius: var(--radius);
}

.comparison-column.benchmark {
    background: var(--accent);
    color: white;
}

.comparison-column.benchmark .comparison-label {
    color: rgba(255, 255, 255, 0.7);
}

.comparison-header {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.comparison-column.benchmark .comparison-header {
    border-color: rgba(255, 255, 255, 0.2);
}

.comparison-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.comparison-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.comparison-value {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
}

/* Allocation Tool */
.allocation-tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Allocation Charts Grid */
.allocation-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-light);
}

.allocation-chart-panel {
    text-align: center;
}

.allocation-chart-panel h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.allocation-chart-container {
    position: relative;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
}

.allocation-total {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 12px;
}

/* Color dot for legend */
.color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

/* CAGR Breakdown Section */
.cagr-breakdown-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.cagr-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 8px;
}

.cagr-breakdown-table th,
.cagr-breakdown-table td {
    padding: 8px 6px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.cagr-breakdown-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
}

.cagr-breakdown-table .total-row {
    border-top: 2px solid var(--border);
    background: var(--border-light);
}

.breakdown-note {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
}

.breakdown-note a {
    color: var(--accent);
    text-decoration: none;
}

.breakdown-note a:hover {
    text-decoration: underline;
}

/* Info tooltip */
.info-tooltip {
    display: inline-block;
    cursor: help;
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 4px;
}

.allocation-row {
    display: grid;
    grid-template-columns: 80px 120px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.allocation-row.new-position {
    grid-template-columns: 1fr 1fr;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 2px solid var(--border);
    border-bottom: none;
}

.allocation-ticker {
    font-family: var(--font-mono);
    font-weight: 600;
}

.allocation-current {
    font-size: 12px;
}

.allocation-label {
    color: var(--text-secondary);
}

.allocation-value {
    font-family: var(--font-mono);
    margin-left: 4px;
}

.allocation-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.allocation-input label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.allocation-input input {
    width: 100px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-mono);
}

.section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 16px 0 8px 0;
}

/* Simulation Results */
.simulation-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.sim-stat {
    text-align: center;
    padding: 12px;
    background: var(--border-light);
    border-radius: var(--radius);
}

.sim-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.sim-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
}

.simulation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.simulation-table th,
.simulation-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.simulation-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
}

/* Closed Trades Table */
.closed-trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.closed-trades-table th,
.closed-trades-table td {
    padding: 10px 6px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.closed-trades-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Text utilities */
.text-muted {
    color: var(--text-muted);
    font-size: 13px;
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-16 {
    margin-top: 16px;
}

/* Cash Input on Dashboard */
.cash-card .cash-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 8px 0;
}

.cash-card .currency-symbol {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.cash-card .cash-input {
    width: 140px;
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 600;
    text-align: right;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: border-color 0.15s ease;
}

.cash-card .cash-input:focus {
    outline: none;
    border-color: var(--accent);
}

.cash-card .cash-input:hover {
    border-color: var(--text-secondary);
}

/* Refresh Button States */
.btn.refreshing {
    opacity: 0.7;
    pointer-events: none;
}

.refresh-timestamp {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* Badge for new positions */
.badge {
    display: inline-block;
    padding: 2px 6px;
    background: var(--positive-bg);
    color: var(--positive);
    font-size: 9px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin-left: 4px;
    vertical-align: middle;
}

/* Cash row in simulation table */
.cash-row {
    background: var(--border-light);
    font-weight: 500;
}

/* Footer */
.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
}

.footer-separator {
    color: var(--text-muted);
}

/* Responsive adjustments for new components */
@media (max-width: 1024px) {
    .allocation-tool-grid {
        grid-template-columns: 1fr;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .summary-grid-3 {
        grid-template-columns: 1fr;
    }

    .allocation-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .allocation-row.new-position {
        grid-template-columns: 1fr;
    }

    .simulation-summary {
        grid-template-columns: 1fr;
    }

    .view-header-actions {
        flex-wrap: wrap;
    }
}

/* CAGR Calculator */
.cagr-calculator {
    margin-top: 16px;
    padding-bottom: 60px;
}

.cagr-calculator h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.cagr-inputs {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.cagr-inputs .input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cagr-inputs .input-group label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cagr-inputs .input-with-suffix {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cagr-inputs input {
    width: 80px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 14px;
    text-align: right;
}

.cagr-inputs input:focus {
    outline: none;
    border-color: var(--accent);
}

.cagr-inputs .suffix {
    color: var(--text-secondary);
    font-size: 13px;
}

.cagr-inputs .over-text {
    color: var(--text-muted);
    font-size: 13px;
    padding-bottom: 8px;
}

.cagr-result {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 8px;
    margin-left: 8px;
}

.cagr-result .label {
    color: var(--text-muted);
    font-size: 16px;
}

.cagr-result .value {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
    min-width: 50px;
}

.cagr-result .suffix {
    color: var(--text-secondary);
    font-size: 13px;
}

/* 13F Tracker Integration */
.status-message {
    font-size: 12px;
    padding: 8px 0;
    color: var(--text-secondary);
}

.status-message.success {
    color: var(--positive);
}

.status-message.error {
    color: var(--negative);
}

.path-input-group {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.path-input-group input {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12px;
}

.thirteenf-alerts-card {
    border-left: 4px solid #2563eb;
}

.thirteenf-alert-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.thirteenf-alert-row:last-child {
    border-bottom: none;
}

.alert-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 36px;
    text-align: center;
}

.alert-badge.new {
    background: var(--positive-bg);
    color: var(--positive);
}

.alert-badge.exit {
    background: var(--negative-bg);
    color: var(--negative);
}

.alert-badge.add,
.alert-badge.increase {
    background: #dbeafe;
    color: #2563eb;
}

/* Watchlist */
.overlap-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.overlap-row:last-child {
    border-bottom: none;
}

.watchlist-overlaps-card {
    border-left: 4px solid var(--positive);
    background: var(--positive-bg);
}

.notes-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Holdings 13F Intel Card */
.thirteenf-intel-card {
    border-left: 4px solid #2563eb;
    margin-top: 20px;
}

.thirteenf-intel-card h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: 12px;
    margin: 0 0 16px 0;
}

.holding-13f-item {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.holding-13f-item:last-child {
    margin-bottom: 0;
}

.holding-13f-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.holding-13f-header strong {
    font-size: 14px;
    color: var(--text-primary);
}

.investor-count {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--border-light);
    padding: 2px 8px;
    border-radius: 10px;
}

.holding-13f-investors {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.investor-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-light);
}

.investor-row:last-child {
    border-bottom: none;
}

.investor-name {
    color: var(--text-primary);
    font-weight: 500;
}

.investor-pct {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Allocation Tool Cash Summary */
.cash-summary-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 16px;
}

.cash-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
}

.cash-row:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.cash-row span:first-child {
    color: var(--text-secondary);
}

.cash-value {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

.cash-value.negative {
    color: var(--negative);
}

.cash-value.positive {
    color: var(--positive);
}

.cash-warning {
    display: block;
    font-size: 11px;
    color: var(--negative);
    font-weight: 500;
    margin-top: 2px;
}

/* Savings View */
.savings-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border-light);
}

.savings-total-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.savings-total-value {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 600;
    color: var(--positive);
}

.holder-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--border-light);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
}

.rate-badge {
    display: inline-block;
    padding: 2px 6px;
    background: var(--positive-bg);
    color: #065f46;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* Google Sheet Sync Status */
.sync-status {
    padding: 8px 16px;
    margin-bottom: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    font-size: 12px;
}

.sync-timestamp {
    color: var(--text-secondary);
}

.sync-timestamp.sync-success {
    color: var(--positive);
}

.sync-timestamp.sync-error {
    color: var(--negative);
}

.notes-cell {
    font-size: 12px;
    color: var(--text-muted);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Dashboard Tools Row (CAGR + Earnings) */
.small-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.small-cards-row > .card {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .small-cards-row {
        grid-template-columns: 1fr;
    }
}

/* Earnings Calendar */
.earnings-card {
    display: flex;
    flex-direction: column;
}

.earnings-card h3 {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.earnings-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.earnings-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.earnings-item:hover {
    background: var(--bg-secondary);
}

.earnings-item.earnings-soon {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
}

.earnings-item.earnings-soon:hover {
    background: #fde68a;
}

.earnings-ticker {
    font-family: var(--font-mono);
    font-weight: 600;
    min-width: 50px;
    color: var(--text-primary);
}

.manual-indicator {
    color: var(--accent);
    font-size: 11px;
    margin-left: 2px;
}

.earnings-date {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    min-width: 100px;
}

.earnings-days {
    color: var(--text-muted);
    font-size: 12px;
}

.earnings-item.earnings-soon .earnings-days {
    color: #b45309;
    font-weight: 500;
}

/* ============== Screener Styles ============== */

.screener-form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.screener-form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.screener-form-section h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

#view-screener .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

#view-screener input[type="text"],
#view-screener input[type="number"] {
    font-family: var(--font-mono);
}

.screener-rating-box {
    text-align: center;
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
    background: var(--border-light);
    border: 1px solid var(--border);
}

.screener-rating-score {
    font-size: 42px;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-bottom: 8px;
}

.screener-rating-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.screener-rating-recommendation {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

.screener-rating-company {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.screener-rating-company span {
    color: var(--text-primary);
    font-weight: 500;
}

.screener-score-item {
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.screener-score-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.screener-score-category {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13px;
}

.screener-score-value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
}

.screener-score-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.screener-score-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.screener-score-detail {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.screener-indicators-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.screener-indicators-section ul {
    list-style: disc;
}

.screener-indicators-section li {
    margin-bottom: 4px;
    font-size: 13px;
}
