/* Vendor Database Styles */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --border-radius: 0.5rem;
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: transparent;
    color: var(--text-primary);
    line-height: 1.6;
}

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

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.logo p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    transition: all 0.2s;
    font-weight: 500;
}

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

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

.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
}

.loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Controls Panel */
.controls-panel {
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filters {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    min-width: 150px;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.1);
}

/* Executive Summary */
.executive-summary {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.executive-summary h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.summary-content p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

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

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

/* Vendors Table */
.vendors-table-container {
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.vendors-table th,
.vendors-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.vendors-table th {
    background-color: var(--background);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.vendors-table tbody tr {
    cursor: pointer;
    transition: background-color 0.2s;
}

.vendors-table tbody tr:hover {
    background-color: var(--background);
}

/* Score Bars */
.score-bar {
    width: 60px;
    height: 20px;
    background-color: var(--border);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.score-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.score-fill.excellent { background-color: var(--success-color); }
.score-fill.good { background-color: #22c55e; }
.score-fill.fair { background-color: var(--warning-color); }
.score-fill.poor { background-color: var(--danger-color); }

/* Risk Badges */
.risk-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.125rem;
}

.risk-badge.high {
    background-color: #fee2e2;
    color: #dc2626;
}

.risk-badge.medium {
    background-color: #fef3c7;
    color: #d97706;
}

.risk-badge.low {
    background-color: #dcfce7;
    color: #16a34a;
}

/* Summary chip for collapsed non-high flags */
.risk-badge.summary {
    background-color: #e0e7ff;
    color: #3730a3;
}

/* Extra small secondary button for toggling flags in modal */
.btn.btn-secondary.btn-xs {
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    margin-left: 0.375rem;
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.status-indicator.fresh {
    background-color: #dcfce7;
    color: #16a34a;
}

.status-indicator.stale {
    background-color: #fef3c7;
    color: #d97706;
}

/* Analytics View */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.chart-container {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.chart-container h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.kpi-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.kpi-card h4 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Settings View */
.settings-panel {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 600px;
}

.settings-panel h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.settings-panel p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.weight-controls {
    margin-bottom: 2rem;
}

.weight-slider {
    margin-bottom: 1.5rem;
}

.weight-slider label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    outline: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: var(--shadow);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow);
}

.weight-total {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 1rem;
    background: var(--background);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.settings-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

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

.modal-body {
    padding: 2rem;
}

.vendor-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.vendor-info,
.score-breakdown,
.historical-trend,
.risk-flags,
.parts-list {
    background: var(--background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.vendor-info h3,
.score-breakdown h3,
.historical-trend h3,
.risk-flags h3,
.parts-list h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.info-grid {
    display: grid;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-item label {
    font-weight: 500;
    color: var(--text-secondary);
}

.risk-flags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.parts-list {
    grid-column: 1 / -1;
}

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

.parts-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.parts-table th,
.parts-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.parts-table th {
    background-color: var(--surface);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Status Messages */
.status-messages {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-message {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

.status-message.success {
    background-color: var(--success-color);
}

.status-message.error {
    background-color: var(--danger-color);
}

.status-message.warning {
    background-color: var(--warning-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

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

    .filter-group select,
    .filter-group input {
        min-width: auto;
    }

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

    .vendors-table {
        min-width: 800px;
    }

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

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

    .vendor-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.font-bold {
    font-weight: 700;
}

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

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

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

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

/* Scoring Interface (PDF Page 11 Style) */
.scoring-interface {
    margin-bottom: 2rem;
}

.scoring-panel {
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.scoring-panel h3 {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    padding: 1rem 1.5rem;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scoring-help {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 1rem 1.5rem;
    margin: 0 1.5rem 1.5rem 1.5rem;
}

.scoring-help p {
    margin: 0;
    color: #1e40af;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scoring-controls {
    padding: 1.5rem;
}

.weight-sliders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.weight-control {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.weight-control label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weight-tooltip {
    position: relative;
    color: var(--text-secondary);
    cursor: help;
    font-size: 0.8rem;
}

.weight-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: normal;
    line-height: 1.4;
    white-space: normal;
    width: 250px;
    text-align: left;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    text-transform: none;
    letter-spacing: normal;
}

.weight-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 94%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--text-primary);
    z-index: 1001;
}

.weight-slider,
.form-range {
    -webkit-appearance: none !important;
    appearance: none !important;
    height: 8px !important;
    background: linear-gradient(to right, #64748b 0%, #64748b 100%) !important;
    border-radius: 4px !important;
    outline: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.weight-slider::-webkit-slider-thumb,
.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.weight-slider::-webkit-slider-thumb:hover,
.form-range::-webkit-slider-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.weight-slider::-moz-range-thumb,
.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.weight-slider::-moz-range-thumb:hover,
.form-range::-moz-range-thumb:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.weight-display {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    text-align: center;
    background: #f1f5f9;
    padding: 0.5rem;
    border-radius: 4px;
    min-width: 60px;
}

.scoring-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.last-updated {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

#last-updated-time {
    font-weight: 600;
    color: var(--text-primary);
}

/* Responsive adjustments for scoring interface */
@media (max-width: 768px) {
    .weight-sliders-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .scoring-actions {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .scoring-actions .btn {
        width: 100%;
    }
}

/* Methodology Guide Styles */
.methodology-guide {
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 2rem;
}

.methodology-guide h3 {
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    padding: 1rem 1.5rem;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.methodology-content {
    padding: 1.5rem;
}

.methodology-intro {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.calculation-formula {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.calculation-formula h4 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.formula-display {
    font-size: 1.1rem;
    line-height: 1.6;
}

.formula-term {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.9rem;
    margin: 0.125rem;
    display: inline-block;
}

.dimensions-breakdown {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dimension-item {
    background: #f1f5f9;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

.dimension-item h5 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dimension-item p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.dimension-item small {
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.5;
}

.additional-metrics {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.additional-metrics h4 {
    color: #ea580c;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.derived-metric {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #fed7aa;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.derived-metric:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Calculation Examples Modal Styles */
.calculation-examples {
    max-height: 70vh;
    overflow-y: auto;
}

.example-vendor {
    background: var(--background);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.example-vendor h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.example-breakdown {
    display: grid;
    gap: 1.25rem;
}

.dimension-calculation {
    background: var(--surface);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border);
}

.dimension-calculation h5 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.dimension-calculation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dimension-calculation li {
    padding: 0.375rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    line-height: 1.5;
}

.dimension-calculation li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.final-calculation {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border: 2px solid #16a34a;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}

.final-calculation h5 {
    color: #15803d;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.final-calculation p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.archetype-note {
    color: #059669;
    font-style: italic;
    font-size: 0.9rem !important;
    margin-bottom: 0 !important;
}

.calculation-notes {
    background: #fffbeb;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.calculation-notes h4 {
    color: #ea580c;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.calculation-notes ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin: 0;
}

.calculation-notes li {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.calculation-notes li:last-child {
    margin-bottom: 0;
}

/* Settings View Calculation Methodology */
.calculation-methodology {
    background: var(--background);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid var(--border);
}

.calculation-methodology h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.methodology-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.methodology-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.methodology-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.methodology-detail p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.formula-box {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
    font-size: 1rem;
    line-height: 1.5;
}

.dimension-details {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.dimension-detail {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
}

.dimension-detail h5 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.dimension-detail ul {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem 0;
}

.dimension-detail li {
    padding: 0.25rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.dimension-detail li:last-child {
    border-bottom: none;
}

.calculation-example {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.9rem;
    color: #15803d;
    font-weight: 500;
    margin-bottom: 0 !important;
}

.scoring-factors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.factor-detail {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
}

.factor-detail h5 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.factor-detail p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.5;
}

.archetype-ranges {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.archetype-range {
    border-radius: 8px;
    padding: 1.25rem;
    border-left: 4px solid;
}

.archetype-range.strategic {
    background: #f0fdf4;
    border-left-color: #22c55e;
}

.archetype-range.leverage {
    background: #eff6ff;
    border-left-color: #3b82f6;
}

.archetype-range.bottleneck {
    background: #fffbeb;
    border-left-color: #f59e0b;
}

.archetype-range.routine {
    background: #f1f5f9;
    border-left-color: #64748b;
}

.archetype-range h5 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.archetype-range p {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Responsive adjustments for methodology */
@media (max-width: 768px) {
    .methodology-content {
        padding: 1rem;
    }
    
    .formula-display {
        font-size: 1rem;
    }
    
    .formula-term {
        font-size: 0.8rem;
        margin: 0.25rem 0.125rem;
    }
    
    .dimension-item {
        padding: 0.75rem;
    }
    
    .example-vendor {
        padding: 1rem;
    }
    
    .calculation-examples {
        max-height: 60vh;
    }
    
    .calculation-methodology {
        padding: 1rem;
    }
    
    .scoring-factors {
        grid-template-columns: 1fr;
    }
    
    .formula-box {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
}