/* ============================================
   MODULE STYLES - DARK MODE APPLE STYLE
   Brand Color: #ff575f
   ============================================ */

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1 {
    font-family: 'RZA', 'Haffer', sans-serif;
    font-size: 28px;
    font-weight: 400;
    color: #fafafa;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

h2 {
    font-size: 17px;
    font-weight: 600;
    color: #fafafa;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

p {
    color: #a0a0a0;
    line-height: 1.6;
    font-size: 15px;
}

/* ============================================
   TAB BAR
   ============================================ */

.tab-bar {
    display: flex;
    gap: 8px;
}

.tab-btn {
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #808080;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fafafa;
}

.tab-btn.active {
    background: #ff575f;
    border-color: #ff575f;
    color: white;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.loading-logo {
    height: 48px;
    width: auto;
    margin-bottom: 8px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #333;
    border-top-color: #ff575f;
    border-radius: 50%;
    animation: loading-spin 0.8s linear infinite;
}

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

.loading-text {
    font-size: 14px;
    color: #808080;
    font-weight: 500;
    margin: 0;
}

.loading-text span {
    color: #34d399;
    font-weight: 600;
}

.loading-bike {
    font-size: 16px;
    color: #fafafa;
    font-weight: 500;
    margin: 0;
    max-width: 400px;
}

.loading-bike:empty {
    display: none;
}

/* ============================================
   UNIFIED HEADER STYLES
   ============================================ */

.header-bar {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px !important;
    height: 56px;
    min-height: 56px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon {
    height: 28px;
    width: auto;
}

.header-title {
    font-family: 'RZA', 'Haffer', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: #fafafa;
    white-space: nowrap;
}

.header-center {
    display: flex;
    align-items: center;
}

.header-center .tab-bar {
    gap: 4px;
}

.header-center .tab-btn {
    padding: 8px 16px;
    font-size: 13px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================
   HEADER DROPDOWN MENU
   ============================================ */

/* Override grid-item overflow:hidden for header so dropdown can show */
.header-module {
    overflow: visible !important;
}

.header-module .module-content {
    overflow: visible !important;
}

.header-menu-container {
    position: relative;
}

.header-menu-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #808080;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.header-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fafafa;
}

.header-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s ease;
    z-index: 1000;
}

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

.dropdown-section {
    padding: 4px 0;
}

.dropdown-label {
    display: block;
    padding: 8px 16px 4px;
    font-size: 10px;
    font-weight: 600;
    color: #606060;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: #a0a0a0;
    text-decoration: none;
    transition: all 0.1s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fafafa;
}

.dropdown-item.active {
    color: #ff575f;
    background: rgba(255, 87, 95, 0.1);
}

.dropdown-divider {
    height: 1px;
    background: #333;
    margin: 8px 0;
}

/* Header Link Button (Manual Search, etc.) */
.header-link-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #444;
    border-radius: 6px;
    color: #808080;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.header-link-btn:hover {
    border-color: #ff575f;
    color: #ff575f;
}

/* Module Selector Dropdown (legacy, can remove later) */
.module-selector {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fafafa;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23808080' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.module-selector:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.module-selector:focus {
    outline: none;
    border-color: #ff575f;
}

.module-selector option {
    background: #1a1a1a;
    color: #fafafa;
    padding: 8px;
}

.load-report-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #ff575f, #ff3d47);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-report-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(255, 87, 95, 0.3);
}

.load-report-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
}

/* ============================================
   HEADER MODULE
   ============================================ */

.header-module {
    background: #1a1a1a;
    border: 1px solid rgba(255, 87, 95, 0.2);
}

.header-module h1 {
    color: #fafafa;
}

.header-module p {
    color: #a0a0a0;
    font-weight: 400;
    font-size: 13px;
}

.header-logo {
    height: 32px;
    width: auto;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    font-size: 15px;
    color: #fafafa;
    transition: all 0.2s ease;
    font-family: inherit;
}

input::placeholder,
select option:first-child {
    color: #666;
}

input:focus,
select:focus {
    outline: none;
    background: #0f0f0f;
    border-color: #ff575f;
    box-shadow: 0 0 0 4px rgba(255, 87, 95, 0.1);
}

select {
    cursor: pointer;
}

select option {
    background: #1a1a1a;
    color: #fafafa;
}

button {
    width: 100%;
    padding: 14px 20px;
    background: #ff575f;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
    letter-spacing: -0.2px;
}

button:hover {
    background: #ff6b72;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(255, 87, 95, 0.3);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 87, 95, 0.3);
}

button:disabled {
    background: #2a2a2a;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================
   LOGIN MODULE
   ============================================ */

.login-module {
    border-left: 3px solid #ff575f;
}

.login-module.hidden {
    display: none;
}

/* ============================================
   INPUT MODULE
   ============================================ */

.input-module {
    border-left: 3px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   RESULTS MODULE
   ============================================ */

.results-module {
    border-left: 3px solid rgba(255, 255, 255, 0.1);
}

.results-module .module-content {
    overflow-y: auto;
    max-height: 100%;
}

.price-card {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 0;
    border: 1px solid;
    transition: all 0.2s ease;
    text-align: center;
}

.price-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.price-card.conservative {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.price-card.target {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

.price-card.aggressive {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Recommended price card highlight */
.price-card.recommended {
    border-color: rgba(255, 255, 255, 0.3);
}

.price-card.recommended:hover {
    transform: translateY(-2px);
}

.rec-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    color: #fafafa;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.5px;
}

.price-card h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #fafafa;
    letter-spacing: -0.2px;
}

.price-card .price {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #fafafa;
    letter-spacing: -1px;
}

.price-card.target .price {
    color: #ff575f;
}

.price-card .margin {
    font-size: 13px;
    color: #a0a0a0;
    margin-bottom: 6px;
    font-weight: 500;
}

.price-card .margin-explainer {
    font-size: 10px;
    color: #666666;
    line-height: 1.4;
    margin-bottom: 0;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-left: none;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.price-card.conservative .margin-explainer {
    border-top-color: rgba(52, 211, 153, 0.3);
}

.price-card.target .margin-explainer {
    border-top-color: rgba(255, 87, 95, 0.3);
}

.price-card.aggressive .margin-explainer {
    border-top-color: rgba(251, 191, 36, 0.3);
}

.price-card .reasoning {
    font-size: 11px;
    color: #808080;
    line-height: 1.5;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.price-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

/* ============================================
   MARKET MODULE
   ============================================ */

.market-module {
    border-left: 3px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.market-module .module-content {
    overflow-y: auto;
}

/* ============================================
   LIVE MARKET MODULE
   ============================================ */

.livemarket-module {
    border-left: 3px solid rgba(52, 211, 153, 0.3);
    overflow: hidden;
}

.livemarket-module .module-content {
    overflow-y: auto;
}

.livemarket-module h2 {
    color: #34d399;
}

.insights-module {
    overflow: hidden;
}

.insights-module .module-content {
    overflow-y: auto;
}

.market-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.market-badge:hover {
    transform: translateY(-1px);
}

.market-badge.success {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.market-badge.warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.market-badge.info {
    background: rgba(255, 255, 255, 0.05);
    color: #808080;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   INSIGHTS MODULE
   ============================================ */

.insights-module {
    border-left: 3px solid rgba(255, 255, 255, 0.1);
}

.insight-item {
    padding: 16px;
    background: #0f0f0f;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: start;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.insight-item:hover {
    background: #141414;
    border-color: rgba(255, 87, 95, 0.2);
}

.insight-item::before {
    content: "💡";
    font-size: 20px;
}

/* ============================================
   REPORT MODULE
   ============================================ */

.report-module {
    border-left: 3px solid rgba(255, 87, 95, 0.5);
    overflow: hidden;
}

.report-module .module-content {
    overflow-y: auto;
}

.report-module h2 {
    color: #ff575f;
}

/* Report module responsive - ensure proper grid positioning */
@media (max-width: 1400px) {
    .report-module[style*="display: block"],
    .report-module[style*="display: flex"] {
        grid-column: 1 / -1 !important;
        grid-row: 2 / 6 !important;
        min-height: 400px;
    }
}

@media (max-width: 1200px) {
    .report-module[style*="display: block"],
    .report-module[style*="display: flex"] {
        grid-row: 3 / 7 !important;
    }
}

@media (max-width: 768px) {
    .report-module[style*="display: block"],
    .report-module[style*="display: flex"] {
        grid-column: 1 !important;
        grid-row: auto !important;
        min-height: 500px;
    }
}

/* ============================================
   STATUS MODULE
   ============================================ */

.status-module {
    background: #0f0f0f;
    color: #a0a0a0;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.status-module .module-content {
    padding: 16px 24px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.status-module span {
    font-size: 13px;
    font-weight: 500;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #4a4a4a;
    font-size: 14px;
    min-height: 140px;
}

/* ============================================
   LOADING STATE
   ============================================ */

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    gap: 20px;
    min-height: 200px;
}

.loading p {
    color: #666;
    font-size: 14px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ff575f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

.text-success {
    color: #34d399;
}

.text-warning {
    color: #fbbf24;
}

.text-error {
    color: #ff575f;
}

.text-brand {
    color: #ff575f;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

/* ============================================
   SIMILAR BIKES TABLE
   ============================================ */

.similar-bikes-module {
    border-left: 3px solid rgba(255, 255, 255, 0.1);
}

.similar-bikes-table {
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 400px; /* Set max height for scrolling */
}

.bikes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.bikes-table thead {
    position: sticky;
    top: 0;
    background: #1a1a1a;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.bikes-table th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: #fafafa;
    border-bottom: 2px solid rgba(255, 87, 95, 0.3);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bikes-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #a0a0a0;
}

.bikes-table tr:hover {
    background: rgba(255, 87, 95, 0.05);
}

.bikes-table .bike-title {
    color: #fafafa;
    font-weight: 500;
    max-width: none; /* Allow full width */
    white-space: normal; /* Allow wrapping if needed */
}

.bikes-table .price {
    color: #ff575f;
    font-weight: 600;
}

.bikes-table .score {
    color: #34d399;
    font-weight: 600;
}

/* Custom scrollbar for table */
.similar-bikes-table::-webkit-scrollbar {
    width: 8px;
}

.similar-bikes-table::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.similar-bikes-table::-webkit-scrollbar-thumb {
    background: #ff575f;
    border-radius: 4px;
}

.similar-bikes-table::-webkit-scrollbar-thumb:hover {
    background: #ff6b72;
}

/* ============================================
   MARKET DATA ALERTS & STYLING
   ============================================ */

.price-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: #a0a0a0;
}

.price-alert.alert-positive {
    border-color: rgba(255, 255, 255, 0.15);
}

.price-alert.alert-negative {
    border-color: rgba(255, 255, 255, 0.15);
}

.price-alert strong {
    font-weight: 600;
    color: #fafafa;
}

.market-adjusted-note {
    font-size: 10px;
    color: #808080;
    font-weight: 500;
    margin-top: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    display: inline-block;
}

.live-market-section {
    padding: 16px;
    background: rgba(52, 211, 153, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(52, 211, 153, 0.15);
    margin-top: 16px;
}

.retailer-table {
    max-height: 200px;
    overflow-y: auto;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.retailer-table table {
    width: 100%;
    border-collapse: collapse;
}

.retailer-table th {
    color: #a0a0a0;
    font-weight: 600;
}

.retailer-table td {
    color: #a0a0a0;
}

.retailer-table a {
    color: #ff575f;
    text-decoration: none;
    transition: color 0.2s ease;
}

.retailer-table a:hover {
    color: #ff6b72;
    text-decoration: underline;
}

.retailer-table::-webkit-scrollbar {
    width: 6px;
}

.retailer-table::-webkit-scrollbar-track {
    background: transparent;
}

.retailer-table::-webkit-scrollbar-thumb {
    background: #34d399;
    border-radius: 3px;
}

.retailer-table::-webkit-scrollbar-thumb:hover {
    background: #4ade80;
}

/* ============================================
   AUTOPRICER MATCHES CONTAINER
   ============================================ */

#autopricerMatchesContainer {
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #34d399 #1a1a1a;
}

#autopricerMatchesContainer::-webkit-scrollbar {
    width: 6px;
}

#autopricerMatchesContainer::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 3px;
}

#autopricerMatchesContainer::-webkit-scrollbar-thumb {
    background: #34d399;
    border-radius: 3px;
}

#autopricerMatchesContainer::-webkit-scrollbar-thumb:hover {
    background: #4ade80;
}

/* ============================================
   RESPONSIVE TYPOGRAPHY & COMPONENTS
   ============================================ */

/* Standard laptops */
@media (max-width: 1400px) {
    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 15px;
        margin-bottom: 16px;
    }

    p {
        font-size: 14px;
    }

    .price-card .price {
        font-size: 22px;
    }

    .price-card h3 {
        font-size: 12px;
    }

    .price-card .margin {
        font-size: 12px;
    }

    input[type="text"],
    input[type="password"],
    input[type="number"],
    select {
        padding: 10px 14px;
        font-size: 14px;
    }

    button {
        padding: 12px 18px;
        font-size: 14px;
    }
}

/* Tablets and smaller laptops */
@media (max-width: 1200px) {
    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 14px;
        margin-bottom: 14px;
    }

    .price-card {
        padding: 14px;
    }

    .price-card .price {
        font-size: 20px;
    }

    .price-cards-grid {
        gap: 10px;
    }

    .stats-grid {
        gap: 10px;
    }

    .bikes-table {
        font-size: 11px;
    }

    .bikes-table th {
        padding: 8px 6px;
        font-size: 10px;
    }

    .bikes-table td {
        padding: 8px 6px;
    }
}

/* Tablets */
@media (max-width: 992px) {
    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 13px;
    }

    .header-module p {
        font-size: 12px;
    }

    .price-cards-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
    }

    .stats-grid {
        gap: 8px;
    }

    .market-badge {
        padding: 5px 10px;
        font-size: 11px;
    }

    .insight-item {
        padding: 12px;
        gap: 10px;
    }

    .insight-item::before {
        font-size: 16px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    h1 {
        font-size: 20px;
        margin-bottom: 4px;
    }

    h2 {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .header-module .module-content {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px;
    }

    .header-module .module-content > div:last-child {
        width: 100%;
    }

    .header-module .module-content > div:last-child button {
        flex: 1;
    }

    #segmentHeatmap {
        display: none !important;
    }

    .price-card {
        padding: 12px;
    }

    .price-card .price {
        font-size: 20px;
    }

    .price-card h3 {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .price-card .margin {
        font-size: 11px;
    }

    .price-card .margin-explainer {
        font-size: 9px;
        padding: 5px 6px;
    }

    .price-cards-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }

    .status-module .module-content {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 16px;
    }

    .status-module span {
        font-size: 11px;
    }

    .similar-bikes-table {
        max-height: 300px;
    }

    .bikes-table {
        font-size: 10px;
    }

    .bikes-table th {
        padding: 8px 4px;
        font-size: 9px;
    }

    .bikes-table td {
        padding: 8px 4px;
    }

    .retailer-table {
        max-height: 150px;
    }

    .empty-state {
        min-height: 100px;
        font-size: 13px;
    }

    .loading {
        padding: 32px;
        min-height: 150px;
    }

    .spinner {
        width: 32px;
        height: 32px;
    }

    .price-alert {
        padding: 12px 14px;
        font-size: 12px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    h1 {
        font-size: 18px;
    }

    h2 {
        font-size: 13px;
        margin-bottom: 10px;
    }

    p {
        font-size: 13px;
    }

    input[type="text"],
    input[type="password"],
    input[type="number"],
    select {
        padding: 10px 12px;
        font-size: 13px;
        margin-bottom: 10px;
    }

    button {
        padding: 12px 16px;
        font-size: 13px;
    }

    .price-card .price {
        font-size: 18px;
    }

    .market-badge {
        padding: 4px 8px;
        font-size: 10px;
        margin-right: 6px;
        margin-bottom: 6px;
    }

    .insight-item {
        padding: 10px;
        font-size: 12px;
    }

    .status-module span {
        font-size: 10px;
    }
}

/* ============================================
   ABCXYZ MATRIX MODAL
   ============================================ */

.matrix-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.matrix-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.matrix-modal-content {
    position: relative;
    background: #1a1a1a;
    border: 1px solid rgba(255, 87, 95, 0.3);
    border-radius: 16px;
    width: 90%;
    max-width: 1000px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

.matrix-modal-header h2 {
    margin: 0;
    color: #fafafa;
    font-size: 18px;
    font-weight: 600;
}

.matrix-modal-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: #808080;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.matrix-modal-close:hover {
    background: rgba(255, 87, 95, 0.2);
    color: #ff575f;
}

.matrix-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.matrix-bikes-table {
    width: 100%;
    border-collapse: collapse;
}

.matrix-bikes-table th {
    text-align: left;
    padding: 10px 10px;
    background: #0f0f0f;
    color: #808080;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.matrix-bikes-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease, background 0.15s ease;
}

.matrix-bikes-table th.sortable:hover {
    color: #fafafa;
    background: #1a1a1a;
}

.matrix-bikes-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
    color: #fafafa;
}

.matrix-bikes-table tr:hover td {
    background: rgba(255, 87, 95, 0.05);
}

.matrix-bikes-table .bike-title {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.matrix-bikes-table .price {
    font-weight: 600;
    color: #fafafa;
}

.matrix-bikes-table .price.reduced {
    color: #ff9f0a;
}

.matrix-bikes-table .margin {
    font-weight: 600;
}

.matrix-bikes-table .margin.high {
    color: #34c759;
}

.matrix-bikes-table .margin.mid {
    color: #ff9f0a;
}

.matrix-bikes-table .margin.low {
    color: #ff575f;
}

.matrix-bikes-table .days {
    color: #808080;
}

.matrix-bikes-table .airtable-link {
    color: #ff575f;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.matrix-bikes-table .airtable-link:hover {
    color: #ff7a82;
    text-decoration: underline;
}

.matrix-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #808080;
}

.matrix-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 87, 95, 0.2);
    border-top-color: #ff575f;
    border-radius: 50%;
    animation: matrix-spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.matrix-empty {
    text-align: center;
    padding: 60px;
    color: #808080;
}

.matrix-class-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-left: 12px;
}

.matrix-class-badge.desirable {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
}

.matrix-class-badge.moderate {
    background: rgba(255, 159, 10, 0.2);
    color: #ff9f0a;
}

.matrix-class-badge.problematic {
    background: rgba(255, 87, 95, 0.2);
    color: #ff575f;
}

/* ============================================
   STOCK MATRIX MODULE
   ============================================ */

.stock-matrix-container {
    width: 100%;
}

.matrix-header {
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    font-size: 12px;
    color: #fafafa;
}

.matrix-total {
    color: #808080;
    font-weight: 400;
}

.matrix-grid {
    display: grid;
    grid-template-columns: 55px repeat(3, 1fr);
    gap: 4px;
    align-items: start;
}

.matrix-col-header {
    text-align: center;
}

.matrix-col-header .col-label {
    font-size: 11px;
    font-weight: 600;
    color: #fafafa;
}

.matrix-col-header .col-range {
    font-size: 9px;
    color: #808080;
}

.matrix-col-header .col-desc {
    font-size: 8px;
    color: #606060;
}

.matrix-row-header {
    text-align: right;
    padding-right: 6px;
}

.matrix-row-header .row-label {
    font-size: 11px;
    font-weight: 600;
    color: #fafafa;
}

.matrix-row-header .row-range {
    font-size: 9px;
    color: #808080;
}

.matrix-row-header .row-desc {
    font-size: 8px;
    color: #606060;
}

.matrix-cell {
    position: relative;
    height: 40px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
}

.matrix-cell:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.matrix-cell .cell-count {
    font-size: 14px;
    font-weight: 700;
    color: #000;
}

.matrix-cell .cell-label {
    font-size: 9px;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

.matrix-cell .cell-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: #fafafa;
    text-align: center;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

.matrix-cell .cell-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a1a1a;
}

.matrix-cell:hover .cell-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   PAGE TRANSITIONS
   ============================================ */

.page-exit {
    animation: pageExit 0.25s ease-out forwards;
}

.page-enter {
    animation: pageEnter 0.25s ease-out forwards;
}

@keyframes pageExit {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.98); }
}

@keyframes pageEnter {
    from { opacity: 0; transform: scale(1.02); }
    to { opacity: 1; transform: scale(1); }
}

/* ============================================
   TOP MODEL REPORT PAGE
   ============================================ */

.report-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a0a0a;
    z-index: 100;
    overflow-y: auto;
    padding: 20px;
}

.report-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 87, 95, 0.2);
    border-radius: 16px;
    margin-bottom: 20px;
}

.report-page-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #fafafa;
    margin: 0;
    letter-spacing: -0.3px;
}

.report-page-header .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #808080;
    font-size: 14px;
}

.report-page-header .header-right button {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #808080;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.report-page-header .header-right button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fafafa;
}

.back-btn {
    width: auto;
    padding: 8px 14px;
    background: rgba(255, 87, 95, 0.1);
    border: 1px solid rgba(255, 87, 95, 0.3);
    border-radius: 8px;
    color: #ff575f;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.back-btn:hover {
    background: rgba(255, 87, 95, 0.2);
    border-color: #ff575f;
}

.report-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.report-grid .grid-item {
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
}

.report-grid .grid-item h2 {
    font-size: 16px;
    color: #fafafa;
    margin-bottom: 16px;
}

.report-grid .grid-item .empty-state {
    color: #606060;
    font-size: 14px;
    text-align: center;
    padding: 40px 20px;
}

/* Top Models Tables */
.top-models-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.top-models-table th {
    text-align: right;
    padding: 8px 12px;
    color: #808080;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-models-table td {
    padding: 10px 12px;
    color: #e0e0e0;
    text-align: right;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.top-models-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.top-models-table tr:last-child td {
    border-bottom: none;
}

.module-table-container {
    overflow-x: auto;
}

/* Summary Stats */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: #34d399;
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #808080;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Spec Level Badges */
.spec-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.spec-top {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.spec-mid {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.spec-low {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.spec-base {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

.spec-unknown {
    background: rgba(107, 114, 128, 0.2);
    color: #6b7280;
}

/* Electronic Shift Indicators */
.eshift-yes {
    color: #22c55e;
    font-weight: 600;
}

.eshift-no {
    color: #6b7280;
    font-weight: 600;
}

/* Buy Prices Display */
.buy-price-cell {
    color: #34d399;
    font-weight: 600;
}

.buy-prices-cell {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    font-size: 12px;
}

.bp-conservative {
    color: #6b7280;
}

.bp-target {
    color: #34d399;
    font-weight: 600;
}

.bp-aggressive {
    color: #f59e0b;
}

/* Top Models Search */
.top-models-search {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.top-models-search input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fafafa;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.top-models-search input:focus {
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.08);
}

.top-models-search input::placeholder {
    color: #6b7280;
}

.search-results-count {
    font-size: 12px;
    color: #808080;
    white-space: nowrap;
}

/* ============================================
   AUTOPRICER PAGE
   ============================================ */

.autopricer-tabs {
    display: flex;
    gap: 8px;
    padding: 0 24px;
    margin-bottom: 0;
}

.autopricer-tab {
    width: auto;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    color: #808080;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.autopricer-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #a0a0a0;
}

.autopricer-tab.active {
    background: #1a1a1a;
    color: #fafafa;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Autopricer Settings Module */
.autopricer-settings-module {
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.settings-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    color: #a0a0a0;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.settings-toggle:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fafafa;
}

.settings-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
}

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

.settings-panel {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.setting-group {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 8px;
}

.setting-group-title {
    font-size: 11px;
    font-weight: 600;
    color: #fafafa;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

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

.setting-row label {
    font-size: 11px;
    color: #808080;
}

.setting-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.setting-input {
    width: 70px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #fafafa;
    font-size: 11px;
    text-align: right;
}

.setting-input:focus {
    outline: none;
    border-color: #ff575f;
}

.setting-unit {
    font-size: 10px;
    color: #606060;
    min-width: 50px;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.settings-btn-primary {
    background: linear-gradient(135deg, #ff575f, #ff3b44);
    color: #fff;
}

.settings-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff6b73, #ff4f57);
    transform: translateY(-1px);
}

.settings-btn-primary:disabled {
    background: rgba(255, 87, 95, 0.3);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
}

.settings-btn-primary.has-changes {
    box-shadow: 0 0 12px rgba(255, 87, 95, 0.4);
}

.settings-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #a0a0a0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fafafa;
}

/* Combined Formula & Settings Panel */
.formula-settings-container {
    padding: 4px 0;
}

.formula-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}

.formula-section-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

.formula-section-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #fafafa;
    margin: 0;
}

.formula-subtitle {
    font-size: 12px;
    color: #808080;
}

.formula-display {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.formula-display code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 12px;
    color: #34d399;
    white-space: nowrap;
}

.formula-inputs-row {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.formula-inputs-row:last-of-type {
    margin-bottom: 0;
}

.formula-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}

.formula-input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #a0a0a0;
}

.condition-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.condition-badge.condition-a {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.condition-badge.condition-b {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.condition-badge.condition-c {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.formula-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.formula-input-wrapper .setting-input {
    width: 80px;
}

.setting-percent {
    font-size: 11px;
    color: #606060;
    min-width: 45px;
}

.formula-input-hint {
    font-size: 10px;
    color: #606060;
    font-style: italic;
}

.formula-note {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 11px;
    color: #606060;
}

.formula-note .note-label {
    color: #808080;
    font-weight: 500;
}

.autopricer-container {
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
}

.autopricer-search-box {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.autopricer-search-box input {
    flex: 1;
    max-width: 500px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fafafa;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.autopricer-search-box input:focus {
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.08);
}

.autopricer-search-box input::placeholder {
    color: #6b7280;
}

.autopricer-table-wrapper {
    background: #1a1a1a;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.autopricer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.autopricer-table thead {
    background: rgba(255, 255, 255, 0.03);
    position: sticky;
    top: 0;
}

.autopricer-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    color: #a0a0a0;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.autopricer-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #fafafa;
}

.autopricer-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.autopricer-table .col-brand {
    font-weight: 600;
    min-width: 100px;
}

.autopricer-table .col-model {
    min-width: 200px;
}

.autopricer-table .col-year {
    text-align: center;
    min-width: 60px;
}

.autopricer-table .col-rrp {
    text-align: right;
    min-width: 80px;
    color: #808080;
}

.autopricer-table .col-grade {
    text-align: center;
    min-width: 60px;
}

.autopricer-table .col-buy {
    text-align: right;
    min-width: 80px;
}

.autopricer-table .col-sell {
    text-align: right;
    min-width: 80px;
    color: #808080;
}

.autopricer-table .buy-a {
    color: #34d399;
    font-weight: 600;
}

.autopricer-table .buy-b {
    color: #60a5fa;
}

.autopricer-table .buy-c {
    color: #f59e0b;
}

/* Grade badges */
.grade-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.grade-a {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.grade-b {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

.grade-c {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* Submissions table specific */
.submissions-table .col-count {
    text-align: center;
    font-weight: 600;
    color: #34d399;
}

.submissions-table .col-price {
    text-align: right;
}

.submissions-table .avg-price {
    color: #34d399;
    font-weight: 600;
}

.submissions-table .min-price {
    color: #808080;
}

.submissions-table .max-price {
    color: #808080;
}

/* Responsive adjustments for report page */
@media (max-width: 768px) {
    .report-grid {
        gap: 16px;
    }

    .report-page-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .report-page-header h1 {
        order: -1;
        width: 100%;
        text-align: center;
    }

    .autopricer-container {
        padding: 16px;
    }

    .autopricer-table {
        font-size: 12px;
    }

    .autopricer-table th,
    .autopricer-table td {
        padding: 8px 6px;
    }
}
