* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-green: #2F6B6B;
    --primary-green-dark: #1f4a4a;
    --primary-green-light: #3f8b8b;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --chart-bar: #cbd5e1;
    --chart-highlight: #d97706;
    --median-line: #d97706;
    --table-header: #2F6B6B;
    --table-row-alt: #f8fafc;
    --table-summary: #e8f4f4;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background: var(--bg-light);
    margin: 0;
    padding: 0;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--bg-light);
    border-right: 1px solid var(--border-color);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-content {
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    display: flex;
    align-items: center;
    color: var(--primary-green);
}

.logo-icon svg {
    width: 32px;
    height: 32px;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.logo-line {
    display: block;
}

/* Sidebar Search */
.sidebar-search {
    margin-bottom: 2rem;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.search-input-wrapper:hover {
    border-color: var(--primary-green);
}

.search-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.search-shortcut {
    font-size: 0.75rem;
    color: var(--text-light);
    background: var(--bg-light);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Sidebar Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 2rem;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
    font-size: 0.9rem;
}

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

.nav-item.active {
    background: var(--primary-green);
    color: white;
}

.beta-badge {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

.nav-item.active .beta-badge {
    background: rgba(255, 255, 255, 0.3);
}

/* Sidebar Settings */
.sidebar-settings {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 1rem;
}

.green-circle {
    width: 8px;
    height: 8px;
    background: var(--primary-green);
    border-radius: 50%;
}

/* Main Content */
.main-content {
    margin-left: 240px;
    flex: 1;
    min-height: 100vh;
    background: var(--bg-light);
}

.btn-primary {
    padding: 0.5rem 1.5rem;
    background: var(--primary-green);
    color: white;
    text-decoration: none;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

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

/* Dashboard Container */
.dashboard-container {
    padding: 2rem 0;
}

.dashboard-top {
    background: var(--bg-white);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-title-section {
    margin-bottom: 1rem;
}

.dashboard-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.search-filter-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-white);
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.search-box svg {
    color: var(--text-light);
    flex-shrink: 0;
}

.search-box input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 0.9rem;
}

.filter-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.filter-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-light);
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-remove:hover {
    color: var(--text-dark);
}

.dashboard-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-dark);
}

.action-btn:hover {
    background: var(--bg-light);
}

.action-btn.primary {
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.action-btn.primary:hover {
    background: var(--primary-green-dark);
}

.action-btn.icon {
    padding: 0.5rem;
    width: 36px;
    font-size: 1.2rem;
}

.action-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    background: var(--bg-white);
    cursor: pointer;
    color: var(--text-dark);
}

/* Navigation Tabs */
.dashboard-tabs {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    gap: 2rem;
}

.tab {
    padding: 1rem 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab:hover {
    color: var(--text-dark);
}

.tab.active {
    color: var(--primary-green);
    border-bottom-color: var(--primary-green);
}

/* Chart Controls */
.chart-controls {
    background: var(--bg-white);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.control-group label {
    font-size: 0.9rem;
    color: var(--text-dark);
    white-space: nowrap;
}

.slider {
    width: 100px;
}

.control-value {
    font-size: 0.85rem;
    color: var(--text-light);
    min-width: 40px;
}

.control-select {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.9rem;
    background: var(--bg-white);
    cursor: pointer;
    color: var(--text-dark);
}

.percentile-toggles {
    display: flex;
    gap: 1rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    cursor: pointer;
}

.time-radio {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.time-radio label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.quarter-input {
    width: 50px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    font-size: 0.9rem;
}

/* Charts Section */
.charts-section {
    background: var(--bg-white);
    padding: 2rem;
}

.chart-container {
    margin-bottom: 3rem;
}

.chart-container:last-child {
    margin-bottom: 0;
}

.chart-header {
    margin-bottom: 1rem;
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
}

.info-icon {
    color: var(--text-light);
    cursor: help;
    font-size: 0.9rem;
}

.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
    overflow-x: auto;
}

.chart-svg {
    width: 100%;
    height: 100%;
    min-width: 1200px;
}

.axis-label {
    font-size: 12px;
    fill: var(--text-light);
    font-weight: 500;
}

.chart-bars {
    position: absolute;
    bottom: 0;
    left: 60px;
    right: 20px;
    height: 240px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 0 20px;
}

.chart-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 30px;
}

.chart-bar {
    width: 100%;
    background: var(--chart-bar);
    border-radius: 4px 4px 0 0;
    transition: all 0.2s;
    cursor: pointer;
}

.chart-bar:hover {
    opacity: 0.8;
}

.chart-bar.highlight {
    background: var(--chart-highlight);
}

.chart-ticker {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
    white-space: nowrap;
}

/* Comps Table Section */
.comps-table-section {
    background: var(--bg-white);
    padding: 2rem;
    margin-top: 2rem;
}

.table-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

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

.comps-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 1200px;
}

.comps-table thead {
    background: var(--table-header);
    color: white;
}

.table-header-main th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.table-header-sub th {
    padding: 0.75rem 1rem;
    text-align: right;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
}

.comps-table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.comps-table tbody tr:nth-child(even) {
    background: var(--table-row-alt);
}

.comps-table tbody td {
    padding: 0.75rem 1rem;
    text-align: right;
    color: var(--text-dark);
}

.comps-table tbody td:first-child {
    text-align: left;
    font-weight: 600;
}

.comps-table tbody td strong {
    color: var(--text-dark);
}

.summary-row {
    background: var(--table-summary) !important;
    font-weight: 600;
}

.summary-row td {
    border-top: 2px solid var(--primary-green);
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

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

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

.last-updated {
    text-align: right;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 968px) {
    .dashboard-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .action-btn,
    .action-select {
        width: 100%;
    }

    .chart-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        width: 100%;
        justify-content: space-between;
    }

    .percentile-toggles {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .dashboard-title {
        font-size: 1.25rem;
    }

    .dashboard-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab {
        white-space: nowrap;
    }
}

