/* ========================================
   Recess in the Neighborhood - Financial Calculator
   Brand Style Guide Implementation
   ======================================== */

/* CSS Variables - Brand Colors */
:root {
    /* Primary Colors */
    --rich-teal: #2A7C7C;
    --rich-teal-dark: #1F5F5F;
    --rich-teal-light: #3A9A9A;
    --warm-sand: #E8D5B7;
    --warm-sand-light: #F2E6D4;
    
    /* Accent Colors */
    --paprika: #D45B3A;
    --paprika-dark: #B84A2D;
    --paprika-light: #E87B5E;
    --soft-lavender: #B8A5C9;
    --soft-lavender-light: #D4C8E0;
    
    /* Neutral Colors */
    --natural-linen: #F5F0E8;
    --warm-slate: #4A4A4A;
    --warm-slate-light: #6A6A6A;
    
    /* Functional Colors */
    --success: #4CAF50;
    --warning: #FF9800;
    --error: #F44336;
    
    /* Shadows & Effects */
    --shadow-sm: 0 2px 4px rgba(74, 74, 74, 0.1);
    --shadow-md: 0 4px 12px rgba(74, 74, 74, 0.12);
    --shadow-lg: 0 8px 24px rgba(74, 74, 74, 0.15);
    --shadow-card: 0 2px 8px rgba(42, 124, 124, 0.1);
    
    /* Typography */
    --font-heading: 'Josefin Sans', sans-serif;
    --font-body: 'Nunito Sans', sans-serif;
    --font-accent: 'Cabin', sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--natural-linen) 0%, var(--warm-sand-light) 100%);
    color: var(--warm-slate);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========================================
   App Container
   ======================================== */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg);
    padding-bottom: var(--space-2xl);
}

/* ========================================
   Header
   ======================================== */
.header {
    text-align: center;
    padding: var(--space-xl) 0;
    margin-bottom: var(--space-xl);
    background: linear-gradient(135deg, var(--rich-teal) 0%, var(--rich-teal-dark) 100%);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-bottom: var(--space-lg);
    position: relative;
    z-index: 1;
}

.logo-recess {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--paprika);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 2px;
}

.logo-in-the {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin: -0.25rem 0;
}

.logo-neighborhood {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
    letter-spacing: 1px;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--warm-sand);
    margin-bottom: var(--space-xs);
    position: relative;
    z-index: 1;
}

.page-subtitle {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 1;
}

/* ========================================
   Global Summary Dashboard
   ======================================== */
.global-summary {
    margin-bottom: var(--space-xl);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--rich-teal);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-md);
}

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

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

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

.summary-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    border-left: 4px solid transparent;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-card.revenue {
    border-left-color: var(--success);
}

.summary-card.costs {
    border-left-color: var(--paprika);
}

.summary-card.profit {
    border-left-color: var(--rich-teal);
}

.summary-card.margin {
    border-left-color: var(--soft-lavender);
}

.summary-card.capital {
    border-left-color: var(--warm-sand);
}

.card-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.card-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card-label {
    font-family: var(--font-accent);
    font-size: 0.8rem;
    color: var(--warm-slate-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}

.card-value {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--warm-slate);
    line-height: 1.2;
}

.card-period {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--warm-slate-light);
    margin-top: var(--space-xs);
}

/* ========================================
   Main Navigation Tabs
   ======================================== */
.main-nav {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    background: white;
    padding: var(--space-sm);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.nav-tab {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-sm);
    background: transparent;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: var(--font-body);
}

.nav-tab:hover {
    background: var(--natural-linen);
    border-color: var(--warm-sand);
}

.nav-tab.active {
    background: linear-gradient(135deg, var(--rich-teal) 0%, var(--rich-teal-dark) 100%);
    border-color: var(--rich-teal);
    color: white;
}

.tab-icon {
    font-size: 1.25rem;
}

.tab-label {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-total {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
}

.nav-tab.active .tab-label,
.nav-tab.active .tab-total {
    color: white;
}

/* ========================================
   Content Sections
   ======================================== */
.main-content {
    position: relative;
}

.content-section {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.content-section.active {
    display: block;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--rich-teal);
}

.section-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-reset {
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: var(--space-sm) var(--space-md);
    background: white;
    border: 2px solid var(--warm-sand);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--warm-slate);
}

.btn-reset:hover {
    background: var(--warm-sand);
    border-color: var(--rich-teal);
}

.section-total {
    background: linear-gradient(135deg, var(--rich-teal) 0%, var(--rich-teal-dark) 100%);
    color: white;
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-md);
}

.total-label {
    font-family: var(--font-accent);
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.total-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
}

/* ========================================
   Items Grid
   ======================================== */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

@media (max-width: 720px) {
    .items-grid {
        grid-template-columns: 1fr;
    }
}

.item-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.item-card:hover {
    border-color: var(--warm-sand);
    box-shadow: var(--shadow-md);
}

.item-card.dirty {
    border-color: var(--paprika);
    box-shadow: 0 0 0 3px rgba(212, 91, 58, 0.15);
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.item-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--warm-slate);
}

.item-value {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rich-teal);
    white-space: nowrap;
}

.item-description {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--warm-slate-light);
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

/* ========================================
   Slider & Input Styles
   ======================================== */
.slider-group {
    margin-top: var(--space-md);
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--warm-sand), var(--rich-teal));
    outline: none;
    -webkit-appearance: none;
    margin-bottom: var(--space-sm);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--rich-teal);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--rich-teal);
    cursor: pointer;
    border: 3px solid white;
    box-shadow: var(--shadow-sm);
}

.input-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.input-label {
    font-family: var(--font-accent);
    font-size: 0.9rem;
    color: var(--warm-slate-light);
    font-weight: 500;
}

.number-input {
    flex: 1;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--warm-sand);
    border-radius: var(--radius-sm);
    background: var(--natural-linen);
    color: var(--warm-slate);
    transition: border-color var(--transition-fast);
    max-width: 160px;
}

.number-input:focus {
    outline: none;
    border-color: var(--rich-teal);
    background: white;
}

/* ========================================
   Formula Inputs (Revenue Section)
   ======================================== */
.formula-inputs {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--natural-linen);
    border-radius: var(--radius-md);
}

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

.input-group label {
    font-family: var(--font-accent);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--warm-slate-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.input-group .slider {
    margin-bottom: var(--space-xs);
}

.input-group .number-input {
    max-width: 100%;
}

.formula-display {
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: rgba(42, 124, 124, 0.08);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--rich-teal);
}

.formula {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    color: var(--rich-teal);
}

/* ========================================
   Management & Facility Breakdown
   ======================================== */
.management-roles,
.facility-breakdown {
    margin: var(--space-md) 0;
    padding: var(--space-md);
    background: var(--natural-linen);
    border-radius: var(--radius-md);
}

.role-item,
.facility-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--warm-sand);
}

.role-item:last-child,
.facility-item:last-child {
    border-bottom: none;
}

.role-name,
.facility-name {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--warm-slate);
}

.role-cost,
.facility-cost {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--rich-teal);
}

/* ========================================
   Apply Bar
   ======================================== */
.apply-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    bottom: var(--space-lg);
}

.pending-indicator {
    font-family: var(--font-accent);
    font-size: 0.9rem;
    color: var(--paprika);
    font-weight: 500;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.pending-indicator.visible {
    opacity: 1;
}

.btn-apply {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    padding: var(--space-md) var(--space-xl);
    background: linear-gradient(135deg, var(--paprika) 0%, var(--paprika-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--paprika-light) 0%, var(--paprika) 100%);
}

.btn-apply:active {
    transform: translateY(0);
}

.btn-apply:disabled {
    background: var(--warm-sand);
    color: var(--warm-slate-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    text-align: center;
    padding: var(--space-xl) 0;
    margin-top: var(--space-xl);
    border-top: 2px solid var(--warm-sand);
}

.footer p {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--warm-slate-light);
    margin-bottom: var(--space-xs);
}

.footer-note {
    font-family: var(--font-accent);
    font-size: 0.8rem;
    color: var(--warm-slate-light);
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
    .app-container {
        padding: var(--space-md);
    }
    
    .header {
        padding: var(--space-lg);
    }
    
    .logo-recess {
        font-size: 2rem;
    }
    
    .logo-neighborhood {
        font-size: 1.4rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .summary-card {
        padding: var(--space-md);
    }
    
    .card-value {
        font-size: 1.25rem;
    }
    
    .main-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tab {
        min-width: 100px;
        padding: var(--space-sm);
    }
    
    .tab-label {
        font-size: 0.75rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .section-total {
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
    }
    
    .total-value {
        font-size: 1.75rem;
    }
    
    .apply-bar {
        flex-direction: column;
        gap: var(--space-md);
        bottom: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .main-nav,
    .apply-bar,
    .btn-reset,
    .slider,
    .number-input {
        display: none;
    }
    
    .content-section {
        display: block !important;
        page-break-inside: avoid;
    }
    
    .item-card {
        break-inside: avoid;
    }
}

/* ========================================
   Accessibility Improvements
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.nav-tab:focus-visible,
.btn-reset:focus-visible,
.btn-apply:focus-visible,
.number-input:focus-visible {
    outline: 3px solid var(--soft-lavender);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .item-card {
        border: 2px solid var(--warm-slate);
    }
    
    .slider {
        background: var(--warm-slate);
    }
}

/* ========================================
   Sub-Calculation Styles (CR-001)
   ======================================== */

/* Sub-calculation group (parent container like "Staffing") */
.sub-calc-group {
    background: rgba(42, 124, 124, 0.04);
    border-left: 3px solid var(--rich-teal);
    margin: var(--space-md) 0;
    padding: var(--space-md);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.sub-calc-group .group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-accent);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--warm-slate-light);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sub-calc-group .group-total {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--rich-teal);
}

.sub-calc-group .sub-calc-description {
    font-size: 0.8rem;
    color: var(--warm-slate);
    margin: var(--space-xs) 0 var(--space-sm);
    font-style: italic;
}

/* Nested sub-calculation item (e.g., "FT Leads" within "Staffing") */
.sub-calc-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(42, 124, 124, 0.12);
    margin: var(--space-sm) 0 var(--space-sm) var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
}

.sub-calc-item .item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--warm-slate);
}

.sub-calc-item .item-total {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--rich-teal);
}

.sub-calc-item .input-group {
    margin-bottom: var(--space-sm);
}

.sub-calc-item .input-group:last-child {
    margin-bottom: 0;
}

.sub-calc-item .input-group label {
    font-size: 0.75rem;
    color: var(--warm-slate-light);
}

.sub-calc-item .slider {
    height: 6px;
}

.sub-calc-item .number-input {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.9rem;
    max-width: 100px;
}

/* Inline row within a sub-calc item */
.sub-calc-item .input-row-inline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

/* Inline turnover/percentage row within a group */
.sub-calc-inline {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-sm);
}

.sub-calc-inline label {
    font-family: var(--font-accent);
    font-size: 0.8rem;
    color: var(--warm-slate-light);
    white-space: nowrap;
}

.sub-calc-inline .slider {
    flex: 1;
    height: 6px;
    min-width: 80px;
}

.sub-calc-inline .number-input {
    width: 70px;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.85rem;
}

.sub-calc-inline .inline-total {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--warm-slate-light);
    white-space: nowrap;
}

/* Other costs display (non-adjustable) */
.other-costs-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    background: var(--natural-linen);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--warm-slate-light);
    margin-top: var(--space-md);
}

.other-costs-display span:last-child {
    font-family: var(--font-accent);
    font-weight: 600;
    color: var(--warm-slate);
}

/* Management role sliders */
.management-role-item {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(42, 124, 124, 0.08);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-sm);
}

.management-role-item:last-child {
    margin-bottom: 0;
}

.management-role-item .role-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.management-role-item .role-name {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--warm-slate);
}

.management-role-item .role-value {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--rich-teal);
}

.management-role-item .slider {
    height: 6px;
    margin-bottom: var(--space-xs);
}

.management-role-item .number-input {
    width: 100%;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.85rem;
}

/* Management category groups */
.management-category {
    margin-bottom: var(--space-md);
}

.management-category:last-child {
    margin-bottom: 0;
}

.management-category-header {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--warm-slate-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--warm-sand);
}

/* Facility line item sliders */
.facility-line-item {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(42, 124, 124, 0.08);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-sm);
}

.facility-line-item:last-child {
    margin-bottom: 0;
}

.facility-line-item .line-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.facility-line-item .line-name {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--warm-slate);
}

.facility-line-item .line-value {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--rich-teal);
}

.facility-line-item .slider {
    height: 6px;
    margin-bottom: var(--space-xs);
}

.facility-line-item .number-input {
    width: 100%;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.85rem;
}

/* Expanded card styling */
.item-card.expanded {
    grid-column: span 1;
}

@media (min-width: 900px) {
    .item-card.expanded.wide {
        grid-column: span 2;
    }
}

/* Formula display within sub-calc */
.sub-calc-group .formula-display {
    margin-top: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(42, 124, 124, 0.06);
}

/* Responsive adjustments for sub-calc */
@media (max-width: 768px) {
    .sub-calc-item {
        margin-left: var(--space-sm);
    }
    
    .sub-calc-item .input-row-inline {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
    
    .sub-calc-inline {
        flex-wrap: wrap;
    }
    
    .sub-calc-inline .slider {
        width: 100%;
        order: 3;
    }
}

/* ========================================
   INVESTOR SITE INTEGRATION STYLES
   Header, Footer, Navigation
   ======================================== */

/* Additional CSS Variables from investor site */
:root {
    --white: #FFFFFF;
    --container-sm: 640px;
    --container-md: 960px;
    --container-lg: 1200px;
    --container-xl: 1400px;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-tooltip: 600;
    --space-3xl: 64px;
    --space-4xl: 96px;
    --space-5xl: 128px;
}

/* ===== INVESTOR SITE HEADER ===== */

.header#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: var(--white);
    z-index: var(--z-fixed);
    transition: box-shadow var(--transition-normal);
    display: flex;
    align-items: center;
}

.header#header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-xl);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header#header .logo {
    height: 48px;
    width: auto;
    display: flex;
    align-items: center;
}

.header#header .logo img {
    height: 100%;
    width: auto;
}

.nav-desktop {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-desktop .nav-link {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: 15px;
    color: var(--warm-slate);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.nav-desktop .nav-link:hover {
    color: var(--rich-teal);
    background: rgba(42, 124, 124, 0.08);
}

.nav-desktop .nav-link.active {
    color: var(--rich-teal);
    background: rgba(42, 124, 124, 0.12);
}

.nav-cta {
    margin-left: var(--space-md);
}

/* Button styles for navigation */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
    padding: 16px 32px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--paprika) 0%, var(--paprika-dark) 100%);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, var(--paprika-light) 0%, var(--paprika) 100%);
    color: var(--white);
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: var(--space-sm);
    cursor: pointer;
}

.nav-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--warm-slate);
}

/* Mobile Navigation Panel */
.nav-mobile {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--natural-linen);
    z-index: var(--z-modal);
    padding: var(--space-4xl) var(--space-xl);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
}

.nav-mobile.active {
    display: flex;
}

.nav-mobile .nav-link {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 600;
    color: var(--warm-slate);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.nav-mobile .nav-link:hover {
    color: var(--rich-teal);
}

.nav-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: none;
    border: none;
    padding: var(--space-sm);
    cursor: pointer;
}

.nav-close svg {
    width: 32px;
    height: 32px;
    color: var(--warm-slate);
}

/* ===== APP CONTAINER ADJUSTMENT ===== */

.app-container {
    margin-top: 72px; /* Account for fixed header */
}

/* Calculator Page Header */
.calc-page-header {
    background: var(--natural-linen);
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    border-bottom: 1px solid rgba(42, 124, 124, 0.1);
}

.calc-page-header .page-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--warm-slate);
    margin-bottom: var(--space-xs);
}

.calc-page-header .page-subtitle {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--warm-slate-light);
}

/* Calculator-specific footer */
.calc-footer {
    background: var(--natural-linen);
    padding: var(--space-lg);
    text-align: center;
    border-top: 1px solid rgba(42, 124, 124, 0.1);
}

.calc-footer p {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--warm-slate);
    margin: 0;
}

.calc-footer .footer-note {
    font-size: 12px;
    color: var(--warm-slate-light);
    margin-top: var(--space-xs);
}

/* ===== INVESTOR SITE FOOTER ===== */

.footer {
    background: var(--warm-slate);
    color: var(--white);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer .container-xl {
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-brand .logo {
    display: block;
    height: 80px;
    width: auto;
    margin-bottom: var(--space-lg);
    filter: brightness(0) invert(1);
}

.footer-brand .logo img {
    height: 100%;
    width: auto;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
}

.footer h4 {
    color: var(--white);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-lg);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--white);
}

.footer-cta p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    margin-bottom: var(--space-md);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin: 0;
}

/* ===== RESPONSIVE STYLES FOR SITE INTEGRATION ===== */

@media (max-width: 1024px) {
    .nav-desktop {
        display: none;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }
    
    .calc-page-header .page-title {
        font-size: 1.5rem;
    }
}

