/**
 * Stocks Dashboard Styles
 * Financial terminal aesthetic with dark theme
 */

/* ==========================================
   UPDATING BANNER (stale-while-revalidate)
   ========================================== */
.updating-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-tertiary, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 6px;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.8rem;
    margin-bottom: var(--spacing-md, 12px);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}

.updating-banner.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.updating-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--text-muted, #64748b);
    border-top-color: var(--accent-primary, #3b82f6);
    border-radius: 50%;
    animation: updating-spin 0.8s linear infinite;
}

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

/* ==========================================
   STOCKS PAGE LAYOUT
   ========================================== */
.stocks-page {
    max-width: 1600px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.last-update {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================
   SECTOR OVERVIEW CARDS
   ========================================== */
/* Index Performance Bar */
.index-performance-bar {
    display: flex;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.index-perf-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.index-perf-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.index-perf-price {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.index-perf-metric {
    font-size: 0.85rem;
}

.index-perf-tag {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-right: 2px;
}

/* Benchmark toggles */
.comparison-benchmarks {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.benchmark-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.benchmark-toggle input {
    cursor: pointer;
}

.sector-overview {
    margin-bottom: var(--spacing-2xl);
}

.sector-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

.sector-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.sector-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.sector-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.sector-card.megacap::before { background: #8b5cf6; }
.sector-card.internet::before { background: #06b6d4; }
.sector-card.software::before { background: #3b82f6; }
.sector-card.services::before { background: #f59e0b; }

.sector-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.sector-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sector-card-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.sector-card-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.sector-metric {
    text-align: center;
    padding: var(--spacing-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.sector-metric-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.sector-metric-value {
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.sector-metric-value.positive { color: var(--status-positive); }
.sector-metric-value.negative { color: var(--status-negative); }

.sector-top-stocks {
    margin-top: var(--spacing-md);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sector-top-stocks span {
    display: inline-block;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-right: 4px;
    margin-bottom: 4px;
}

/* Best/Worst performers section */
.sector-performers {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
}

.performer-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: 4px;
}

.performer-row:last-child {
    margin-bottom: 0;
}

.performer-label {
    color: var(--text-muted);
    min-width: 40px;
}

.performer {
    font-family: var(--font-mono);
}

.performer.positive {
    color: var(--color-positive);
}

.performer.negative {
    color: var(--color-negative);
}

.performer strong {
    font-weight: 600;
}

/* Two-column performer layout */
.sector-performers.two-col {
    display: flex;
    gap: var(--spacing-md);
}

.performer-col {
    flex: 1;
}

.performer-col-header {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--border-color);
}

.performer-loading {
    color: var(--text-muted);
    font-style: italic;
}

/* ==========================================
   STOCK TABLE
   ========================================== */
.stock-table-section {
    margin-bottom: var(--spacing-2xl);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.table-controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.filter-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.search-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
    color: var(--text-primary);
    width: 180px;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-height: 600px;
    overflow-x: auto;
    overflow-y: auto;
}

.stock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.stock-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-secondary);
}

.stock-table th {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    user-select: none;
}

.stock-table th.sortable {
    cursor: pointer;
    transition: color var(--transition-fast);
}

.stock-table th.sortable:hover {
    color: var(--color-primary);
}

.stock-table th.sortable::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 4px;
    vertical-align: middle;
}

.stock-table th.sortable.sort-asc::after {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid var(--color-primary);
}

.stock-table th.sortable.sort-desc::after {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--color-primary);
}

.stock-table th.numeric {
    text-align: right;
}

.stock-table td {
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.stock-table td.numeric {
    text-align: right;
}

.stock-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.stock-table tbody tr.group-header {
    background: var(--bg-secondary);
}

.stock-table tbody tr.group-header td {
    font-weight: 600;
    color: var(--text-secondary);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Sticky ticker column */
.sticky-col {
    position: sticky;
    left: 0;
    z-index: 5;
    background: var(--bg-card);
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.3);
}

.stock-table thead .sticky-col {
    background: var(--bg-secondary);
    z-index: 11; /* Above regular sticky col and thead */
}

.stock-table tbody tr .sticky-col {
    background: var(--bg-card);
}

.stock-table tbody tr:hover .sticky-col {
    background: var(--bg-tertiary);
}

/* Sticky summary rows (Mean/Median) at bottom */
.stock-table tfoot {
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.stock-table tfoot .summary-row {
    font-weight: 600;
    border-top: 2px solid var(--border-color);
}

.stock-table tfoot .mean-row {
    background: var(--bg-secondary);
}

.stock-table tfoot .mean-row td {
    background: var(--bg-secondary);
}

.stock-table tfoot .median-row {
    background: var(--bg-tertiary);
}

.stock-table tfoot .median-row td {
    background: var(--bg-tertiary);
}

.stock-table tfoot .summary-row .sticky-col {
    z-index: 12;
}

.stock-table tfoot .mean-row .sticky-col {
    background: var(--bg-secondary);
}

.stock-table tfoot .median-row .sticky-col {
    background: var(--bg-tertiary);
}

.col-ticker {
    min-width: 70px;
}

/* Ticker link styling */
.ticker-link {
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.ticker-link:hover {
    text-decoration: underline;
}

.ticker-link.selected {
    background: var(--color-primary);
    color: white;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* Conditional formatting */
.cell-positive { color: var(--status-positive); }
.cell-negative { color: var(--status-negative); }

.cell-heat-1 { background: rgba(34, 197, 94, 0.1); }
.cell-heat-2 { background: rgba(34, 197, 94, 0.2); }
.cell-heat-3 { background: rgba(34, 197, 94, 0.3); }
.cell-heat-neg-1 { background: rgba(239, 68, 68, 0.1); }
.cell-heat-neg-2 { background: rgba(239, 68, 68, 0.2); }
.cell-heat-neg-3 { background: rgba(239, 68, 68, 0.3); }

/* Valuation color coding */
.pe-cheap { color: var(--status-positive); }
.pe-fair { color: var(--text-primary); }
.pe-expensive { color: var(--status-negative); }

/* N/M (Not Meaningful) value styling */
.nm-value {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.75em;
}

/* Sector pills */
.sector-pill, .subsector-pill {
    display: inline-block;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    font-family: var(--font-sans);
}

.sector-pill {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.sector-pill.sector-megacap { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.sector-pill.sector-internet { background: rgba(6, 182, 212, 0.2); color: #22d3d1; }
.sector-pill.sector-software { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.sector-pill.sector-services { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

.subsector-pill {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 0.6rem;
}

/* 52-week high distance color coding (red gradient) */
.pct52-near { color: var(--text-primary); }           /* Within 5% of high */
.pct52-mid { color: #fbbf24; }                        /* 5-15% below */
.pct52-far { color: #f97316; }                        /* 15-30% below */
.pct52-veryfar { color: var(--status-negative); }     /* 30%+ below */

/* Company name column */
.col-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-sans);
}

.loading-cell {
    text-align: center;
    padding: var(--spacing-xl) !important;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.table-hint {
    font-style: italic;
}

/* ==========================================
   CHARTS SECTION
   ========================================== */
.charts-section {
    margin-bottom: var(--spacing-2xl);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.chart-container.chart-wide {
    grid-column: span 2;
}

.select-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
}

/* YTD Bar Chart scrollable container */
.ytd-bar-container {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.ytd-bar-container canvas {
    min-height: 300px;
}

/* Custom scrollbar for YTD bar chart */
.ytd-bar-container::-webkit-scrollbar {
    width: 8px;
}

.ytd-bar-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.ytd-bar-container::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

.ytd-bar-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================
   TREEMAP STYLES
   ========================================== */
.treemap-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.treemap-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--bg-tertiary);
}

.treemap-sector {
    box-sizing: border-box;
}

.treemap-tile {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}

.treemap-tile:hover {
    opacity: 0.85;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.treemap-ticker {
    font-weight: 700;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding: 0 2px;
}

.treemap-ytd {
    font-size: 9px;
    line-height: 1.2;
    text-align: center;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.treemap-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-style: italic;
}

/* Treemap color legend */
.treemap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
}

.treemap-legend .legend-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.treemap-legend .legend-gradient {
    width: 200px;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(
        to right,
        #C0392B 0%,
        #E74C3C 25%,
        #7F8C8D 50%,
        #27AE60 75%,
        #1E8449 100%
    );
    border: 1px solid var(--border-color);
}

/* 52W High gradient (red only) */
.treemap-legend .legend-gradient.gradient-52w {
    background: linear-gradient(
        to right,
        #b91c1c 0%,
        #dc2626 25%,
        #f87171 50%,
        #fca5a5 75%,
        #e5e7eb 100%
    );
}

/* 2x2 Treemap Grid */
.treemap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: var(--spacing-sm);
    height: 500px;
}

.treemap-quadrant {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.treemap-quadrant-label {
    position: absolute;
    top: 6px;
    left: 8px;
    z-index: 20;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(30, 41, 59, 0.85);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    pointer-events: none;
}

.treemap-quadrant-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Responsive: stack vertically on narrow screens */
@media (max-width: 768px) {
    .treemap-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 200px);
        height: auto;
    }
}

/* ==========================================
   COMPARISON SECTION
   ========================================== */
.comparison-section {
    margin-bottom: var(--spacing-2xl);
}

.comparison-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.selected-stocks {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    align-items: center;
}

.selected-stock-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--color-primary);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
}

.selected-stock-tag .remove-btn {
    cursor: pointer;
    opacity: 0.7;
    font-size: 1rem;
    line-height: 1;
}

.selected-stock-tag .remove-btn:hover {
    opacity: 1;
}

.hint-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-lg);
}

.comparison-table-wrapper {
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.comparison-table th,
.comparison-table td {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.comparison-table td:first-child {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.comparison-table td.numeric {
    text-align: right;
    font-family: var(--font-mono);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: var(--spacing-xl) !important;
    font-style: italic;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1400px) {
    .sector-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-container.chart-wide {
        grid-column: span 1;
    }

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

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

    .table-header {
        flex-direction: column;
    }

    .table-controls {
        width: 100%;
    }

    .filter-group {
        flex: 1;
        min-width: 150px;
    }

    .table-container {
        max-height: 400px;
    }
}

/* ==========================================
   SCROLLBAR STYLING
   ========================================== */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ==========================================
   TREEMAP SPECIFIC
   ========================================== */
.treemap-label {
    font-size: 0.7rem;
    font-weight: 600;
    fill: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background: var(--status-positive);
    color: #fff;
}

.toast-error {
    background: var(--status-negative);
    color: #fff;
}

.toast-info {
    background: var(--accent-primary);
    color: #fff;
}

/* ==========================================
   CONFIG MODAL
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 550px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

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

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

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s ease;
}

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

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-description {
    margin: 0 0 var(--spacing-md) 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.modal-textarea {
    width: 100%;
    min-height: 200px;
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    resize: vertical;
}

.modal-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.modal-textarea::placeholder {
    color: var(--text-muted);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* Outline button style */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

/* Primary button style */
.btn-primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

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

/* ==========================================
   EDITABLE SECTOR PILLS
   ========================================== */
.editable-sector {
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.editable-sector:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 0 2px var(--accent-primary);
}

.editable-sector::after {
    content: '✎';
    position: absolute;
    right: -2px;
    top: -2px;
    font-size: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.editable-sector:hover::after {
    opacity: 0.7;
}

/* Override indicator (asterisk next to modified tickers) */
.override-indicator {
    color: var(--accent-primary);
    font-weight: bold;
    margin-left: 2px;
    font-size: 0.9em;
}

/* Small modal variant */
.modal-content.modal-sm {
    max-width: 350px;
}

.modal-content.modal-sm .modal-body {
    padding: var(--spacing-md);
}

.modal-content.modal-sm .select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
}

/* ==========================================
   FORM ELEMENTS
   ========================================== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
}

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

.form-input::placeholder {
    color: var(--text-muted);
}

/* ==========================================
   DELETE TICKER BUTTON
   ========================================== */
.delete-ticker-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
    margin-left: 4px;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    vertical-align: middle;
}

tr:hover .delete-ticker-btn {
    opacity: 0.5;
}

.delete-ticker-btn:hover {
    opacity: 1 !important;
    color: var(--status-negative);
}

/* Custom ticker badge */
.custom-badge {
    color: var(--accent-primary);
    font-weight: bold;
    margin-left: 2px;
    font-size: 0.8em;
}
