/* Northern Xplorer - Main Stylesheet */

/* ==========================================================================
   Design System - Colors (matching original Streamlit app)
   ========================================================================== */
:root {
    --primary: #0b7470;          /* Company teal */
    --accent-gold: #E8C88A;      /* Warm gold */
    --accent-blue: #3b647c;      /* Dark blue */
    --accent-coral: #FD6D6D;     /* Coral/red for warnings */
    --bg-light: #F1F4F5;         /* Light background */
    --text-dark: #24292c;        /* Primary text */
    --text-muted: #3d4e55;       /* Secondary text */
    --text-light: #8e9aa0;       /* Light gray */

    /* Input styling */
    --input-bg: #FFFDE7;         /* Light yellow for inputs */
    --input-border: #E8E0A8;     /* Yellow border */
    --input-focus: #FFF9C4;      /* Brighter yellow on focus */
}

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

body {
    font-family: 'Century Gothic', 'CenturyGothic', 'AppleGothic', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo-link {
    text-decoration: none;
}
.header-logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 2px;
}

.header-title {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 400;
}

.header-nav {
    display: flex;
    gap: 1.5rem;
}

.header-nav a {
    color: var(--text-dark);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.header-nav a:hover {
    background-color: rgba(10, 186, 181, 0.1);
    color: var(--primary);
}

/* ==========================================================================
   Anchor Bar (Key Metrics Strip)
   ========================================================================== */
.anchor-bar {
    background: linear-gradient(135deg, #1a3a4a 0%, #2a5a6a 100%);
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.anchor-bar-content {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.anchor-group {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.anchor-divider {
    width: 1px;
    align-self: stretch;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 0.75rem;
}

.anchor-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.anchor-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.anchor-value {
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.anchor-subtext {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 1px;
}

.anchor-item.highlight .anchor-value {
    color: var(--primary);
    font-size: 1.15rem;
}

.anchor-item.highlight .anchor-label {
    color: rgba(10, 186, 181, 0.8);
}

/* Responsive: collapse on smaller screens */
@media (max-width: 1200px) {
    .anchor-bar-content {
        gap: 0.3rem;
        padding: 0.4rem 1rem;
    }

    .anchor-group {
        gap: 0.75rem;
    }

    .anchor-item {
        min-width: 65px;
    }

    .anchor-value {
        font-size: 0.9rem;
    }

    .anchor-label {
        font-size: 0.6rem;
    }
}

@media (max-width: 900px) {
    .anchor-bar-content {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 0.5rem 1rem;
    }

    .anchor-divider {
        display: none;
    }

    .anchor-group {
        padding: 0 0.5rem;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    .anchor-group:last-child {
        border-right: none;
    }
}

/* ==========================================================================
   Main Content
   ========================================================================== */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.page-intro {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* ==========================================================================
   Card Grid (for home page)
   ========================================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-dark);
    border-left: 3px solid var(--primary);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   Assumption Sections
   ========================================================================== */
.assumption-section {
    background: white;
    border-radius: 6px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.section-title {
    background: var(--accent-blue);
    color: white;
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.section-title.method1-header {
    background: var(--primary);
}

.section-title.method2-header {
    background: var(--accent-gold);
    color: var(--text-dark);
}

.subsection {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.subsection:last-child {
    border-bottom: none;
}

.subsection-title {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

/* ==========================================================================
   Assumption Tables
   ========================================================================== */
.assumption-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.assumption-table th {
    text-align: left;
    padding: 0.25rem 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.assumption-table td {
    padding: 0.2rem 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    line-height: 1.3;
}

.assumption-table tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.value-col {
    width: 120px;
    text-align: right;
}

.unit-col {
    width: 80px;
}

.value-cell {
    text-align: right;
    font-weight: 500;
    color: var(--accent-blue);
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 3px;
}

.unit-cell {
    color: var(--text-light);
    font-size: 0.8rem;
}

/* ==========================================================================
   Matrix Tables (for maintenance, etc.)
   ========================================================================== */
.matrix-table {
    width: auto;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.matrix-table th {
    text-align: left;
    padding: 0.25rem 1rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.matrix-table td {
    padding: 0.2rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    line-height: 1.3;
}

.matrix-table .value-col {
    width: 80px;
    text-align: right;
}

.matrix-table .value-cell {
    text-align: right;
    font-weight: 500;
    color: var(--accent-blue);
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 3px;
}

/* ==========================================================================
   Pricing & Growth Table (combined view)
   ========================================================================== */
.pricing-growth-table {
    width: auto;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.pricing-growth-table th {
    text-align: left;
    padding: 0.25rem 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.pricing-growth-table td {
    padding: 0.2rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    line-height: 1.3;
}

.pricing-growth-table tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.pricing-growth-table .value-col {
    width: 100px;
    text-align: right;
}

.pricing-growth-table .unit-col {
    width: 70px;
}

.pricing-growth-table .value-cell {
    text-align: right;
    font-weight: 500;
    color: var(--accent-blue);
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 3px;
}

.pricing-growth-table .unit-cell {
    color: var(--text-light);
    font-size: 0.8rem;
}

/* ==========================================================================
   Side-by-Side Layout (for grouped subsections)
   ========================================================================== */
.side-by-side {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.side-by-side-group {
    flex: 1;
    min-width: 280px;
}

.side-by-side-group .assumption-table {
    width: 100%;
}

.group-title {
    color: var(--accent-blue);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.table-note {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Schedule Tables (for ship delivery, etc.)
   ========================================================================== */
.schedule-table {
    width: auto;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.schedule-table th {
    text-align: center;
    padding: 0.25rem 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.schedule-table th:first-child {
    text-align: left;
}

.schedule-table td {
    padding: 0.2rem 0.75rem;
    text-align: center;
    line-height: 1.3;
}

.schedule-table td:first-child {
    text-align: left;
    color: var(--text-dark);
}

.schedule-table .year-col {
    min-width: 50px;
}

.schedule-table .value-cell {
    text-align: center;
    font-weight: 500;
    color: var(--accent-blue);
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 3px;
}

.schedule-table .derived-cell {
    text-align: center;
    font-weight: 500;
    color: var(--text-dark);
}

.schedule-table .separator-row td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.schedule-table .total-row td {
    font-weight: 700;
}

/* ==========================================================================
   Cabin Pricing Matrix (heatmap table)
   ========================================================================== */
.cabin-matrix-container {
    overflow-x: auto;
    margin-top: 0.5rem;
}

.cabin-matrix-table {
    border-collapse: collapse;
    font-size: 0.8rem;
    white-space: nowrap;
}

.cabin-matrix-table th {
    padding: 0.3rem 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
}

.cabin-matrix-table .cabin-col {
    text-align: left;
    min-width: 160px;
}

.cabin-matrix-table .mult-col {
    min-width: 60px;
}

.cabin-matrix-table .info-col {
    min-width: 45px;
    text-align: center;
}

.cabin-matrix-table .month-col {
    min-width: 55px;
}

.cabin-matrix-table .mult-header-row td {
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.cabin-matrix-table .season-mult-cell {
    font-weight: 500;
    color: var(--accent-blue);
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 2px;
}

.cabin-matrix-table td {
    padding: 0.2rem 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    line-height: 1.2;
}

.cabin-matrix-table .cabin-name-cell {
    text-align: left;
    color: var(--text-dark);
    font-weight: 500;
}

.cabin-matrix-table .info-cell {
    text-align: center;
    color: var(--text-muted);
}

.cabin-matrix-table .cabin-mult-cell {
    text-align: center;
    font-weight: 500;
    color: var(--accent-blue);
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 2px;
}

.cabin-matrix-table .price-cell {
    text-align: right;
    font-weight: 500;
    color: var(--text-dark);
    /* Background color set via inline style for heatmap */
}

.cabin-matrix-table tbody tr:hover {
    outline: 1px solid var(--primary);
}

.cabin-matrix-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.color-scale-legend {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding-top: 2.5rem; /* Align with table body */
}

.color-scale-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 0.25rem;
}

.color-scale-item {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 500;
    text-align: right;
    border-radius: 2px;
    color: var(--text-dark);
}

/* ==========================================================================
   CapEx Three-Column Layout
   ========================================================================== */
.capex-three-columns {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.capex-column {
    flex: 1;
    min-width: 200px;
}

.capex-column .group-title {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.capex-column .assumption-table {
    width: 100%;
}

.capex-column .assumption-table td {
    padding: 0.15rem 0.5rem;
    font-size: 0.85rem;
}

.capex-column .assumption-table .value-cell {
    width: 70px;
}

.capex-column .assumption-table .unit-cell {
    width: 60px;
}

/* ==========================================================================
   Capital Structure Three-Column Layout
   ========================================================================== */
.capstruct-three-columns {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.capstruct-column {
    flex: 1;
    min-width: 220px;
}

.capstruct-column .group-title {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.capstruct-column .assumption-table {
    width: 100%;
}

.capstruct-column .assumption-table td {
    padding: 0.15rem 0.5rem;
    font-size: 0.85rem;
}

.capstruct-column .assumption-table .value-cell {
    width: 70px;
}

.capstruct-column .assumption-table .unit-cell {
    width: 60px;
}

/* ==========================================================================
   OPEX Three-Column Layout
   ========================================================================== */
.opex-three-columns {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.opex-column {
    flex: 1;
    min-width: 280px;
}

.opex-column-title {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    text-align: center;
}

.opex-column-title.variable {
    background-color: rgba(72, 166, 167, 0.15);
    color: #2A8A8B;
}

.opex-column-title.semi-fixed {
    background-color: rgba(232, 200, 138, 0.25);
    color: #9A7B2D;
}

.opex-column-title.fixed {
    background-color: rgba(50, 109, 142, 0.15);
    color: var(--accent-blue);
}

.opex-group {
    margin-bottom: 1rem;
}

.opex-group .group-title {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.opex-group .assumption-table {
    width: 100%;
}

.opex-group .assumption-table td {
    padding: 0.15rem 0.5rem;
    font-size: 0.85rem;
}

.opex-group .assumption-table .value-cell {
    width: 70px;
}

.opex-group .assumption-table .unit-cell {
    width: 60px;
}

/* ==========================================================================
   Financial Statement Tables
   ========================================================================== */
.statement-section {
    background: white;
    border-radius: 6px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.statement-table-container {
    overflow-x: auto;
    padding: 1rem 1.5rem;
}

.statement-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    white-space: nowrap;
}

.statement-table th {
    text-align: right;
    padding: 0.1rem 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.statement-table th.label-col {
    text-align: left;
    min-width: 200px;
}

.statement-table th.year-col {
    min-width: 70px;
}

.statement-table td {
    padding: 0.05rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.statement-table .label-cell {
    text-align: left;
    color: var(--text-dark);
}

.statement-table .value-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text-dark);
    background-color: transparent;
    border: none;
}

.statement-table .section-header-row td {
    background: rgba(50, 109, 142, 0.08);
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.15rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.statement-table .total-row td {
    font-weight: 600;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.statement-table .total-row .total-cell {
    color: var(--accent-blue);
}

.statement-table .pct-row td {
    font-style: italic;
    color: var(--text-light);
    font-size: 0.8rem;
    border-top: none;
    padding-top: 0;
}

.statement-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.statement-table tbody tr.section-header-row:hover {
    background: rgba(50, 109, 142, 0.08);
}

.statement-table tbody tr.spacer-row td {
    padding: 0.15rem 0;
    border: none;
}

/* Fleet info table */
.fleet-info-container {
    padding: 0 1.5rem 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

.fleet-table {
    width: auto;
}

.fleet-table .label-cell {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.fleet-table .value-cell {
    color: var(--primary);
    font-weight: 600;
}

/* Fleet info header (at top of each statement) */
.fleet-info-header {
    background: rgba(0, 0, 0, 0.04);
    padding: 0.25rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.fleet-info-header table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.fleet-info-header td {
    padding: 0.1rem 0.75rem;
}

.fleet-info-header .label-cell {
    text-align: left;
    color: var(--text-muted);
    min-width: 200px;
}

.fleet-info-header .value-cell {
    text-align: right;
    color: var(--primary);
    font-weight: 600;
    min-width: 70px;
    background-color: transparent;
    border: none;
}

/* Negative values styling */
.statement-table .value-cell.negative {
    color: var(--accent-coral);
}

/* ==========================================================================
   Page Header with Actions
   ========================================================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    margin-bottom: 0.25rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modified-indicator {
    font-size: 0.85rem;
    color: var(--accent-blue);
    background: rgba(50, 109, 142, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-secondary {
    background: var(--bg-medium);
    color: var(--text-dark);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Reference Guide Button & Panel
   ========================================================================== */
.btn-outline {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
    padding: 0.4rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: var(--accent-blue);
    color: white;
}

.btn-outline.active {
    background: var(--accent-blue);
    color: white;
}

.reference-panel {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin: 0 0 2rem 0;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.reference-panel-header {
    padding: 1.5rem 2rem 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.reference-panel-header h2 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.reference-panel-header p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.reference-panel-content {
    padding: 1rem 2rem 1.5rem;
}

.reference-section {
    margin-bottom: 1.5rem;
}

.reference-section h3 {
    font-size: 0.95rem;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.reference-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
    table-layout: fixed;
}

.reference-table thead th {
    background: var(--bg-light);
    padding: 0.4rem 0.6rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

/* Fixed column widths for consistent alignment across all tables */
.reference-table thead th:nth-child(1) { width: 22%; }
.reference-table thead th:nth-child(2) { width: 14%; }
.reference-table thead th:nth-child(3) { width: 12%; }
.reference-table thead th:nth-child(4) { width: 40%; }
.reference-table thead th:nth-child(5) { width: 12%; }

.reference-table tbody td {
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    vertical-align: middle;
}

.reference-table tbody tr:hover {
    background: rgba(10, 186, 181, 0.04);
}

.ref-key-cell code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.76rem;
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    display: inline-block;
    letter-spacing: 0.02em;
}

.ref-default-cell {
    font-weight: 600;
    white-space: nowrap;
}

.ref-unit-cell {
    color: var(--text-light);
    white-space: nowrap;
}

.ref-desc-cell {
    color: var(--text-muted);
}

.ref-ref-cell {
    color: var(--text-light);
    font-style: italic;
    min-width: 80px;
}

/* ==========================================================================
   Inline Editing
   ========================================================================== */
.value-cell.editable {
    cursor: pointer;
    transition: outline 0.15s ease;
}

.value-cell.editable:hover {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.inline-edit {
    width: 100%;
    padding: 0.15rem 0.35rem;
    border: 2px solid var(--primary);
    border-radius: 3px;
    background: var(--input-focus);
    font-size: inherit;
    font-weight: inherit;
    font-family: inherit;
    text-align: right;
    outline: none;
}

.inline-edit:focus {
    background: #fff;
}

.value-cell.modified {
    background-color: #E8F5E9 !important;
    border-color: #A5D6A7 !important;
}

.value-cell.derived {
    background-color: #ECEFF1 !important;
    cursor: not-allowed;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    text-align: center;
    padding: 1rem;
    color: var(--text-light);
    font-size: 0.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   Dashboard Home Page
   ========================================================================== */
.dashboard-header {
    margin-bottom: 1.5rem;
}

.dashboard-header h1 {
    font-size: 1.6rem;
    margin-bottom: 0.25rem;
}

.dashboard-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Navigation Cards */
.nav-card-grid {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.nav-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-dark);
    border-left: 3px solid var(--primary);
    transition: box-shadow 0.2s, transform 0.2s;
}

.nav-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.nav-card-icon {
    font-size: 1.8rem;
    color: var(--primary);
    opacity: 0.8;
}

.nav-card-content h3 {
    font-size: 1rem;
    margin-bottom: 0.15rem;
    color: var(--primary);
}

.nav-card-content p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* Charts Section - 2x2 Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Chart Card */
.chart-card {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.chart-card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

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

.chart-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chart-year-select {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    background: white;
    color: var(--text-dark);
    cursor: pointer;
}

.chart-year-select:focus {
    outline: none;
    border-color: var(--primary);
}

.chart-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.chart-download-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(10, 186, 181, 0.05);
}

/* Chart toggle (expand/collapse) button */
.chart-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.chart-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(10, 186, 181, 0.05);
}

.chart-toggle-btn svg {
    transition: transform 0.2s ease;
}

/* Fullscreen chart overlay */
.chart-fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: white;
    margin: 0 !important;
    border-radius: 0 !important;
    padding: 1rem 1.5rem;
    display: flex !important;
    flex-direction: column;
}

.chart-fullscreen .chart-container,
.chart-fullscreen .statement-chart,
.chart-fullscreen .tornado-chart-container {
    flex: 1;
    height: auto !important;
    padding-bottom: 0 !important;
    position: relative;
}

.chart-fullscreen .chart-container canvas,
.chart-fullscreen .statement-chart canvas,
.chart-fullscreen .tornado-chart-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Chart container with 16:9 aspect ratio */
.chart-container {
    padding: 0.5rem 1rem 1rem 1rem;
    /* 16:9 aspect ratio = 56.25% padding-top trick, but using fixed height for Chart.js */
    height: 0;
    padding-bottom: 56.25%; /* 16:9 ratio */
    position: relative;
}

.chart-container canvas {
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
}

/* Responsive Chart Layout */
@media (max-width: 900px) {
    .nav-card-grid {
        flex-direction: column;
    }

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

    .chart-container {
        padding-bottom: 60%; /* Slightly taller on mobile */
    }
}

/* ==========================================================================
   Statement Embedded Charts
   ========================================================================== */
.statement-charts-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.statement-charts-row .statement-chart-container {
    border-top: none;
}

.statement-charts-row .statement-chart-container:first-child {
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

/* 16:9 aspect ratio for charts in row layout */
.statement-charts-row .statement-chart {
    height: 0;
    padding-bottom: 56.25%; /* 16:9 ratio */
    position: relative;
}

.statement-charts-row .statement-chart canvas {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

@media (max-width: 900px) {
    .statement-charts-row {
        grid-template-columns: 1fr;
    }

    .statement-charts-row .statement-chart-container:first-child {
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }
}

.statement-chart-container {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.01);
}

.statement-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.statement-chart-header .chart-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.statement-chart {
    height: 220px;
    position: relative;
}

@media (max-width: 900px) {
    .statement-chart {
        height: 200px;
    }
}

.chart-footnote {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0 0;
    font-style: italic;
}

/* ==========================================================================
   DCF Valuation Summary
   ========================================================================== */
.valuation-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    padding: 1rem 1.5rem 1.5rem;
}

@media (max-width: 1200px) {
    .valuation-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .valuation-summary-grid {
        grid-template-columns: 1fr;
    }
}

.valuation-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    padding: 1rem;
}

.valuation-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.valuation-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.valuation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0;
}

.valuation-row.sub-row {
    padding-left: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.valuation-row.total-row {
    margin-top: 0.35rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.valuation-row.separator {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 0.35rem 0;
}

.valuation-label {
    font-size: 0.8rem;
    color: var(--text-dark);
}

.valuation-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
    font-variant-numeric: tabular-nums;
}

.valuation-value.highlight {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.valuation-value.highlight-alt {
    color: var(--gold);
    font-weight: 600;
    font-size: 0.95rem;
}

.valuation-row.net-cash .valuation-value {
    color: var(--primary);
    font-weight: 500;
}

/* ==========================================================================
   Sensitivity Analysis Page
   ========================================================================== */

/* Tornado Chart Container */
.tornado-chart-container {
    padding: 1.5rem;
    min-height: 350px;
    position: relative;
}

.tornado-chart-container canvas {
    max-height: 400px;
}

.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
    padding: 0 1.5rem;
}

/* Base Case Summary Grid */
.base-case-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem 1.5rem 1.5rem;
}

@media (max-width: 900px) {
    .base-case-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .base-case-grid {
        grid-template-columns: 1fr;
    }
}

.base-case-card {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
}

.base-case-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.base-case-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

/* Sensitivity Table Styling */
.sensitivity-table {
    font-size: 0.85rem;
}

.sensitivity-table th.base-col,
.sensitivity-table td.base-value {
    background: rgba(0, 0, 0, 0.02);
    font-weight: 500;
}

.sensitivity-table th.var-col {
    font-weight: 600;
    font-size: 0.8rem;
}

.sensitivity-table th.negative-var {
    color: var(--coral);
}

.sensitivity-table th.positive-var {
    color: var(--primary);
}

.sensitivity-table td.var-negative {
    background: rgba(253, 109, 109, 0.08);
}

.sensitivity-table td.var-positive {
    background: rgba(10, 186, 181, 0.08);
}

/* ==========================================================================
   Scenario Comparison Page
   ========================================================================== */

.scenarios-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.scenarios-header h1 {
    margin-bottom: 0.25rem;
}

/* Scenario comparison table */
.scenarios-table th.scenario-col,
.scenarios-table td.scenario-col {
    min-width: 120px;
    text-align: right;
}

.scenarios-table th.current-col,
.scenarios-table td.current-col {
    background: rgba(10, 186, 181, 0.08);
    font-weight: 500;
}

/* Scenarios grid */
.scenarios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem 1.5rem 1.5rem;
}

.scenario-card {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    padding: 1rem;
}

.scenario-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.scenario-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.scenario-actions {
    display: flex;
    gap: 0.25rem;
}

.scenario-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 0.75rem 0;
}

.scenario-metrics-preview {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.metric-preview {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.metric-preview .metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.metric-preview .metric-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
    font-variant-numeric: tabular-nums;
}

.metric-preview .metric-value.highlight {
    color: var(--primary);
    font-weight: 600;
}

.scenario-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

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

.btn-primary:hover {
    background: #099b97;
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(10, 186, 181, 0.05);
}

.btn-icon.btn-danger:hover {
    border-color: var(--coral);
    color: var(--coral);
    background: rgba(253, 109, 109, 0.05);
}

/* Empty state */
.empty-state {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

/* Work in Progress notice */
.wip-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    color: #856404;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 8px;
    width: 100%;
    max-width: 450px;
    margin: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

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

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Form elements */
.form-group {
    margin-bottom: 1rem;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.35rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    background: white;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

/* =============================================================================
   CAP TABLE PAGE
   ============================================================================= */

/* Exit Controls */
.exit-controls {
    margin-bottom: 1.5rem;
    margin-left: 1.5rem;
}

.exit-form {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.control-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
}

.control-group select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.9rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    background: white;
    cursor: pointer;
    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='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.control-group select.assumption-select {
    background: var(--input-bg) 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='%23326D8E' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
    border-color: var(--input-border);
    font-weight: 500;
    color: var(--accent-blue);
}

.control-group select.assumption-select:hover {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.control-group select.assumption-select:focus {
    background: var(--input-focus) 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='%23326D8E' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
    border-color: var(--primary);
}

.control-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Exit Summary */
.exit-summary {
    padding: 0.5rem 0;
    max-width: 350px;
    margin-left: 1.5rem;
}

.exit-calc {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.exit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.1rem 0;
}

.exit-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.exit-value {
    font-size: 0.9rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.exit-value.negative {
    color: var(--coral);
}

.exit-value.positive {
    color: var(--teal);
}

.exit-row.exit-subtotal {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
}

.exit-row.exit-total {
    border-top: 2px solid var(--text-dark);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.exit-row.exit-total .exit-label {
    font-weight: 600;
    color: var(--text-dark);
}

.exit-row.exit-total .exit-value.highlight {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--teal);
}

/* Cap Table exit row */
.cap-table tr.ct-exit-row td {
    border-top: 2px solid var(--text-dark);
    font-weight: 600;
}

/* Modified assumption select (green when user changed) */
.control-group select.assumption-select.modified {
    background: #E8F5E9 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='%23326D8E' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
    border-color: #A5D6A7;
}

/* Cap Table editable assumption cells */
.cap-table .value-cell.ct-editable {
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 3px;
    color: var(--accent-blue);
    font-weight: 500;
    cursor: pointer;
    transition: outline 0.15s ease;
}

.cap-table .value-cell.ct-editable:hover {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

/* Grey text for reference/comparison values */
.cap-table .value-cell.text-muted {
    color: #999;
}

.cap-table .font-bold {
    font-weight: 600;
}

/* Cap Table specific table styles */
.cap-table {
    font-size: 0.85rem;
}

.cap-table th {
    font-size: 0.8rem;
    white-space: nowrap;
}

.cap-table .value-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.cap-table .value-cell.highlight {
    color: var(--teal);
    font-weight: 600;
}

/* Subsection title */
.subsection-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 1.5rem 0 0.75rem 0;
    padding-left: 1.5rem;
}

.subsection-title:first-of-type {
    margin-top: 0;
}

/* Investor Returns Table */
.investor-returns-table .category-row {
    background: var(--bg-light);
}

.investor-returns-table .category-cell {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.5rem 0.75rem;
}

.investor-returns-table .label-cell.indent {
    padding-left: 1.5rem;
}

.investor-returns-table .total-row {
    border-top: 2px solid var(--text-dark);
    font-weight: 600;
}

.investor-returns-table .total-row .label-cell {
    font-weight: 700;
}

/* Method 2 Grid */
.method2-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.method2-section {
    min-width: 0;
}

/* Method 2 Summary */
.method2-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    font-variant-numeric: tabular-nums;
}

/* Method Note */
.method-note {
    background: rgba(0, 140, 140, 0.05);
    border-left: 3px solid var(--teal);
}

.method-note h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.method-note p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.method-note p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Two-Way Sensitivity Tables
   ========================================================================== */
.two-way-table-container {
    padding: 1rem 1.5rem 1.5rem;
}

.two-way-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.two-way-table th,
.two-way-table td {
    text-align: center;
    padding: 0.4rem 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.two-way-corner {
    background: var(--bg);
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.two-way-col-header,
.two-way-row-header {
    background: var(--bg);
    font-weight: 500;
    white-space: nowrap;
}

.two-way-header-val {
    display: block;
    font-size: 0.78rem;
    color: var(--text-dark);
}

.two-way-header-pct {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.two-way-base-header {
    background: rgba(0, 150, 136, 0.08);
    font-weight: 600;
}

.two-way-cell {
    font-weight: 500;
    font-size: 0.78rem;
    transition: transform 0.1s;
}

.two-way-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 0 4px rgba(0,0,0,0.15);
    z-index: 1;
    position: relative;
}

.two-way-base-cell {
    font-weight: 700;
    border: 2px solid var(--primary) !important;
}

@media (max-width: 900px) {
    .two-way-table {
        font-size: 0.7rem;
    }

    .two-way-table th,
    .two-way-table td {
        padding: 0.3rem 0.35rem;
    }

    .two-way-header-val {
        font-size: 0.68rem;
    }
}
