/* ============================================
   NavOption - Unified Stylesheet
   ============================================ */

/* --- CSS Variables (Design Tokens) --- */
:root {
    /* Default Dark Mode */
    --bg-body: #0a0e14;
    --bg-card: rgba(22, 27, 34, 0.7);
    --bg-input: #0d1117;
    
    --primary: #00f3ff;
    --primary-dim: rgba(0, 243, 255, 0.1);
    --secondary: #7d8590;
    --accent: #ffd700;
    
    --success: #00d26a;
    --danger: #f85149;
    --warning: #e3b341;
    
    --text-main: #e6edf3;
    --text-muted: #8b949e;
    --border: #30363d;
    
    --glass-border: 1px solid rgba(240, 246, 252, 0.1);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);

    --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Animation timing */
    --transition-fast: 150ms ease-out;
    --transition-normal: 200ms ease-out;
    --transition-slow: 300ms ease-out;
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-body: #f6f8fa;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-input: #ffffff;
    
    --primary: #0969da;
    --primary-dim: rgba(9, 105, 218, 0.1);
    --secondary: #57606a;
    --accent: #d97706;
    
    --success: #1a7f37;
    --danger: #cf222e;
    --warning: #9a6700;
    
    --text-main: #1f2328;
    --text-muted: #656d76;
    --border: #d0d7de;
    
    --glass-border: 1px solid rgba(27, 31, 35, 0.15);
    --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* --- Base Styles --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-ui);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background-image: 
        linear-gradient(rgba(128, 128, 128, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(128, 128, 128, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* Page load animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 16px;
    animation: fadeIn 0.4s ease-out;
}

@media (min-width: 768px) {
    .app-container {
        padding: 20px;
    }
}

/* Narrow container for text-heavy pages */
.app-container--narrow {
    max-width: 1000px;
}

/* --- Navbar --- */
.navbar {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    padding: 12px 16px;
    margin-bottom: 24px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow var(--transition-normal);
}

@media (min-width: 768px) {
    .navbar {
        padding: 15px 20px;
        margin-bottom: 30px;
    }
}

.navbar--scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.brand-logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color var(--transition-fast);
}

@media (min-width: 768px) {
    .brand-logo {
        font-size: 1.5rem;
        gap: 10px;
    }
}

.brand-logo:hover {
    color: var(--primary);
}

.brand-logo i,
.brand-logo svg {
    color: var(--primary);
    width: 24px;
    height: 24px;
}

.brand-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 12px;
    font-weight: 400;
    border-left: 1px solid var(--border);
    padding-left: 12px;
    display: none;
}

@media (min-width: 768px) {
    .brand-subtitle {
        display: inline-block;
    }
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
}

.theme-toggle:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* --- Glass Cards --- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    padding: 20px;
    margin-bottom: 20px;
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

@media (min-width: 768px) {
    .glass-card {
        padding: 24px;
        margin-bottom: 24px;
    }
}

.glass-card:hover {
    box-shadow: var(--glass-shadow), 0 0 0 1px var(--primary-dim);
}

/* Light mode: ensure card visibility */
[data-theme="light"] .glass-card {
    border: 1px solid var(--border);
}

/* --- Section Titles --- */
.section-title {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
}

.section-subtitle {
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 20px 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (min-width: 768px) {
    .section-subtitle {
        font-size: 1.2rem;
        margin: 25px 0 15px;
    }
}

.section-subtitle::before {
    content: '';
    display: block;
    width: 4px;
    height: 1.2rem;
    background: var(--primary);
    border-radius: 2px;
    flex-shrink: 0;
}

/* --- Text Content --- */
.text-content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.text-content p {
    margin-bottom: 1rem;
}

.text-content ul {
    padding-left: 20px;
    margin-bottom: 1rem;
}

.text-content li {
    margin-bottom: 8px;
}

.text-content a {
    color: var(--primary);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.text-content a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* --- Forms & Controls --- */
.control-panel {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .control-panel {
        gap: 15px;
    }
}

.filter-group {
    flex: 1;
    min-width: 100%;
}

@media (min-width: 480px) {
    .filter-group {
        min-width: 140px;
    }
}

.filter-group--auto {
    flex: 0 0 auto;
    min-width: auto;
}

.filter-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (min-width: 768px) {
    .filter-label {
        font-size: 0.75rem;
    }
}

.form-control {
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 10px 12px;
    width: 100%;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    background-color: var(--bg-input);
    color: var(--text-main);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
    outline: none;
}

/* Switch toggle */
.form-check-input {
    cursor: pointer;
    min-width: 44px;
    min-height: 24px;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Action Button */
.btn-action {
    background-color: var(--primary);
    color: #000;
    font-weight: 600;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

[data-theme="light"] .btn-action {
    color: #fff;
}

.btn-action:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 15px var(--primary-dim);
}

.btn-action:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-action:active {
    transform: scale(0.98);
}

/* --- Side Toggle --- */
.side-toggle .btn-check:checked + .btn-outline-primary {
    background: var(--primary);
    color: var(--bg-body);
    border-color: var(--primary);
}
.side-toggle .btn-outline-primary {
    color: var(--text-muted);
    border-color: var(--border);
    background: transparent;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
}
.side-toggle .btn-outline-primary:hover {
    background: var(--primary-dim);
    color: var(--primary);
}

/* --- Advanced Filters --- */
.btn-advanced-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.25rem 0;
    transition: color var(--transition-fast);
}
.btn-advanced-toggle:hover { color: var(--primary); }
.btn-advanced-toggle[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}
.btn-advanced-toggle .fa-chevron-down {
    transition: transform var(--transition-normal);
}

/* --- Sector Chips --- */
.filter-group--sectors { min-width: 100%; }
.sector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.sector-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.sector-chip:hover { border-color: var(--primary); color: var(--text-main); }
.sector-chip input { margin: 0; width: 12px; height: 12px; accent-color: var(--primary); }

/* --- Watch Button --- */
.btn-watch {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.8rem;
    transition: color var(--transition-fast);
}
.btn-watch:hover { color: var(--accent); }

/* --- Watchlist Badge --- */
.watchlist-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
#watchlistToggle { position: relative; }

/* --- Watchlist Sidebar --- */
.watchlist-sidebar {
    position: fixed;
    top: 0;
    right: -360px;
    width: 350px;
    height: 100vh;
    background: var(--bg-card);
    border-left: var(--glass-border);
    backdrop-filter: blur(20px);
    box-shadow: var(--glass-shadow);
    z-index: 1050;
    transition: right var(--transition-slow);
    display: flex;
    flex-direction: column;
}
.watchlist-sidebar--open { right: 0; }
.watchlist-sidebar__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: var(--glass-border);
    color: var(--text-main);
}
.watchlist-sidebar__close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}
.watchlist-sidebar__body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

/* --- Watchlist Item --- */
.watchlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.watchlist-item__info { display: flex; flex-direction: column; gap: 2px; }
.watchlist-item__symbol { font-weight: 600; color: var(--text-main); font-size: 0.85rem; }
.watchlist-item__actions { display: flex; gap: 0.4rem; }
.btn-watch-alert, .btn-watch-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.75rem;
}
.btn-watch-alert:hover { color: var(--warning); }
.btn-watch-remove:hover { color: var(--danger); }

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast-item {
    background: var(--bg-card);
    border: var(--glass-border);
    backdrop-filter: blur(10px);
    color: var(--text-main);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    box-shadow: var(--glass-shadow);
    animation: toastIn 0.3s ease-out, toastOut 0.3s ease-in 3.5s forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* --- Data Table Styles --- */
.table-container {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Scroll indicator gradient */
.table-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, transparent, var(--bg-card));
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.table-container.is-scrollable::after {
    opacity: 1;
}

table.dataTable {
    color: var(--text-main) !important;
    border-collapse: separate !important;
    border-spacing: 0 4px !important;
    width: 100% !important;
}

table.dataTable thead th {
    border-bottom: 2px solid var(--border) !important;
    color: var(--text-muted) !important;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 8px !important;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: var(--bg-card);
}

@media (min-width: 768px) {
    table.dataTable thead th {
        font-size: 0.75rem;
        padding: 12px 10px !important;
    }
}

/* Sortable column indicators */
table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::after {
    opacity: 0.5;
}

table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::after {
    color: var(--primary) !important;
    opacity: 1;
}

table.dataTable tbody tr {
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

table.dataTable tbody tr:hover {
    background-color: var(--primary-dim) !important;
}

table.dataTable tbody tr:nth-child(even) td {
    background-color: rgba(128, 128, 128, 0.03) !important;
}

table.dataTable tbody td {
    background-color: var(--bg-input) !important;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 10px 8px !important;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    vertical-align: middle;
    color: var(--text-main);
    transition: background-color var(--transition-fast);
}

@media (min-width: 768px) {
    table.dataTable tbody td {
        padding: 12px 10px !important;
        font-size: 0.9rem;
    }
}

/* First/last cell rounding */
table.dataTable tbody td:first-child {
    border-left: 1px solid var(--border);
    border-radius: 8px 0 0 8px;
}

table.dataTable tbody td:last-child {
    border-right: 1px solid var(--border);
    border-radius: 0 8px 8px 0;
}

/* --- Value Colors --- */
.text-up { color: var(--success) !important; }
.text-down { color: var(--danger) !important; }
.text-muted-soft { opacity: 0.7; }

/* --- Table Cell Styles --- */
.text-end { text-align: right !important; }
.font-mono { font-family: var(--font-mono) !important; }

.symbol-cell {
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
}

.symbol-clickable {
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.symbol-clickable:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* --- Stock Detail Modal --- */
.stock-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.stock-modal--visible {
    opacity: 1;
    visibility: visible;
}

.stock-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.stock-modal__content {
    position: relative;
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 480px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
}

.stock-modal--visible .stock-modal__content {
    transform: translateY(0);
}

.stock-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.stock-modal__close:hover {
    background: var(--primary-dim);
    color: var(--primary);
}

.stock-modal__error {
    text-align: center;
    color: var(--danger);
    padding: 40px 20px;
}

/* Stock Detail Styles */
.stock-detail__header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.stock-detail__symbol {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-mono);
}

.stock-detail__name {
    font-size: 0.95rem;
    color: var(--text-main);
    margin-top: 4px;
}

.stock-detail__exchange {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.stock-detail__price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 20px;
}

.stock-detail__last {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-main);
}

.stock-detail__change {
    font-size: 1rem;
    font-family: var(--font-mono);
    font-weight: 500;
}

.stock-detail__section {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 20px 0 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.stock-detail__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stock-detail__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.stock-detail__label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stock-detail__value {
    font-size: 0.9rem;
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text-main);
}

.dte-badge {
    display: inline-block;
    background: var(--primary-dim) !important;
    color: var(--primary) !important;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 6px;
}

[data-theme="light"] .dte-badge {
    background: rgba(9, 105, 218, 0.15) !important;
}

.apy-cell {
    font-weight: 600;
    font-family: var(--font-mono);
}

.chg-cell {
    font-weight: 500;
}

/* --- DataTables Pagination --- */
.dataTables_wrapper .page-item .page-link {
    background-color: var(--bg-input) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px;
    margin: 0 2px;
    padding: 8px 14px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.dataTables_wrapper .page-item.disabled .page-link {
    background-color: var(--bg-input) !important;
    color: var(--text-muted) !important;
    opacity: 0.5;
}

.dataTables_wrapper .page-item:not(.active):not(.disabled) .page-link:hover {
    background-color: var(--primary-dim) !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.dataTables_wrapper .page-item.active .page-link {
    background-color: var(--primary) !important;
    color: #000 !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 15px var(--primary-dim);
    font-weight: 600;
}

[data-theme="light"] .dataTables_wrapper .page-item.active .page-link {
    color: #fff !important;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info {
    color: var(--text-muted) !important;
    margin-top: 1rem;
    font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-main) !important;
    border-radius: 6px;
    padding: 6px 10px;
    min-height: 36px;
}

.dataTables_wrapper .dataTables_length select {
    padding-right: 28px;
    min-width: 70px;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px var(--primary-dim);
    outline: none;
}

/* --- Loading Overlay --- */
.loading-overlay {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.tech-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    box-shadow: 0 0 20px var(--primary-dim);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px var(--primary-dim); }
    50% { box-shadow: 0 0 40px var(--primary-dim), 0 0 60px var(--primary-dim); }
}

.tech-spinner--pulsing {
    animation: spin 1s infinite linear, pulse-glow 2s infinite ease-in-out;
}

.loading-text {
    color: var(--primary);
    letter-spacing: 2px;
    font-size: 0.75rem;
    margin-top: 16px;
    text-transform: uppercase;
}

/* --- Empty State --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state__icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    opacity: 0.5;
    margin-bottom: 16px;
}

.empty-state__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.empty-state__description {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 300px;
}

/* --- Pricing --- */
.price-tag {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-mono);
}

.price-sub {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.price-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

/* --- Contact Info --- */
.contact-info strong {
    color: var(--primary);
}

/* --- Footer --- */
.footer {
    margin-top: 40px;
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer__links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
    padding: 4px 0;
}

.footer a:hover {
    color: var(--primary);
}

.footer__tagline {
    margin-bottom: 8px;
    opacity: 0.75;
}

.footer__copyright {
    margin: 0;
    opacity: 0.5;
}

/* --- Utilities --- */
.fw-bold { font-weight: 600 !important; }
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-main { color: var(--text-main) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.m-0 { margin: 0 !important; }

.d-none { display: none !important; }
.d-flex { display: flex !important; }

.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }

.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

.opacity-75 { opacity: 0.75 !important; }
.opacity-50 { opacity: 0.5 !important; }

.small { font-size: 0.875rem !important; }

.border-bottom { border-bottom: 1px solid var(--border) !important; }
.pb-3 { padding-bottom: 1rem !important; }

.w-100 { width: 100% !important; }

.pt-1 { padding-top: 0.25rem !important; }

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .app-container {
        animation: none;
    }
}

/* --- Focus Visible (keyboard only) --- */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ============================================
   Sector Tags
   ============================================ */

.sector-tags-container {
    margin-bottom: 1rem;
    overflow: hidden;
}

.sector-tags {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-dim) transparent;
}

.sector-tags::-webkit-scrollbar {
    height: 4px;
}

.sector-tags::-webkit-scrollbar-track {
    background: transparent;
}

.sector-tags::-webkit-scrollbar-thumb {
    background: var(--primary-dim);
    border-radius: 2px;
}

.sector-tag {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.sector-tag:hover {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
}

.sector-tag--active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--bg-body);
}

.sector-tag--active:hover {
    opacity: 0.9;
}

/* Call Filter Banner */
.call-filter-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--accent);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 1px solid var(--accent);
    border-radius: 12px;
    color: var(--text-main);
}

.call-filter-banner__content {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.call-filter-banner__content strong {
    color: var(--accent);
    font-family: var(--font-mono);
    margin: 0 0.25rem;
}

/* ============================================
   Wheel Strategy V2 - Portfolio Panel
   ============================================ */

/* Portfolio Panel 容器 */

/* 盈亏分析面板 */
/* P&L 摘要条 */
.pnl-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}
.portfolio-panel > .pnl-strip {
    flex: 0 0 100%;
}
.pnl-strip__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.pnl-strip__item i {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.pnl-strip__label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.pnl-strip__divider {
    width: 1px;
    height: 1.4rem;
    background: var(--border);
}

.pnl-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-mono);
    transition: color var(--transition-fast);
}

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

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

/* Portfolio Cards 网格布局 */
.portfolio-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.portfolio-panel > .portfolio-card {
    flex: 1 1 calc(33.333% - 0.67rem);
    min-width: 0;
}

@media (max-width: 1024px) {
    .portfolio-panel > .portfolio-card {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .portfolio-panel > .portfolio-card:last-child {
        margin-bottom: 0;
    }
}

/* Portfolio Card */
.portfolio-card {
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
}

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

.portfolio-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.portfolio-card--puts .portfolio-card__title {
    color: var(--success);
}

.portfolio-card--stocks .portfolio-card__title {
    color: var(--primary);
}

.portfolio-card--calls .portfolio-card__title {
    color: var(--accent);
}

.portfolio-card__body {
    padding: 1rem;
}

.portfolio-card__empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 1rem 0;
}

/* Position Item */
.position-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-input);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border-left: 3px solid transparent;
    transition: all var(--transition-fast);
}

.position-item:last-child {
    margin-bottom: 0;
}

.position-item:hover {
    background: var(--primary-dim);
    transform: translateX(2px);
}

.position-item--put {
    border-left-color: var(--success);
}

.position-item--stock {
    border-left-color: var(--primary);
}

.position-item--call {
    border-left-color: var(--accent);
}

.position-item__main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.position-item__symbol {
    font-size: 1.125rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-main);
}

.position-item__details {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.position-item__exp,
.position-item__premium {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.position-item__actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.position-item__actions .btn {
    white-space: nowrap;
}

.btn-mark-assigned {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.btn-mark-assigned:hover {
    opacity: 0.9;
}

.btn-sell-call {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-body);
}

.btn-sell-call:hover {
    opacity: 0.9;
}

.btn-mark-closed {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-mark-closed:hover {
    opacity: 0.9;
}

.btn-remove-put,
.btn-remove-stock,
.btn-remove-call {
    padding: 0.25rem 0.5rem;
}

/* Track Modals */
.track-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.track-modal--active {
    display: flex;
}

.track-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.track-modal__content {
    position: relative;
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 450px;
    width: 90%;
    box-shadow: var(--glass-shadow);
}

.track-modal__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.track-modal__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.track-modal__field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.track-modal__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.track-modal__input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 1rem;
}

.track-modal__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

.track-modal__actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.track-modal__btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.track-modal__btn--primary {
    background: var(--primary);
    color: var(--bg-body);
}

.track-modal__btn--primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.track-modal__btn--secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.track-modal__btn--secondary:hover {
    background: var(--bg-input);
    color: var(--text-main);
}

/* Confirm Dialog */
.confirm-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}
.confirm-modal--active {
    display: flex;
}
.confirm-modal__backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.confirm-modal__content {
    position: relative;
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 2rem 1.8rem 1.5rem;
    max-width: 360px;
    width: 85%;
    text-align: center;
    box-shadow: var(--glass-shadow);
    animation: confirmIn 0.2s ease-out;
}
@keyframes confirmIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.confirm-modal__icon {
    font-size: 2rem;
    color: var(--warning, #f0ad4e);
    margin-bottom: 0.8rem;
}
.confirm-modal__message {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}
.confirm-modal__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}
.confirm-modal__btn {
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}
.confirm-modal__btn--cancel {
    background: var(--bg-input, #2a2a3e);
    color: var(--text-secondary);
}
.confirm-modal__btn--cancel:hover {
    background: var(--border);
    color: var(--text-main);
}
.confirm-modal__btn--confirm {
    background: var(--danger, #dc3545);
    color: #fff;
}
.confirm-modal__btn--confirm:hover {
    filter: brightness(1.15);
}
/* ============================================
   Wheel Strategy - Holdings Area (DEPRECATED)
   ============================================ */

/* Wheel Mode Toggle */
.wheel-mode-toggle .btn-outline-primary {
    transition: all var(--transition-normal);
}

.wheel-mode-toggle input[value="sell-put"]:checked + label {
    background: var(--primary);
    color: var(--bg-body);
    border-color: var(--primary);
}

.wheel-mode-toggle input[value="sell-call"]:checked + label {
    background: var(--accent);
    color: var(--bg-body);
    border-color: var(--accent);
}

/* Holdings Area */
#holdingsArea {
    margin-bottom: 1.5rem;
}

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

.holdings-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.holdings-scroll-view {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 4px 0 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-dim) transparent;
}

.holdings-scroll-view::-webkit-scrollbar {
    height: 6px;
}

.holdings-scroll-view::-webkit-scrollbar-track {
    background: transparent;
}

.holdings-scroll-view::-webkit-scrollbar-thumb {
    background: var(--primary-dim);
    border-radius: 3px;
}

.holdings-scroll-view::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Holding Card */
.holding-card {
    min-width: 200px;
    background: var(--bg-input);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

.holding-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-dim);
    border-color: var(--primary);
}

.holding-card--active {
    background: var(--primary-dim);
    box-shadow: 0 0 15px var(--primary-dim);
    border-color: var(--primary);
}

.holding-card__symbol {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
}

.holding-card__info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.holding-card__row {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
}

.holding-card__label {
    font-weight: 500;
}

.holding-card__value {
    font-family: var(--font-mono);
    color: var(--text-main);
}

.holding-card__value--positive {
    color: var(--success);
}

.holding-card__value--negative {
    color: var(--danger);
}

.holding-card__remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.holding-card:hover .holding-card__remove {
    opacity: 1;
}

.holding-card__remove:hover {
    color: var(--danger);
}

/* Empty Holdings State */
.empty-holdings {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
    text-align: center;
    width: 100%;
}

.empty-holdings i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-holdings p {
    margin: 0;
    font-size: 0.875rem;
}

/* Exercise Modal */
.exercise-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
}

.exercise-modal--active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.exercise-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.exercise-modal__content {
    position: relative;
    background: var(--bg-card);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--glass-shadow);
}

.exercise-modal__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.exercise-modal__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.exercise-modal__field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.exercise-modal__label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.exercise-modal__input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 1rem;
}

.exercise-modal__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}

.exercise-modal__actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.exercise-modal__btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.exercise-modal__btn--primary {
    background: var(--primary);
    color: var(--bg-body);
}

.exercise-modal__btn--primary:hover {
    background: var(--primary);
    opacity: 0.9;
    transform: translateY(-1px);
}

.exercise-modal__btn--secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.exercise-modal__btn--secondary:hover {
    background: var(--bg-input);
    color: var(--text-main);
}

:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   推荐信号可视化样式
   ============================================ */

/* 评分标签 */
.score-tag {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    background: var(--tag-color);
    color: var(--bg-body);
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    display: inline-block;
    min-width: 2rem;
    text-align: center;
}

/* APY 值容器 */
.apy-value {
    font-family: var(--font-mono);
}

/* 流动性指标（自定义信号条） */
.liquidity-indicator {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    margin-left: 0.25rem;
    height: 14px;
    vertical-align: middle;
}

.liquidity-indicator .bar {
    width: 3px;
    border-radius: 1px;
}

.liquidity-indicator .bar:nth-child(1) {
    height: 4px;
}

.liquidity-indicator .bar:nth-child(2) {
    height: 8px;
}

.liquidity-indicator .bar:nth-child(3) {
    height: 12px;
}

/* Level 1: 红色，只显示第1格 */
.liquidity-1 .bar {
    background: var(--danger);
}

.liquidity-1 .bar:nth-child(2),
.liquidity-1 .bar:nth-child(3) {
    opacity: 0.2;
}

/* Level 2: 黄色，显示前2格 */
.liquidity-2 .bar {
    background: var(--warning);
}

.liquidity-2 .bar:nth-child(3) {
    opacity: 0.2;
}

/* Level 3: 绿色，显示全部3格 */
.liquidity-3 .bar {
    background: var(--success);
}

/* 风险标记样式优化 */
.badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.bg-success {
    background-color: var(--success) !important;
    color: var(--bg-body);
}

.badge.bg-warning {
    background-color: var(--warning) !important;
    color: var(--bg-body);
}

.badge.bg-danger {
    background-color: var(--danger) !important;
    color: var(--bg-body);
}

/* --- Risk Card Popover --- */
.risk-card {
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.875rem;
    backdrop-filter: blur(10px);
    box-shadow: var(--glass-shadow);
    min-width: 200px;
}

.risk-card > div {
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
}

.risk-card > div:last-child {
    margin-bottom: 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    font-weight: 600;
    color: var(--primary);
}

.risk-card__label {
    color: var(--text-muted);
    margin-right: 1rem;
}

.risk-card__value {
    font-family: var(--font-mono);
    font-weight: 600;
}

/* Risk Badge 悬停效果 */
.risk-badge-hover {
    cursor: help;
    position: relative;
    transition: transform var(--transition-fast);
}

.risk-badge-hover:hover {
    transform: scale(1.05);
}

/* Popover 容器 */
.risk-popover {
    position: absolute;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.risk-popover.show {
    opacity: 1;
    pointer-events: auto;
}

