/* ===== Dashboard Specific Variables ===== */
:root {
    --positive: #10b981;
    --negative: #ef4444;
    --sidebar-width: 280px;
    --metric-bg: rgba(255, 255, 255, 0.05);
    --nav-height: 64px;
    --market-bar-height: 40px;
}

/* ===== Dashboard Page Base ===== */
.dashboard-page {
    min-height: 100vh;
    background-color: var(--bg-dark);
}

/* ===== Dashboard Navigation ===== */
.dashboard-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.dashboard-nav-container {
    max-width: 1600px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-nav .nav-brand {
    display: flex;
    align-items: center;
}

.dashboard-nav .nav-logo {
    height: 56px;
    width: auto;
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(232, 149, 106, 0.1);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ===== Settings Menu ===== */
.settings-menu {
    position: relative;
}

.settings-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.settings-menu-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.user-avatar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    font-size: 14px;
    border-radius: 50%;
}

.user-name {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    color: var(--text-muted);
    transition: var(--transition);
}

.settings-menu-btn:hover .dropdown-arrow {
    color: var(--text-secondary);
}

.settings-menu.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Settings Dropdown */
.settings-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 1000;
    overflow: hidden;
}

.settings-menu.open .settings-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-section {
    padding: 16px;
}

.settings-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.settings-divider {
    height: 1px;
    background: var(--border);
}

/* Profile Section */
.settings-profile {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-label {
    font-size: 13px;
    color: var(--text-muted);
}

.profile-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Theme Options */
.theme-options {
    display: flex;
    gap: 8px;
}

.theme-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--bg-elevated);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.theme-option:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.theme-option.active {
    border-color: var(--primary);
    background: rgba(232, 149, 106, 0.1);
    color: var(--primary);
}

.theme-option span {
    font-size: 12px;
    font-weight: 500;
}

/* Settings Row (for toggles) */
.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-row-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-row-label > span:first-child {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.settings-row-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 24px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
    border-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: white;
}

/* Settings Link */
.settings-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin: -8px -8px;
    color: var(--text-secondary);
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.settings-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Settings Disclaimer */
.settings-disclaimer {
    padding: 12px 16px;
}

.settings-disclaimer p {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Sign Out Button */
.settings-signout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    color: var(--danger);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.settings-signout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ===== Dashboard Layout ===== */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
    padding-top: calc(var(--nav-height) + var(--market-bar-height));
}

/* ===== Global Market Status Bar ===== */
.market-status-bar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    height: var(--market-bar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: 99;
    display: flex;
    align-items: center;
}

.market-status-bar-content {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.market-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.market-item .market-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.market-item .market-indicator.open {
    background: var(--positive);
    box-shadow: 0 0 6px var(--positive);
}

.market-item .market-indicator.pre-market {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.market-item .market-indicator.post-market {
    background: #8b5cf6;
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.5);
}

.market-item .market-indicator.closed {
    background: var(--text-muted);
}

.market-item .market-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.market-item .market-session {
    font-size: 12px;
    color: var(--text-secondary);
}

.market-time {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.market-time-label {
    color: var(--text-muted);
}

.market-time-value {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* ===== Watchlist Sidebar ===== */
.watchlist-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 24px;
    position: fixed;
    top: calc(var(--nav-height) + var(--market-bar-height));
    bottom: 0;
    left: 0;
    overflow-y: auto;
}

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

.watchlist-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

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

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

.watchlist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

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

.watchlist-item.active {
    border-color: var(--primary);
    background: rgba(232, 149, 106, 0.1);
}

.watchlist-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.watchlist-symbol {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

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

.watchlist-change {
    font-size: 12px;
    font-weight: 500;
}

.watchlist-change.positive {
    color: var(--positive);
}

.watchlist-change.negative {
    color: var(--negative);
}

.watchlist-remove {
    opacity: 0;
    transition: var(--transition);
}

.watchlist-item:hover .watchlist-remove {
    opacity: 1;
}

/* ===== Stock Content ===== */
.stock-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    max-width: 1200px;
}

/* ===== Loading & Error States ===== */
.loading-state,
.error-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: 16px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-state svg,
.empty-state svg {
    color: var(--text-muted);
}

.empty-state h3 {
    color: var(--text-primary);
    font-size: 20px;
}

/* ===== Stock Header ===== */
.stock-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.stock-header-top {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stock-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-elevated);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.stock-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: white;
    border-radius: var(--radius-sm);
    /* Logo.dev optimization styles */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show logo when loaded */
.stock-logo img.loaded {
    opacity: 1;
}

/* Ensure logo displays correctly while loading */
.stock-logo img[src] {
    opacity: 1;
}

.stock-logo-fallback {
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #d97f4a 100%);
    color: white;
    font-size: 24px;
    font-weight: 700;
}

/* Logo dark mode support - use slightly darker background */
[data-theme="dark"] .stock-logo img {
    background: #ffffff;
}

[data-theme="light"] .stock-logo img {
    background: #f8f9fa;
}

.stock-logo.no-image img {
    display: none;
}

.stock-logo.no-image .stock-logo-fallback {
    display: flex;
}

/* Logo loading shimmer animation */
.stock-logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: logoShimmer 1.5s infinite;
}

.stock-logo img.loaded + .stock-logo::before,
.stock-logo-fallback:not([style*="display: none"]) + .stock-logo::before {
    display: none;
}

@keyframes logoShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.stock-info {
    flex: 1;
}

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

.stock-symbol {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.stock-name {
    font-size: 20px;
    font-weight: 400;
    color: var(--text-secondary);
}

.stock-price-info {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 8px;
}

.stock-price {
    font-size: 48px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.stock-change {
    font-size: 24px;
    font-weight: 500;
}

.stock-change.positive {
    color: var(--positive);
}

.stock-change.negative {
    color: var(--negative);
}

.stock-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 8px;
}

.separator {
    color: var(--border-light);
}

/* ===== Stock Card Market Status ===== */
.stock-market-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 13px;
}

.stock-market-status .market-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stock-market-status .market-indicator.open {
    background: var(--positive);
    box-shadow: 0 0 6px var(--positive);
}

.stock-market-status .market-indicator.pre-market {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.stock-market-status .market-indicator.post-market {
    background: #8b5cf6;
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.5);
}

.stock-market-status .market-indicator.closed {
    background: var(--text-muted);
}

.stock-market-status .market-text {
    color: var(--text-secondary);
}

/* ===== Price Update Note (Stock Card) ===== */
.price-update-note {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

.price-note-text {
    opacity: 0.8;
}

/* ===== Chart Section ===== */
.chart-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
}

.chart-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    gap: 12px;
    color: var(--text-muted);
}

.chart-placeholder svg {
    opacity: 0.5;
}

/* ===== Stock Attributes (Two Column Layout) ===== */
.stock-attributes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 32px;
    padding: 24px 0;
}

.attributes-column {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.attribute-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

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

.attribute-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: right;
}

/* ===== Metrics Section (Legacy - kept for compatibility) ===== */
.metrics-section {
    margin-bottom: 32px;
}

.metrics-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Description Section ===== */
.description-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
}

.description-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.company-description {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 14px;
}

/* ===== Subscriptions Page ===== */
.subscriptions-container {
    max-width: 900px;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 32px) 24px 32px;
}

.subscriptions-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.subscriptions-header h1 {
    font-size: 28px;
    margin-bottom: 4px;
}

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

/* ===== Subscription Cards ===== */
.subscriptions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.subscription-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: var(--transition);
}

.subscription-card:hover {
    border-color: var(--border-light);
}

.subscription-card.paused {
    opacity: 0.7;
}

.subscription-info {
    flex: 1;
}

.subscription-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
}

.subscription-status.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--positive);
}

.subscription-status.paused {
    background: rgba(107, 125, 148, 0.15);
    color: var(--text-muted);
}

.subscription-tickers {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.subscription-details {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.subscription-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.subscription-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    padding: 8px 12px;
    font-size: 13px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-action.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: var(--danger);
}

/* ===== Modal Styles ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.modal-lg {
    max-width: 560px;
}

.modal-sm {
    max-width: 400px;
}

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

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

.modal-close {
    background: transparent;
    border: none;
}

.modal-body {
    padding: 24px;
}

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

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 149, 106, 0.15);
}

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

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Search Input & Results ===== */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .form-input {
    padding-right: 40px;
}

.search-loading {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: var(--shadow-lg);
}

.form-group {
    position: relative;
}

.search-result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

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

.search-result-item:hover {
    background: var(--bg-hover);
}

.search-result-main {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.search-result-symbol {
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
    min-width: 60px;
}

.search-result-name {
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.search-result-type {
    padding: 2px 6px;
    background: var(--metric-bg);
    border-radius: 4px;
}

.search-error {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--negative);
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-md);
    margin-top: 8px;
}

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

/* ===== Ticker Input ===== */
.ticker-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-height: 48px;
    align-items: center;
}

.ticker-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 149, 106, 0.15);
}

.ticker-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ticker-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--primary);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.ticker-tag button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    display: flex;
    opacity: 0.8;
}

.ticker-tag button:hover {
    opacity: 1;
}

.ticker-field {
    flex: 1;
    min-width: 100px;
    padding: 4px 8px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
}

.ticker-field:focus {
    outline: none;
    box-shadow: none;
}

/* ===== Checkbox & Radio ===== */
.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input,
.radio-label input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-custom,
.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-light);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.radio-custom {
    border-radius: 50%;
}

.checkbox-label input:checked + .checkbox-custom,
.radio-label input:checked + .radio-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
    opacity: 0;
    transition: var(--transition);
}

.checkbox-label input:checked + .checkbox-custom::after {
    opacity: 1;
}

.radio-custom::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: var(--transition);
}

.radio-label input:checked + .radio-custom::after {
    opacity: 1;
}

/* ===== Button Variants ===== */
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

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

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

/* ===== Stock Detail Page ===== */
.stock-detail-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 32px) 24px 32px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary);
}

.stock-header-full {
    margin-bottom: 32px;
}

.chart-section-full {
    min-height: 300px;
}

/* ===== Earnings Section ===== */
.earnings-section,
.earnings-history-section,
.analyst-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.earnings-section h2,
.earnings-history-section h2,
.analyst-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.earnings-card {
    display: flex;
    align-items: center;
    gap: 48px;
}

.earnings-date-container {
    flex-shrink: 0;
}

.earnings-label,
.target-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.earnings-date {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary);
}

.earnings-estimates {
    display: flex;
    gap: 32px;
}

.estimate-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.estimate-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

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

/* Earnings History Table */
.earnings-history-table {
    overflow-x: auto;
}

.earnings-history-header,
.earnings-history-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
    padding: 12px 0;
}

.earnings-history-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.earnings-history-row {
    border-bottom: 1px solid var(--border);
}

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

.earnings-history-row span {
    font-size: 14px;
    color: var(--text-primary);
}

.earnings-history-row .quarter {
    font-weight: 500;
}

.earnings-history-row .surprise.positive {
    color: var(--positive);
}

.earnings-history-row .surprise.negative {
    color: var(--negative);
}

/* Analyst Section */
.analyst-card {
    display: flex;
    align-items: center;
    gap: 32px;
}

.target-price-container {
    flex-shrink: 0;
}

.target-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.target-comparison {
    flex: 1;
}

.comparison-text {
    font-size: 14px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    display: inline-block;
}

.comparison-text.upside {
    background: rgba(16, 185, 129, 0.1);
    color: var(--positive);
}

.comparison-text.downside {
    background: rgba(239, 68, 68, 0.1);
    color: var(--negative);
}

/* ===== Tier Selection ===== */
.tier-selection {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tier-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: all 0.2s ease;
}

.tier-card.selectable {
    cursor: pointer;
}

.tier-card.selectable:hover {
    border-color: var(--primary);
}

.tier-card.selectable.selected {
    border-color: var(--primary);
    background: rgba(232, 149, 106, 0.08);
}

.tier-card.locked {
    opacity: 0.6;
    position: relative;
    cursor: not-allowed;
}

.tier-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.tier-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.tier-badge.active {
    background: linear-gradient(135deg, var(--primary), #d97f4a);
    color: white;
}

.tier-badge.coming-soon {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.tier-name {
    font-weight: 600;
    color: var(--text-primary);
}

.coming-soon-tag {
    margin-left: auto;
    padding: 4px 8px;
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.tier-description {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.tier-reports {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.locked-content {
    opacity: 0.5;
}

.locked-item {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== Subscription Tier Badge ===== */
.subscription-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.subscription-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.subscription-tier-badge.lv1 {
    background: linear-gradient(135deg, var(--primary), #d97f4a);
    color: white;
}

.subscription-tier-badge.lv2 {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.subscription-tier-badge.lv3 {
    background: rgba(16, 185, 129, 0.2);
    color: var(--positive);
}

/* ===== Send Now Option ===== */
.send-now-option {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.send-now-checkbox {
    align-items: flex-start;
}

.send-now-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.send-now-text strong {
    color: var(--text-primary);
}

.send-now-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Toast Notification ===== */
.toast-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--positive);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-size: 14px;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

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

.toast-notification svg {
    color: var(--positive);
    flex-shrink: 0;
}

.toast-notification.error {
    border-color: var(--negative);
}

.toast-notification.error svg {
    color: var(--negative);
}

/* ===== Button Spinner ===== */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ===== Ticker Search ===== */
.ticker-search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.ticker-search-container .form-input {
    flex: 1;
}

.ticker-search-loading {
    position: absolute;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.ticker-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    margin-top: 4px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background: var(--bg-hover);
}

.search-result-item.no-results {
    color: var(--text-muted);
    cursor: default;
}

.search-result-item.no-results:hover {
    background: transparent;
}

.result-symbol {
    font-weight: 600;
    color: var(--primary);
    min-width: 60px;
}

.result-name {
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Free Tier Hints ===== */
.free-tier-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.tier-reports-hint {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 12px;
    grid-column: 1 / -1;
}

/* ===== Schedule Day Group ===== */
.schedule-day-group {
    transition: all 0.2s ease;
}

/* ===== Compact Modal ===== */
.modal-compact {
    max-width: 520px;
}

.modal-compact .modal-body {
    padding: 20px 24px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.modal-compact .form-group {
    margin-bottom: 16px;
}

.modal-compact .form-group label {
    margin-bottom: 6px;
    font-size: 13px;
}

.modal-compact .form-input,
.modal-compact .form-select {
    padding: 10px 12px;
    font-size: 14px;
}

.modal-compact .form-row {
    display: flex;
    gap: 12px;
}

.modal-compact .form-row .form-group {
    flex: 1;
    min-width: 0;
}

/* Required field marker */
.required-mark {
    color: var(--negative);
    font-weight: 600;
}

/* Form validation errors */
.form-error {
    display: block;
    margin-top: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--negative);
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--negative);
}

.form-group.has-error .form-input,
.form-group.has-error .form-select,
.form-group.has-error .ticker-input-wrapper {
    border-color: var(--negative);
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.form-group.has-error .form-input:focus,
.form-group.has-error .form-select:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Compact Send Now Option */
.modal-compact .send-now-option {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.modal-compact .send-now-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.modal-compact .send-now-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-compact .send-now-text strong {
    font-size: 14px;
}

.modal-compact .send-now-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }

    .dashboard-nav-container,
    .market-status-bar-content {
        padding: 0 16px;
    }

    .watchlist-sidebar {
        width: var(--sidebar-width);
        min-width: var(--sidebar-width);
    }

    .stock-content {
        margin-left: var(--sidebar-width);
    }

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

@media (max-width: 768px) {
    .dashboard-nav {
        position: static;
        height: auto;
        padding: 12px 0;
        border-bottom: none;
    }

    .dashboard-nav-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .nav-user {
        width: 100%;
        justify-content: space-between;
    }

    .nav-menu {
        width: 100%;
        display: flex;
        justify-content: space-between;
        border-top: 1px solid var(--border);
        padding-top: 8px;
        gap: 8px;
    }

    .nav-link {
        flex: 1;
        text-align: center;
        padding: 10px;
    }

    .market-status-bar {
        position: static;
        height: auto;
        padding: 8px 0;
    }

    .market-status-bar-content {
        padding: 0 16px;
        flex-wrap: wrap;
        gap: 16px;
    }

    .dashboard-layout {
        flex-direction: column;
        padding-top: 16px;
    }

    .watchlist-sidebar {
        position: relative;
        top: 0;
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 16px;
    }

    .watchlist-items {
        flex-direction: row;
        overflow-x: auto;
        gap: 12px;
        padding-bottom: 8px;
    }

    .watchlist-item {
        min-width: 120px;
        flex-shrink: 0;
    }

    .stock-content {
        margin-left: 0;
        padding: 24px 16px;
    }

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

    .stock-name {
        font-size: 22px;
    }

    .stock-price {
        font-size: 28px;
    }

    .subscriptions-container {
        padding: 32px 16px;
    }

    .subscriptions-header {
        flex-direction: column;
        gap: 16px;
    }

    .subscription-card {
        flex-direction: column;
        gap: 16px;
    }

    .subscription-actions {
        width: 100%;
        gap: 12px;
    }

    .subscription-actions .btn-action {
        flex: 1;
        text-align: center;
    }

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

    .toast-notification {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}

@media (max-width: 480px) {
    .nav-user {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .settings-menu-btn {
        width: 100%;
        justify-content: space-between;
    }

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

    .subscription-details {
        flex-direction: column;
    }

    .subscription-actions {
        flex-direction: column;
    }

    .modal-compact {
        width: 90%;
        max-width: none;
    }

    .modal-compact .form-row {
        flex-direction: column;
    }
}
