/* =============================================================================
   WORLDVIEW - DESIGN SYSTEM
   Modern UI (Koyfin/BamSEC-inspired)
   ============================================================================= */

/* -----------------------------------------------------------------------------
   DESIGN TOKENS (CSS Custom Properties)
   ----------------------------------------------------------------------------- */
:root {
    /* Color Palette - Light Mode */
    --color-bg-primary: #f8fafc;
    --color-bg-secondary: #ffffff;
    --color-bg-tertiary: #f1f5f9;
    --color-bg-elevated: #ffffff;
    --color-bg-hover: #f1f5f9;
    --color-bg-active: #e2e8f0;

    /* Text Colors */
    --color-text-primary: #0f172a;
    --color-text-secondary: #475569;
    --color-text-tertiary: #64748b;
    --color-text-muted: #94a3b8;
    --color-text-inverse: #ffffff;

    /* Border Colors */
    --color-border-primary: #e2e8f0;
    --color-border-secondary: #cbd5e1;
    --color-border-subtle: #f1f5f9;

    /* Brand Colors - Green as primary accent */
    --color-brand: #059669;
    --color-brand-hover: #047857;
    --color-brand-soft: #ecfdf5;
    --color-brand-muted: #6ee7b7;

    /* Semantic Colors */
    --color-positive: #0891b2;
    --color-positive-soft: #e0f7fa;
    --color-positive-text: #0e7490;

    --color-negative: #e11d48;
    --color-negative-soft: #ffe4e6;
    --color-negative-text: #be123c;

    --color-warning: #ea580c;
    --color-warning-soft: #fff7ed;
    --color-warning-text: #c2410c;

    --color-info: #0284c7;
    --color-info-soft: #e0f2fe;
    --color-info-text: #075985;

    /* Badge Colors */
    --color-badge-ticker: #0284c7;
    --color-badge-subject: #64748b;
    --color-badge-industry: #78716c;
    --color-badge-date: #94a3b8;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.02);

    /* Spacing Scale (4px base) */
    --space-0: 0;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-full: 9999px;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

    --text-xs: 11px;
    --text-sm: 12px;
    --text-base: 13px;
    --text-md: 14px;
    --text-lg: 16px;
    --text-xl: 18px;
    --text-2xl: 20px;
    --text-3xl: 24px;

    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    /* Z-index layers */
    --z-base: 0;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-toast: 500;
}

/* Dark Mode */
[data-theme="dark"] {
    --color-bg-primary: #0f172a;
    --color-bg-secondary: #1e293b;
    --color-bg-tertiary: #334155;
    --color-bg-elevated: #1e293b;
    --color-bg-hover: #334155;
    --color-bg-active: #475569;

    --color-text-primary: #f1f5f9;
    --color-text-secondary: #cbd5e1;
    --color-text-tertiary: #94a3b8;
    --color-text-muted: #64748b;

    --color-border-primary: #334155;
    --color-border-secondary: #475569;
    --color-border-subtle: #1e293b;

    --color-brand-soft: rgba(5, 150, 105, 0.15);

    --color-positive-soft: rgba(8, 145, 178, 0.15);
    --color-negative-soft: rgba(225, 29, 72, 0.15);
    --color-warning-soft: rgba(234, 88, 12, 0.15);
    --color-info-soft: rgba(2, 132, 199, 0.15);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* -----------------------------------------------------------------------------
   BASE RESET & GLOBAL STYLES
   ----------------------------------------------------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-md);
    line-height: var(--leading-normal);
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
}

/* -----------------------------------------------------------------------------
   LAYOUT
   ----------------------------------------------------------------------------- */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top App Bar - Sticky */
.app-bar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border-primary);
    box-shadow: var(--shadow-sm);
}

.app-bar-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--space-3) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    position: relative;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: var(--color-text-primary);
}

.app-logo-icon {
    font-size: var(--text-2xl);
}

.app-logo-text {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    letter-spacing: -0.02em;
}

.app-logo-subtitle {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    display: none;
}

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

/* Global Search */
.global-search {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 400px;
    min-width: 150px;
    position: relative;
}

.global-search input.global-search-input,
.global-search input.global-search-input[type="text"] {
    width: 100%;
    padding: 8px 16px 8px 48px;
    font-size: var(--text-base);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-lg);
    color: var(--color-text-primary);
    transition: var(--transition-fast);
    text-transform: none;
}

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

.global-search input.global-search-input:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px var(--color-brand-soft);
    background: var(--color-bg-secondary);
}

.global-search .global-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
    font-size: 18px;
    line-height: 1;
    z-index: 1;
}

/* App Bar Actions */
.app-bar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.theme-toggle {
    padding: var(--space-2);
    background: transparent;
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: var(--text-lg);
    line-height: 1;
}

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

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--space-6);
    width: 100%;
}

/* Legacy container support */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--space-6);
}

/* Legacy header - now styled as app bar */
header {
    background: var(--color-bg-secondary);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-5);
    border: 1px solid var(--color-border-primary);
}

.header-left {
    flex: 1;
    min-width: 200px;
}

header h1 {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-1);
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
}

/* -----------------------------------------------------------------------------
   KPI CARDS (Header Stats)
   ----------------------------------------------------------------------------- */
.header-stats {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    align-items: stretch;
}

.header-stat-item {
    background: var(--color-bg-tertiary);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    text-align: center;
    min-width: 90px;
    border: 1px solid var(--color-border-subtle);
    transition: var(--transition-fast);
}

.header-stat-item:hover {
    border-color: var(--color-brand-muted);
    background: var(--color-brand-soft);
}

.header-stat-label {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-1);
}

.header-stat-value {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--color-brand);
    font-variant-numeric: tabular-nums;
}

/* -----------------------------------------------------------------------------
   TABS - Modern Pill Style
   ----------------------------------------------------------------------------- */
.tabs {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-6);
    padding: var(--space-1);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-xl);
    width: fit-content;
    border: 1px solid var(--color-border-primary);
}

.tab {
    padding: var(--space-2) var(--space-5);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--color-text-tertiary);
    transition: var(--transition-fast);
    border-radius: var(--radius-lg);
    position: relative;
    white-space: nowrap;
}

.tab:hover:not(.active) {
    color: var(--color-text-primary);
    background: var(--color-bg-hover);
}

.tab.active {
    background: var(--color-bg-secondary);
    color: var(--color-brand);
    box-shadow: var(--shadow-sm);
    font-weight: var(--font-semibold);
}

/* Tab content visibility */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Remove old tab color themes - use brand color for all */
.tab-results.active,
.tab-benchmarks.active,
.tab-economic.active,
.tab-quotes.active,
.tab-synthesis.active,
.tab-taxonomy.active {
    color: var(--color-brand);
}

/* -----------------------------------------------------------------------------
   CARDS & PANELS
   ----------------------------------------------------------------------------- */
.controls, .card, .panel {
    background: var(--color-bg-secondary);
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-5);
    border: 1px solid var(--color-border-primary);
}

/* Section Headers - Neutral, not heavy green */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--color-bg-tertiary);
    cursor: pointer;
    user-select: none;
    transition: var(--transition-fast);
    margin-bottom: var(--space-4);
    color: var(--color-text-primary);
    font-size: var(--text-md);
    font-weight: var(--font-semibold);
    border: 1px solid var(--color-border-primary);
}

.section-header:hover {
    background: var(--color-bg-hover);
    border-color: var(--color-border-secondary);
}

.section-header::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--color-text-tertiary);
    border-bottom: 2px solid var(--color-text-tertiary);
    transform: rotate(45deg);
    transition: transform var(--transition-fast);
}

.section-header.collapsed::after {
    transform: rotate(-45deg);
}

.section-content {
    transition: max-height var(--transition-slow), opacity var(--transition-base);
    overflow: hidden;
    max-height: 5000px;
    opacity: 1;
}

.section-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Earnings recap section needs much larger max-height for long recaps */
#earningsRecapSection {
    max-height: 50000px;
}

/* -----------------------------------------------------------------------------
   FORMS & INPUTS
   ----------------------------------------------------------------------------- */
.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

select, input[type="text"], input[type="number"], input[type="date"] {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-md);
    font-size: var(--text-md);
    font-family: var(--font-sans);
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    transition: var(--transition-fast);
}

select:focus, input:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px var(--color-brand-soft);
}

input[type="text"] {
    text-transform: uppercase;
}

input[type="file"] {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* Actions Container */
.actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-top: var(--space-4);
}

/* -----------------------------------------------------------------------------
   BUTTONS
   ----------------------------------------------------------------------------- */
button {
    font-family: var(--font-sans);
    font-size: var(--text-md);
    font-weight: var(--font-medium);
    padding: var(--space-2) var(--space-4);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary Button - Brand color */
.btn-primary {
    background: var(--color-brand);
    color: var(--color-text-inverse);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-brand-hover);
}

/* Secondary Button - Ghost/Outline */
.btn-secondary {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--color-bg-hover);
    border-color: var(--color-border-secondary);
    color: var(--color-text-primary);
}

/* Process Button - Positive action */
.btn-process {
    background: var(--color-positive);
    color: var(--color-text-inverse);
}

.btn-process:hover:not(:disabled) {
    background: #047857;
}

/* Recap Button - Brand gradient */
.btn-recap {
    background: linear-gradient(135deg, var(--color-brand) 0%, #10b981 100%);
    color: var(--color-text-inverse);
    padding: var(--space-3) var(--space-5);
    font-weight: var(--font-semibold);
}

.btn-recap:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--color-brand-hover) 0%, #059669 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Toggle button for calculated metrics */
.calc-metrics-toggle {
    font-size: var(--text-sm);
    padding: var(--space-1) var(--space-3);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
}

.calc-metrics-toggle:hover {
    background: var(--color-bg-hover);
}

/* -----------------------------------------------------------------------------
   RESULTS TABLE - Pro Finance Styling
   ----------------------------------------------------------------------------- */
.results-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-primary);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-base);
    font-variant-numeric: tabular-nums lining-nums;
}

.results-table th {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: var(--font-semibold);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--color-border-primary);
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap;
}

/* Sticky first column for metric names */
.results-table th:first-child,
.results-table td:first-child {
    position: sticky;
    left: 0;
    background: var(--color-bg-secondary);
    z-index: 2;
    min-width: 180px;
    max-width: 225px;
    white-space: normal;
    word-wrap: break-word;
    border-right: 1px solid var(--color-border-primary);
}

.results-table th:first-child {
    background: var(--color-bg-tertiary);
    z-index: 3;
}

.results-table td {
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--color-border-subtle);
    font-size: var(--text-base);
    white-space: nowrap;
    max-width: 120px;
}

/* Allow text wrapping for qualitative guidance */
.results-table td .qualitative-guidance {
    white-space: normal;
    word-wrap: break-word;
    max-width: 90px;
    display: inline-block;
    vertical-align: middle;
    line-height: 1.2;
    font-size: var(--text-sm);
}

/* Row type-based shading (primary metrics vs calculated/guidance) */
/* Primary extracted metrics get primary background (white/dark) */
/* Calculated metrics and guidance get secondary background (grey) */

/* Hover state */
.results-table tbody tr:hover {
    background: var(--color-bg-hover);
}

.results-table tbody tr:hover td:first-child {
    background: var(--color-bg-hover);
}

/* Metric Values - Right aligned */
.metric-value {
    text-align: right;
    font-weight: var(--font-medium);
    font-variant-numeric: tabular-nums;
}

.metric-value.null {
    color: var(--color-text-muted);
    font-style: italic;
}

.metric-value.positive {
    color: var(--color-positive);
    font-weight: var(--font-semibold);
}

.metric-value.negative {
    color: var(--color-negative);
    font-weight: var(--font-semibold);
}

.metric-value.neutral {
    color: var(--color-text-muted);
}

/* Qualitative values */
.qualitative-value {
    color: var(--color-brand);
    font-weight: var(--font-semibold);
    cursor: help;
    border-bottom: 1px dashed var(--color-brand);
}

/* Source metric rows - primary extracted data (card background) */
.source-metric-row {
    cursor: pointer;
    transition: background var(--transition-fast);
    background: var(--color-bg-secondary);
}

.source-metric-row td:first-child {
    background: var(--color-bg-secondary);
}

.source-metric-row:hover {
    background: var(--color-brand-soft) !important;
}

.source-metric-row:hover td:first-child {
    background: transparent !important;
}

.source-metric-row.minimized {
    display: none;
}

/* Calculated metric rows - derived/guidance data (secondary background) */
.calculated-metric-row {
    cursor: pointer;
    transition: background var(--transition-fast);
    background: var(--color-bg-tertiary);
}

.calculated-metric-row td {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    font-style: italic;
}

.calculated-metric-row td:first-child {
    padding-left: var(--space-8);
    position: relative;
    background: var(--color-bg-tertiary);
}

.calculated-metric-row td:first-child::before {
    content: '└';
    position: absolute;
    left: var(--space-4);
    color: var(--color-text-muted);
}

.calculated-metric-row:hover {
    background: var(--color-bg-hover) !important;
}

.calculated-metric-row.minimized,
.child-of-minimized {
    display: none;
}

/* Hidden calc badge */
.hidden-calc-badge {
    display: inline-block;
    font-size: var(--text-xs);
    background: var(--color-bg-tertiary);
    color: var(--color-text-muted);
    padding: 2px var(--space-2);
    border-radius: var(--radius-full);
    margin-left: var(--space-2);
    cursor: pointer;
    font-style: italic;
    font-weight: var(--font-normal);
}

.hidden-calc-badge:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-secondary);
}

/* Quarter header */
.quarter-header {
    background: var(--color-brand);
    color: var(--color-text-inverse);
    font-weight: var(--font-semibold);
}

/* Guidance rows */
.guidance-row,
.guided-yoy-row,
.beat-miss-row {
    background-color: var(--color-bg-tertiary);
}

/* Ensure sticky first column matches row background for calculated rows */
.guidance-row td:first-child,
.guided-yoy-row td:first-child,
.beat-miss-row td:first-child {
    background-color: var(--color-bg-tertiary);
}

.guided-yoy-row,
.beat-miss-row {
    font-weight: var(--font-medium);
}

/* Trending indicators */
.trending-down {
    background-color: var(--color-warning-soft) !important;
    border-left: 3px solid var(--color-warning) !important;
}

.trending-down td:first-child {
    background-color: var(--color-warning-soft) !important;
}

.trending-down td:first-child::after {
    content: ' ⚠';
    color: var(--color-warning);
    font-size: var(--text-md);
    margin-left: var(--space-1);
}

.trending-up {
    background-color: var(--color-positive-soft) !important;
    border-left: 3px solid var(--color-positive) !important;
}

.trending-up td:first-child {
    background-color: var(--color-positive-soft) !important;
}

.trending-up td:first-child::after {
    content: ' ▲';
    color: var(--color-positive);
    font-size: var(--text-md);
    margin-left: var(--space-1);
}

/* Trending row hover states - maintain colored background */
.trending-down:hover {
    background-color: var(--color-warning-soft) !important;
    filter: brightness(0.95);
}

.trending-down:hover td:first-child {
    background-color: transparent !important;
}

.trending-up:hover {
    background-color: var(--color-positive-soft) !important;
    filter: brightness(0.95);
}

.trending-up:hover td:first-child {
    background-color: transparent !important;
}

/* -----------------------------------------------------------------------------
   QUOTE CARDS
   ----------------------------------------------------------------------------- */
.quotes-container, .synthesis-container {
    display: grid;
    gap: var(--space-5);
}

.quote-card, .synthesis-card {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-primary);
    overflow: hidden;
    transition: box-shadow var(--transition-fast);
}

.quote-card:hover, .synthesis-card:hover {
    box-shadow: var(--shadow-md);
}

/* Quote Header - Neutral with accent border */
.quote-header, .synthesis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-tertiary);
    border-bottom: 1px solid var(--color-border-primary);
    border-left: 4px solid var(--color-brand);
    cursor: pointer;
    user-select: none;
    transition: var(--transition-fast);
}

.quote-header:hover, .synthesis-header:hover {
    background: var(--color-bg-hover);
}

.quote-header::after, .synthesis-header::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--color-text-tertiary);
    border-bottom: 2px solid var(--color-text-tertiary);
    transform: rotate(45deg);
    transition: transform var(--transition-fast);
}

.quote-header.collapsed::after, .synthesis-header.collapsed::after {
    transform: rotate(-45deg);
}

.quote-meta, .synthesis-meta {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    font-size: var(--text-sm);
}

.meta-badge {
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-ticker { background: var(--color-badge-ticker); color: white; }
.badge-subject { background: var(--color-badge-subject); color: white; }
.badge-industry { background: var(--color-badge-industry); color: white; }
.badge-date { background: var(--color-badge-date); color: white; }

/* Quote Content */
.quote-content, .synthesis-content {
    padding: var(--space-4);
    transition: max-height var(--transition-slow), opacity var(--transition-base);
    overflow: hidden;
    max-height: 5000px;
    opacity: 1;
}

.quote-content.collapsed, .synthesis-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0;
}

.quote-text {
    font-size: var(--text-md);
    line-height: var(--leading-relaxed);
    color: var(--color-text-primary);
}

.quote-text strong {
    background: var(--color-warning-soft);
    padding: 1px var(--space-1);
    border-radius: var(--radius-sm);
    font-weight: var(--font-semibold);
}

.quote-group {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

.quote-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.quote-group-text {
    flex: 1;
}

.quote-group-label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    padding-top: 2px;
}

/* Synthesis specific */
.synthesis-title {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--color-text-primary);
}

.synthesis-summary {
    font-size: var(--text-md);
    line-height: var(--leading-relaxed);
    color: var(--color-text-primary);
    margin-bottom: var(--space-5);
    padding: var(--space-4);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-lg);
}

.industry-section {
    margin-bottom: var(--space-5);
    padding: var(--space-4);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-lg);
}

.industry-header {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.industry-meta {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-4);
}

.observation-item {
    margin-bottom: var(--space-4);
    padding: var(--space-3);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-brand);
}

.observation-text {
    font-size: var(--text-md);
    line-height: var(--leading-normal);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.supporting-quotes {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border-subtle);
}

.supporting-quotes-title {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.quote-citation {
    margin-bottom: var(--space-2);
    padding: var(--space-2);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--color-text-muted);
}

.quote-citation-header {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: var(--color-text-muted);
    margin-bottom: var(--space-1);
}

.quote-citation-text {
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    color: var(--color-text-secondary);
    font-style: italic;
}

.nuanced-section, .anomalies-section {
    margin-top: var(--space-5);
    padding: var(--space-4);
    background: var(--color-warning-soft);
    border-radius: var(--radius-lg);
}

.section-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-4);
}

/* -----------------------------------------------------------------------------
   EARNINGS RECAP STYLING
   ----------------------------------------------------------------------------- */
.earnings-recap-header {
    background: var(--color-bg-tertiary) !important;
    color: var(--color-text-primary) !important;
    border-left-color: var(--color-border-primary) !important;
}

.earnings-recap-header:hover {
    background: var(--color-bg-hover) !important;
}

.recap-card {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--color-border-primary);
}

.recap-header-bar {
    background: var(--color-bg-tertiary) !important;
    color: var(--color-text-primary) !important;
    padding: var(--space-5) var(--space-6);
    border-bottom: 2px solid var(--color-border-primary);
}

.recap-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-2);
}

.recap-meta {
    display: flex;
    gap: var(--space-4);
    font-size: var(--text-sm);
    opacity: 0.9;
}

.recap-body {
    padding: var(--space-6);
}

/* Assessment Banner */
.assessment-banner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.assessment-banner.very-bullish {
    background: var(--color-positive-soft);
    border-left: 4px solid var(--color-positive);
}

.assessment-banner.bullish {
    background: var(--color-positive-soft);
    border-left: 4px solid var(--color-positive);
}

.assessment-banner.neutral {
    background: var(--color-bg-tertiary);
    border-left: 4px solid var(--color-text-muted);
}

.assessment-banner.bearish {
    background: var(--color-warning-soft);
    border-left: 4px solid var(--color-warning);
}

.assessment-banner.very-bearish {
    background: var(--color-negative-soft);
    border-left: 4px solid var(--color-negative);
}

.rating-badge {
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.rating-badge.strong-beat { background: var(--color-positive); color: white; }
.rating-badge.beat { background: var(--color-positive); color: white; }
.rating-badge.inline { background: var(--color-text-muted); color: white; }
.rating-badge.miss { background: var(--color-warning); color: white; }
.rating-badge.strong-miss { background: var(--color-negative); color: white; }

.sentiment-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.sentiment-badge.very-bullish { background: var(--color-positive-soft); color: var(--color-positive); }
.sentiment-badge.bullish { background: var(--color-positive-soft); color: var(--color-positive); }
.sentiment-badge.neutral { background: var(--color-bg-tertiary); color: var(--color-text-secondary); }
.sentiment-badge.bearish { background: var(--color-warning-soft); color: var(--color-warning); }
.sentiment-badge.very-bearish { background: var(--color-negative-soft); color: var(--color-negative); }

.one-liner {
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
    flex: 1;
}

.stock-reaction {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    font-style: italic;
    margin-top: var(--space-2);
}

/* Recap Sections */
.recap-section {
    margin-bottom: var(--space-5);
    padding: var(--space-5);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-lg);
}

.recap-section-title {
    font-size: var(--text-md);
    font-weight: var(--font-bold);
    color: var(--color-brand);
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    user-select: none;
}

.recap-section-title:hover {
    opacity: 0.8;
}

.recap-section-title .section-toggle-icon {
    margin-left: auto;
    font-size: var(--text-sm);
    transition: transform var(--transition-base);
    color: var(--color-text-secondary);
}

.recap-section.collapsed .section-toggle-icon {
    transform: rotate(-90deg);
}

.recap-section-content {
    transition: all var(--transition-base);
}

.recap-section.collapsed .recap-section-content {
    display: none;
}

.recap-section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--color-brand);
    border-radius: var(--radius-sm);
}

/* Metric Analysis */
.metric-analysis-item {
    background: var(--color-bg-secondary);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    border-left: 3px solid var(--color-brand);
}

.metric-analysis-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}

.metric-name {
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
}

.metric-value-display {
    font-weight: var(--font-bold);
    color: var(--color-brand);
}

.trend-indicator {
    font-size: var(--text-xs);
    padding: 2px var(--space-2);
    border-radius: var(--radius-full);
    font-weight: var(--font-semibold);
}

.trend-indicator.accelerating,
.trend-indicator.improved { background: var(--color-positive-soft); color: var(--color-positive); }
.trend-indicator.stable { background: var(--color-bg-tertiary); color: var(--color-text-secondary); }
.trend-indicator.decelerating,
.trend-indicator.declined { background: var(--color-negative-soft); color: var(--color-negative); }

.metric-significance {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-normal);
}

/* Commentary */
.commentary-item {
    background: var(--color-bg-secondary);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
}

.commentary-topic {
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.commentary-quote {
    font-style: italic;
    color: var(--color-text-secondary);
    padding: var(--space-3);
    background: var(--color-bg-tertiary);
    border-left: 3px solid var(--color-text-muted);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: var(--space-2);
}

.commentary-implication {
    font-size: var(--text-sm);
    color: var(--color-text-primary);
}

/* Thesis Impact */
.thesis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
}

.thesis-box {
    background: var(--color-bg-secondary);
    padding: var(--space-4);
    border-radius: var(--radius-md);
}

.thesis-box.bull { border-top: 3px solid var(--color-positive); }
.thesis-box.bear { border-top: 3px solid var(--color-negative); }

.thesis-label {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    margin-bottom: var(--space-2);
}

.thesis-label.bull { color: var(--color-positive); }
.thesis-label.bear { color: var(--color-negative); }

.thesis-status {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    display: inline-block;
    margin-bottom: var(--space-2);
}

.thesis-status.strengthened { background: var(--color-positive-soft); color: var(--color-positive); }
.thesis-status.unchanged { background: var(--color-bg-tertiary); color: var(--color-text-secondary); }
.thesis-status.weakened { background: var(--color-negative-soft); color: var(--color-negative); }

.thesis-analysis {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-normal);
}

/* Bottom Line */
.bottom-line-box {
    background: linear-gradient(135deg, var(--color-brand) 0%, #10b981 100%);
    color: var(--color-text-inverse);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
}

.bottom-line-summary {
    font-size: var(--text-md);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-3);
}

.bottom-line-action {
    font-size: var(--text-sm);
    opacity: 0.9;
    font-style: italic;
}

/* Peer Context */
.peer-quote-item {
    background: var(--color-bg-secondary);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    border-left: 3px solid var(--color-brand-muted);
}

.peer-quote-ticker {
    font-weight: var(--font-semibold);
    color: var(--color-brand);
    margin-bottom: var(--space-1);
}

.peer-quote-text {
    font-style: italic;
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-1);
}

.peer-quote-relevance {
    font-size: var(--text-xs);
    color: var(--color-text-primary);
}

/* Lists */
.recap-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recap-list li {
    padding: var(--space-2) 0 var(--space-2) var(--space-5);
    position: relative;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.recap-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--color-brand);
    font-weight: bold;
}

.recap-list.risks li::before {
    content: '⚠';
    color: var(--color-warning);
}

.recap-list.catalysts li::before {
    content: '⚡';
    color: var(--color-positive);
}

/* -----------------------------------------------------------------------------
   LOADING & ERROR STATES
   ----------------------------------------------------------------------------- */
.loading {
    text-align: center;
    padding: var(--space-10);
    color: var(--color-text-muted);
    font-size: var(--text-md);
}

.error {
    background: var(--color-negative-soft);
    color: var(--color-negative-text);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
    border: 1px solid var(--color-negative);
}

/* -----------------------------------------------------------------------------
   STATS & BADGES
   ----------------------------------------------------------------------------- */
.stats {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-4);
    flex-wrap: wrap;
}

.stat-item {
    background: var(--color-bg-tertiary);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
}

.stat-label {
    color: var(--color-text-muted);
    font-weight: var(--font-semibold);
}

.stat-value {
    color: var(--color-text-primary);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
}

/* -----------------------------------------------------------------------------
   TAXONOMY TABLE
   ----------------------------------------------------------------------------- */
.results-container {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-primary);
}

/* Taxonomy specific styling */
#taxonomyContainer table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-base);
}

#taxonomyContainer th {
    background: var(--color-brand);
    color: var(--color-text-inverse);
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: var(--font-semibold);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: none;
}

#taxonomyContainer td {
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--color-border-subtle);
    color: var(--color-text-primary);
}

#taxonomyContainer tr:nth-child(even) {
    background: var(--color-bg-tertiary);
}

#taxonomyContainer tr:hover {
    background: var(--color-bg-hover);
}

/* Benchmarks & Economic Tables - match taxonomy styling */
#benchmarksContainer table,
#economicContainer table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-base);
    font-variant-numeric: tabular-nums;
}

#benchmarksContainer th,
#economicContainer th {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: var(--font-semibold);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--color-border-primary);
    white-space: nowrap;
}

#benchmarksContainer td,
#economicContainer td {
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--color-border-subtle);
    color: var(--color-text-primary);
}

/* Zebra striping for benchmarks only - economic uses manual row styling */
#benchmarksContainer tr:nth-child(even) {
    background: var(--color-bg-tertiary);
}

#benchmarksContainer tr:hover,
#economicContainer tr:hover {
    background: var(--color-bg-hover);
}

/* -----------------------------------------------------------------------------
   RESPONSIVE DESIGN
   ----------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .container, .main-content {
        padding: var(--space-4);
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

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

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    .global-search {
        max-width: 200px;
    }

    .admin-login-btn {
        display: none;
    }

    .header-stats {
        width: 100%;
        justify-content: space-between;
    }

    .header-stat-item {
        flex: 1;
        min-width: 70px;
    }

    .header-stat-value {
        font-size: var(--text-lg);
    }

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

    .actions {
        flex-direction: column;
    }

    .actions button {
        width: 100%;
    }

    .tabs {
        flex-wrap: nowrap;
        width: 100%;
    }

    .tab {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-sm);
    }

    .quote-meta, .synthesis-meta {
        flex-direction: column;
        gap: var(--space-1);
    }

    .assessment-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .container, .main-content {
        padding: var(--space-3);
    }

    .controls, .card, .panel {
        padding: var(--space-3);
    }

    .global-search {
        max-width: 160px;
        min-width: 120px;
    }

    .global-search input.global-search-input {
        padding: 6px 12px 6px 36px;
        font-size: var(--text-sm);
    }

    .global-search .global-search-icon {
        left: 10px;
    }

    .header-stat-item {
        padding: var(--space-2);
    }
}

/* -----------------------------------------------------------------------------
   UTILITY CLASSES
   ----------------------------------------------------------------------------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.text-positive { color: var(--color-positive); }
.text-negative { color: var(--color-negative); }
.text-warning { color: var(--color-warning); }
.text-muted { color: var(--color-text-muted); }

.bg-positive-soft { background: var(--color-positive-soft); }
.bg-negative-soft { background: var(--color-negative-soft); }
.bg-warning-soft { background: var(--color-warning-soft); }

.font-tabular { font-variant-numeric: tabular-nums; }

/* -----------------------------------------------------------------------------
   FEED TAB - Chronological Earnings Feed
   ----------------------------------------------------------------------------- */
.feed-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.feed-card {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-primary);
    overflow: hidden;
    transition: box-shadow var(--transition-fast);
}

.feed-card:hover {
    box-shadow: var(--shadow-md);
}

.feed-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    background: var(--color-bg-tertiary);
    border-bottom: 1px solid var(--color-border-primary);
    border-left: 4px solid var(--color-brand);
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

.feed-card-header:hover {
    background: var(--color-bg-hover);
}

.feed-card-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.feed-company-name {
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
    color: var(--color-brand);
}

.feed-ticker-label {
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
}

.feed-quarter {
    color: var(--color-text-tertiary);
    font-size: var(--text-xs);
    background: var(--color-bg-active);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-weight: var(--font-medium);
}

.feed-card-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.feed-date {
    color: var(--color-text-tertiary);
    font-size: var(--text-sm);
}

.feed-expand-icon {
    color: var(--color-text-tertiary);
    font-size: var(--text-xs);
    transition: transform var(--transition-fast);
}

.feed-quote-count {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    background: var(--color-bg-active);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
}

.feed-card-summary {
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-md);
    line-height: var(--leading-relaxed);
    color: var(--color-text-primary);
    border-bottom: 1px solid var(--color-border-subtle);
}

.feed-card-content {
    padding: var(--space-5);
    transition: max-height var(--transition-slow), opacity var(--transition-base), padding var(--transition-base);
    overflow: hidden;
    max-height: 5000px;
    opacity: 1;
}

.feed-card-content.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0 var(--space-5);
}

.feed-card-loading {
    color: var(--color-text-muted);
    font-style: italic;
    text-align: center;
    padding: var(--space-4);
}

.feed-error {
    color: var(--color-negative);
    padding: var(--space-3);
    background: var(--color-negative-soft);
    border-radius: var(--radius-md);
}

.feed-no-details {
    color: var(--color-text-muted);
    font-style: italic;
    text-align: center;
    padding: var(--space-4);
}

/* Feed Rating Badges */
.feed-rating-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.feed-rating-badge.strong-beat {
    background: var(--color-positive-soft);
    color: var(--color-positive-text);
}

.feed-rating-badge.beat {
    background: var(--color-positive-soft);
    color: var(--color-positive-text);
}

.feed-rating-badge.inline,
.feed-rating-badge.in-line {
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

.feed-rating-badge.miss {
    background: var(--color-negative-soft);
    color: var(--color-negative-text);
}

.feed-rating-badge.strong-miss {
    background: var(--color-negative-soft);
    color: var(--color-negative-text);
}

/* Feed Sentiment Badges */
.feed-sentiment-badge {
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.feed-sentiment-badge.very-bullish,
.feed-sentiment-badge.bullish {
    background: var(--color-positive-soft);
    color: var(--color-positive-text);
}

.feed-sentiment-badge.neutral {
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

.feed-sentiment-badge.bearish,
.feed-sentiment-badge.very-bearish {
    background: var(--color-negative-soft);
    color: var(--color-negative-text);
}

/* Feed Section Titles */
.feed-section-title {
    font-size: var(--text-md);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-border-subtle);
}

/* Feed Recap Sections */
.feed-recap-section {
    margin-bottom: var(--space-5);
}

.feed-recap-section:last-child {
    margin-bottom: 0;
}

/* Feed Metrics Grid */
.feed-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-3);
}

.feed-metric-item {
    background: var(--color-bg-tertiary);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-subtle);
}

.feed-metric-name {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.feed-metric-value {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
}

.feed-metric-trend {
    font-size: var(--text-xs);
    margin-top: var(--space-1);
}

.feed-metric-trend.trend-positive {
    color: var(--color-positive);
}

.feed-metric-trend.trend-negative {
    color: var(--color-negative);
}

.feed-metric-trend.trend-neutral {
    color: var(--color-text-secondary);
}

/* Feed Commentary */
.feed-commentary-item {
    margin-bottom: var(--space-3);
    padding: var(--space-3);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-brand);
}

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

.feed-commentary-theme {
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.feed-commentary-quote {
    font-style: italic;
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}

/* Feed Guidance List */
.feed-guidance-list {
    margin: 0;
    padding-left: var(--space-5);
    color: var(--color-text-secondary);
}

.feed-guidance-list li {
    margin-bottom: var(--space-2);
    line-height: var(--leading-relaxed);
}

/* Feed Bottom Line */
.feed-bottom-line {
    background: var(--color-bg-tertiary);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-brand);
}

.feed-bottom-line p {
    margin: 0;
    line-height: var(--leading-relaxed);
}

/* Feed Quotes Section */
.feed-quotes-section {
    margin-top: var(--space-5);
    padding-top: var(--space-5);
    border-top: 1px solid var(--color-border-primary);
}

.feed-quote-item {
    margin-bottom: var(--space-3);
    padding: var(--space-3);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-text-muted);
}

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

.feed-quote-text {
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.feed-quote-text strong {
    background: var(--color-warning-soft);
    padding: 0 var(--space-1);
    border-radius: var(--radius-xs);
}

.feed-quote-subject {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Feed Results Summary */
.feed-consolidated {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.feed-result-line {
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--color-brand);
}

.feed-trend-context {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    font-style: italic;
    margin-top: var(--space-2);
    line-height: var(--leading-relaxed);
}

.feed-guidance-punchline {
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: var(--color-positive-soft);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    line-height: var(--leading-relaxed);
}

/* Feed Segments */
.feed-segment {
    margin-bottom: var(--space-4);
    padding: var(--space-4);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-brand);
}

.feed-segment:last-child {
    margin-bottom: 0;
}

.feed-segment-name {
    font-weight: var(--font-bold);
    font-size: var(--text-md);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.feed-segment-headline {
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
    font-weight: var(--font-medium);
}

.feed-segment-detail {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-1);
    line-height: var(--leading-relaxed);
}

.feed-segment-trajectory {
    display: inline-block;
    margin-top: var(--space-2);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
}

.feed-segment-trajectory.accelerating {
    background: var(--color-positive-soft);
    color: var(--color-positive-text);
}

.feed-segment-trajectory.stable {
    background: var(--color-bg-active);
    color: var(--color-text-secondary);
}

.feed-segment-trajectory.decelerating {
    background: var(--color-negative-soft);
    color: var(--color-negative-text);
}

/* Feed Trajectory */
.feed-trajectory p {
    margin: 0;
    line-height: var(--leading-relaxed);
}

/* Feed Commentary Implication */
.feed-commentary-implication {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-top: var(--space-2);
}

/* Feed Thesis */
.feed-thesis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.feed-thesis-item {
    padding: var(--space-3);
    border-radius: var(--radius-md);
}

.feed-thesis-item.bull {
    background: var(--color-positive-soft);
    border-left: 4px solid var(--color-positive);
}

.feed-thesis-item.bear {
    background: var(--color-negative-soft);
    border-left: 4px solid var(--color-negative);
}

.feed-thesis-label {
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
}

.feed-thesis-status {
    text-transform: uppercase;
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

.feed-thesis-status.strengthened {
    background: var(--color-positive);
    color: white;
}

.feed-thesis-status.unchanged {
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

.feed-thesis-status.weakened {
    background: var(--color-negative);
    color: white;
}

.feed-thesis-analysis {
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    line-height: var(--leading-relaxed);
}

/* -----------------------------------------------------------------------------
   FEED CARD - CURATED CONTENT LAYOUT (Option 2)
   ----------------------------------------------------------------------------- */

/* Consolidated Results Section */
.feed-consolidated-results {
    margin-bottom: var(--space-5);
}

.feed-results-box {
    background: var(--color-bg-secondary);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-primary);
}

.feed-punchline {
    font-size: var(--text-md);
    line-height: var(--leading-relaxed);
    color: var(--color-text-primary);
    margin-bottom: var(--space-4);
}

.feed-results-list {
    margin: 0;
    padding-left: var(--space-5);
    line-height: 1.8;
    font-size: var(--text-md);
    color: var(--color-text-primary);
}

.feed-results-list li {
    margin-bottom: var(--space-1);
}

.feed-results-tree {
    margin: var(--space-4) 0 0 var(--space-5);
    padding: 0;
    list-style: none;
    font-size: var(--text-sm);
    line-height: 1.8;
}

.feed-tree-item {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-1);
}

.feed-tree-item.trend,
.feed-tree-item.management,
.feed-tree-item.outlook {
    color: var(--color-text-primary);
}

.feed-tree-branch {
    color: var(--color-text-muted);
    margin-right: var(--space-2);
}

.feed-tree-label {
    font-weight: var(--font-medium);
    color: var(--color-text-secondary);
    margin-right: var(--space-1);
}

.feed-tree-item.trend .feed-tree-label,
.feed-tree-item.management .feed-tree-label,
.feed-tree-item.outlook .feed-tree-label {
    color: var(--color-brand);
}

/* Thesis Impact Full */
.feed-thesis-full {
    margin-bottom: var(--space-5);
}

.feed-thesis-full .feed-thesis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.feed-thesis-full .feed-thesis-item {
    padding: var(--space-4);
    border-radius: var(--radius-md);
}

.feed-thesis-full .feed-thesis-item.bull {
    background: var(--color-positive-soft);
    border-left: 4px solid var(--color-positive);
}

.feed-thesis-full .feed-thesis-item.bear {
    background: var(--color-negative-soft);
    border-left: 4px solid var(--color-negative);
}

.feed-thesis-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.feed-thesis-icon {
    flex-shrink: 0;
    font-size: var(--text-sm);
}

.feed-thesis-full .feed-thesis-label {
    font-weight: var(--font-semibold);
    color: var(--color-text-primary);
    font-size: var(--text-sm);
}

.feed-thesis-full .feed-thesis-status {
    font-weight: var(--font-bold);
    text-transform: uppercase;
    font-size: var(--text-xs);
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    margin-left: auto;
}

.feed-thesis-full .feed-thesis-status.strengthened {
    background: var(--color-positive);
    color: white;
}

.feed-thesis-full .feed-thesis-status.unchanged {
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

.feed-thesis-full .feed-thesis-status.weakened {
    background: var(--color-negative);
    color: white;
}

.feed-thesis-full .feed-thesis-analysis {
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    line-height: var(--leading-relaxed);
}

/* Standout Quote */
.feed-standout-quote {
    margin-bottom: var(--space-5);
}

.feed-quote-box {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-brand);
}

.feed-quote-mark {
    font-size: var(--text-3xl);
    line-height: 1;
    color: var(--color-brand);
    opacity: 0.5;
    font-family: Georgia, serif;
    flex-shrink: 0;
}

.feed-quote-content {
    flex: 1;
    min-width: 0;
}

.feed-quote-text-main {
    font-size: var(--text-sm);
    font-style: italic;
    color: var(--color-text-primary);
    line-height: var(--leading-relaxed);
    margin: 0 0 var(--space-2) 0;
}

.feed-quote-attribution {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    margin: 0;
    font-style: normal;
}

/* CTA Section */
.feed-cta-section {
    text-align: center;
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border-subtle);
}

.feed-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    background: var(--color-brand);
    color: var(--color-text-inverse);
    font-size: var(--text-md);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: var(--transition-fast);
}

.feed-cta-button:hover {
    background: var(--color-brand-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Responsive adjustments for feed */
@media (max-width: 768px) {
    .feed-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .feed-card-right {
        width: 100%;
        justify-content: flex-start;
    }

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

    .feed-thesis-grid,
    .feed-thesis-full .feed-thesis-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   SENTIMENT DASHBOARD STYLES
   ===================================================== */

.sentiment-dashboard {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.sentiment-period {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-2);
}

.sentiment-industry-row {
    display: grid;
    grid-template-columns: 180px 1fr 80px 100px 120px;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-primary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.sentiment-industry-row:hover {
    background: var(--color-bg-tertiary);
    border-color: var(--color-border-secondary);
}

.sentiment-industry-name {
    font-weight: 600;
    color: var(--color-text-primary);
    text-transform: capitalize;
}

.sentiment-bar-container {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sentiment-bar-track {
    flex: 1;
    height: 24px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.sentiment-bar-fill {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.sentiment-bar-fill.tailwind {
    left: 50%;
    background: linear-gradient(90deg, var(--color-success-bg) 0%, var(--color-success) 100%);
}

.sentiment-bar-fill.headwind {
    right: 50%;
    background: linear-gradient(270deg, var(--color-error-bg) 0%, var(--color-error) 100%);
}

.sentiment-bar-fill.neutral {
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text-tertiary);
}

.sentiment-bar-center {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-border-secondary);
    transform: translateX(-50%);
}

.sentiment-score {
    font-weight: 700;
    font-size: var(--font-size-lg);
    min-width: 60px;
    text-align: right;
}

.sentiment-score.positive {
    color: var(--color-success);
}

.sentiment-score.negative {
    color: var(--color-error);
}

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

.sentiment-direction {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.sentiment-direction.tailwind {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.sentiment-direction.headwind {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.sentiment-direction.neutral {
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

.sentiment-meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    text-align: right;
}

.sentiment-trend {
    font-size: var(--font-size-xs);
    margin-left: var(--space-1);
}

.sentiment-trend.improving {
    color: var(--color-success);
}

.sentiment-trend.worsening {
    color: var(--color-error);
}

.sentiment-trend.stable {
    color: var(--color-text-tertiary);
}

/* Industry Detail View */
.sentiment-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
}

.sentiment-detail-score {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.sentiment-detail-score-value {
    font-size: 2.5rem;
    font-weight: 700;
}

.sentiment-detail-stats {
    display: flex;
    gap: var(--space-6);
}

.sentiment-detail-stat {
    text-align: center;
}

.sentiment-detail-stat-value {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text-primary);
}

.sentiment-detail-stat-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    text-transform: uppercase;
}

/* Company sentiment breakdown */
.sentiment-company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.sentiment-company-card {
    padding: var(--space-3);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-primary);
}

.sentiment-company-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.sentiment-company-ticker {
    font-weight: 600;
    font-size: var(--font-size-lg);
}

.sentiment-company-score {
    font-weight: 700;
    font-size: var(--font-size-lg);
}

.sentiment-company-meta {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
}

/* Sentiment quotes */
.sentiment-quotes-section {
    margin-top: var(--space-6);
}

.sentiment-quotes-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--color-text-primary);
}

.sentiment-quote-card {
    padding: var(--space-4);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-primary);
    margin-bottom: var(--space-3);
}

.sentiment-quote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.sentiment-quote-ticker {
    font-weight: 600;
    color: var(--color-text-primary);
}

.sentiment-quote-score-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.sentiment-quote-score-badge.bullish {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.sentiment-quote-score-badge.bearish {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.sentiment-quote-score-badge.neutral {
    background: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

.sentiment-quote-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-2);
}

.sentiment-quote-reason {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    font-style: italic;
}

/* Empty state */
.sentiment-empty {
    text-align: center;
    padding: var(--space-8);
    color: var(--color-text-tertiary);
}

.sentiment-empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.sentiment-empty-text {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2);
}

.sentiment-empty-subtext {
    font-size: var(--font-size-sm);
}

/* Back button */
.sentiment-back-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: var(--space-4);
}

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

/* Responsive */
@media (max-width: 768px) {
    .sentiment-industry-row {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }

    .sentiment-bar-container {
        width: 100%;
    }

    .sentiment-company-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   EARNINGS CALENDAR STYLES
   ============================================================================= */

/* Grid Calendar Layout */
.calendar-grid {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Header row with day names */
.calendar-header-row {
    display: grid;
    grid-template-columns: 120px repeat(5, 1fr);
    background: var(--color-bg-tertiary);
    border-bottom: 2px solid var(--color-border-primary);
}

.calendar-header-day {
    padding: var(--space-3);
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    text-align: center;
    border-left: 1px solid var(--color-border-primary);
}

/* Week row */
.calendar-week-row {
    display: grid;
    grid-template-columns: 120px repeat(5, 1fr);
    border-bottom: 1px solid var(--color-border-primary);
}

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

.calendar-week-label {
    padding: var(--space-3);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    background: var(--color-bg-tertiary);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    font-weight: 500;
    border-right: 1px solid var(--color-border-primary);
}

/* Calendar cell */
.calendar-cell {
    padding: var(--space-2);
    min-height: 80px;
    border-left: 1px solid var(--color-border-primary);
    background: var(--color-bg-secondary);
    transition: background 0.15s ease;
}

.calendar-cell:hover {
    background: var(--color-bg-hover);
}

.calendar-cell-today {
    background: var(--color-brand-soft);
    box-shadow: inset 0 0 0 2px var(--color-brand);
}

.calendar-cell-today:hover {
    background: var(--color-brand-soft);
}

.calendar-cell-past {
    opacity: 0.5;
}

.calendar-cell-date {
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-2);
    font-weight: 500;
}

.calendar-cell-today .calendar-cell-date {
    color: var(--color-brand);
    font-weight: 600;
}

.calendar-cell-earnings {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Ticker chips */
.calendar-chip {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-primary);
}

.calendar-chip.bmo {
    background: var(--color-warning-soft);
    color: var(--color-warning);
    border-color: transparent;
}

.calendar-chip.amc {
    background: var(--color-info-soft);
    color: var(--color-info);
    border-color: transparent;
}

/* Legend */
.calendar-legend {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-3);
    margin-top: var(--space-3);
    font-size: var(--font-size-xs);
    color: var(--color-text-tertiary);
}

.calendar-legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Calendar Responsive */
@media (max-width: 768px) {
    .calendar-header-row,
    .calendar-week-row {
        grid-template-columns: 80px repeat(5, 1fr);
    }

    .calendar-week-label {
        font-size: 10px;
        padding: var(--space-2);
    }

    .calendar-cell {
        padding: var(--space-1);
        min-height: 60px;
    }

    .calendar-chip {
        font-size: 9px;
        padding: 1px 4px;
    }
}

/* =============================================================================
   ADMIN AUTHENTICATION
   ============================================================================= */

/* Admin Login Button in Header */
.admin-login-btn {
    background: transparent;
    border: 1px solid var(--color-border-primary);
    color: var(--color-text-secondary);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-right: var(--space-2);
}

.admin-login-btn:hover {
    background: var(--color-bg-hover);
    border-color: var(--color-border-secondary);
    color: var(--color-text-primary);
}

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

/* Modal Content */
.modal-content {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    margin: var(--space-4);
    overflow: hidden;
}

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

.modal-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text-primary);
}

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

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

.modal-body {
    padding: var(--space-4);
}

.modal-body input[type="password"] {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--color-border-primary);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    transition: border-color var(--transition-fast);
}

.modal-body input[type="password"]:focus {
    outline: none;
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px var(--color-brand-soft);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4);
    border-top: 1px solid var(--color-border-primary);
    background: var(--color-bg-tertiary);
}

/* Admin-only elements - hidden by default */
.admin-only {
    display: none !important;
}

/* When admin is authenticated, body gets .is-admin class and elements are shown */
body.is-admin .admin-only {
    display: revert !important;
}
