/* ===== CSS Variables ===== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --light: #f8fafc;
    --border: #e2e8f0;
    --text: #334155;
    --text-light: #64748b;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ===== Navbar ===== */
.navbar {
    background: var(--dark);
    padding: 15px 0;
    box-shadow: var(--shadow);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    margin-left: 25px;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: white;
}

/* ===== Main Content ===== */
main {
    flex: 1;
    padding: 40px 0;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

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

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

.btn-secondary:hover {
    background: #475569;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--light);
    border-color: var(--secondary);
}

.btn-large {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.disabled:hover {
    opacity: 0.5;
}

/* ===== Hero Section ===== */
.hero {
    text-align: center;
    padding: 60px 0;
}

.hero h1 {
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 10px;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.hero-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Features ===== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 50px;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.feature-card h3 {
    margin-bottom: 10px;
    color: var(--dark);
}

.feature-list {
    text-align: left;
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.feature-list li {
    margin-bottom: 8px;
    color: var(--text);
    line-height: 1.5;
}

.feature-list li:last-child {
    margin-bottom: 0;
}

/* ===== Get Started Section ===== */
.get-started-section {
    margin-top: 60px;
    text-align: center;
}

.get-started-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    text-decoration: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(37, 99, 235, 0.3);
    transition: all 0.3s ease;
}

.get-started-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 50px rgba(37, 99, 235, 0.4);
}

.get-started-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.get-started-btn:hover .get-started-icon {
    transform: translateX(8px);
}

.get-started-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.get-started-subtext {
    font-size: 0.9rem;
    opacity: 0.85;
}

/* ===== Forms ===== */
.form-page {
    max-width: 900px;
    margin: 0 auto;
}

.form-page h1 {
    margin-bottom: 30px;
    color: var(--dark);
}

.form-section {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

.form-section h2 {
    font-size: 1.2rem;
    color: var(--dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.form-section h3 {
    font-size: 1rem;
    color: var(--text);
    margin-top: 20px;
    margin-bottom: 15px;
}

.section-note {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s;
}

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

.form-group small {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* Rent Roll Header */
.rent-roll-header {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.rent-roll-header .header-tenant {
    flex: 2;
}

.rent-roll-header .header-area,
.rent-roll-header .header-rent {
    flex: 1;
}

.rent-roll-header .header-lease {
    flex: 0 0 130px;
}

.rent-roll-header .header-remove {
    flex: 0 0 36px;
}

/* Rent Roll Rows */
.rent-roll-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.rent-roll-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

.rent-roll-row input:first-child {
    flex: 2;
}

.rent-roll-row .lease-end-input {
    flex: 0 0 130px;
}

/* Operating Expense Rows */
.opex-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.opex-row input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

.opex-row input:first-child {
    flex: 2;
}

.opex-row .opex-type-select {
    flex: 0 0 100px;
    padding: 10px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.opex-row .opex-type-select:focus {
    outline: none;
    border-color: var(--primary);
}

.opex-row .opex-value-input {
    flex: 1;
}

#opex-container {
    margin-bottom: 15px;
}

/* Operating Expense Mode Toggle */
.opex-mode-toggle {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: var(--light);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.opex-mode-toggle .radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}

.opex-mode-toggle .radio-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.opex-mode-toggle .radio-option span {
    font-weight: 500;
}

/* General Opex Container */
.opex-general-container {
    margin-bottom: 15px;
}

.opex-general-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.opex-general-row label {
    flex: 0 0 180px;
    font-weight: 500;
    font-size: 14px;
}

.opex-general-row .opex-type-select {
    flex: 0 0 100px;
    padding: 10px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.opex-general-row .opex-general-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

.opex-general-row .opex-general-input:focus,
.opex-general-row .opex-type-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Capital Cost Rows (TI, LC, CapEx) */
.capital-cost-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.capital-cost-row label {
    flex: 0 0 200px;
    font-weight: 500;
    font-size: 14px;
}

.capital-cost-row .capital-cost-type {
    flex: 0 0 80px;
    padding: 10px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.capital-cost-row .capital-cost-type:focus {
    outline: none;
    border-color: var(--primary);
}

.capital-cost-row .capital-cost-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

.capital-cost-row .capital-cost-input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-remove {
    background: var(--danger);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

/* ===== Collapsible Detailed Tenant Section ===== */
.collapsible-section {
    margin-top: 25px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.collapsible-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 12px 18px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.collapsible-toggle:hover {
    background: var(--light);
    border-color: var(--primary);
}

.toggle-icon {
    font-size: 10px;
    transition: transform 0.2s;
}

.collapsible-content {
    display: none;
    padding-top: 20px;
}

.collapsible-content.expanded {
    display: block;
}

/* Detailed Tenant Cards */
.detailed-tenant-card {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 15px;
}

.detailed-tenant-card:last-child {
    margin-bottom: 0;
}

.detailed-tenant-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.tenant-name-display {
    font-weight: 600;
    color: var(--dark);
    font-size: 15px;
}

.detailed-tenant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.detailed-tenant-grid .form-group {
    margin-bottom: 0;
}

.detailed-tenant-grid .form-group label {
    font-size: 13px;
    color: var(--text);
}

.detailed-tenant-grid .form-group input,
.detailed-tenant-grid .form-group select {
    padding: 8px 10px;
    font-size: 13px;
}

.detailed-tenant-grid .form-group small {
    font-size: 11px;
}

.form-actions {
    display: flex;
    gap: 15px;
}

/* Load from Saved Analysis Section */
.load-section {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #eab308;
    margin-bottom: 25px;
}

.load-from-saved {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.load-from-saved label {
    font-weight: 500;
    color: var(--text);
}

.load-from-saved select {
    flex: 1;
    min-width: 250px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: white;
}

.load-from-saved small {
    flex: 0 0 100%;
    color: #a16207;
    font-size: 12px;
}

/* Save Section Styling */
.save-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid var(--primary);
}

.save-section h2 {
    color: var(--primary);
}

.save-section .form-actions {
    margin-top: 0;
}

.save-section .form-group {
    max-width: 500px;
}

/* Three button layout */
.form-actions.three-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-actions.three-buttons .btn-large {
    flex: 1;
    min-width: 180px;
    text-align: center;
}

/* Preview Banner */
.preview-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: var(--radius);
    padding: 15px 20px;
    margin-bottom: 25px;
}

.preview-banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.preview-label {
    background: #f59e0b;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.preview-text {
    color: #92400e;
    font-weight: 500;
}

.preview-banner .btn {
    margin-left: auto;
}

@media (max-width: 768px) {
    .preview-banner-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .preview-banner .btn {
        margin-left: 0;
        width: 100%;
        text-align: center;
    }
}

/* ===== Results Page ===== */
.results-page h1 {
    color: var(--dark);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.results-header .subtitle {
    color: var(--text-light);
}

.results-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.metrics-section {
    margin-bottom: 30px;
}

.metrics-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.metric-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 25px;
    min-width: 180px;
    flex: 1;
}

.metric-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 5px;
}

.metric-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.metric-sublabel {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    margin-top: 3px;
}

/* ===== Report Section Styles ===== */
.report-section {
    margin-bottom: 40px;
}

.report-section.page-break {
    page-break-before: always;
}

.report-header {
    background: linear-gradient(135deg, var(--dark) 0%, #334155 100%);
    color: white;
    padding: 25px 30px;
    border-radius: var(--radius) var(--radius) 0 0;
    margin-bottom: 0;
}

.report-header .report-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white !important;
}

.report-property-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.report-property-info .property-name {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9;
}

.report-property-info .property-address {
    font-size: 0.85rem;
    opacity: 0.7;
}

.report-section .results-actions {
    background: white;
    padding: 15px 30px;
    border: 1px solid var(--border);
    border-top: none;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.report-section .metrics-grid {
    background: white;
    padding: 25px 30px;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
}

.report-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 0;
    background: white;
    border: 1px solid var(--border);
    border-top: none;
}

.report-card {
    padding: 25px 30px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.report-card:last-child {
    border-right: none;
}

.report-card.full-width {
    grid-column: 1 / -1;
    border-right: none;
}

.report-card h2 {
    font-size: 1rem;
    color: var(--dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-section .report-card:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
}

.noi-summary {
    background: #f0f9ff;
}

.no-data {
    color: var(--text-light);
    font-style: italic;
    padding: 20px 0;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.results-card {
    background: white;
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.results-card.full-width {
    grid-column: 1 / -1;
}

.results-card h2 {
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

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

.results-table td,
.results-table th {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.results-table th {
    font-weight: 600;
    text-align: left;
    background: var(--light);
    padding: 12px 10px;
}

.results-table .number {
    text-align: right;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.results-table .negative {
    color: var(--danger);
}

.results-table .total-row {
    font-weight: 600;
    background: var(--light);
}

.results-table .total-row.highlight {
    background: #dbeafe;
}

.cash-flow-table th,
.cash-flow-table td {
    padding: 12px 15px;
}

/* Monthly Cash Flow Table */
.monthly-table-wrapper {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.monthly-cf-table {
    font-size: 13px;
}

.monthly-cf-table th,
.monthly-cf-table td {
    padding: 8px 12px;
}

.monthly-cf-table .year-start {
    border-top: 2px solid var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.monthly-cf-table thead th {
    position: sticky;
    top: 0;
    background: var(--light);
    z-index: 1;
}

/* Lease Expiration Table */
.lease-table th,
.lease-table td {
    padding: 12px 20px;
}

.lease-table .lease-end-col {
    padding-left: 30px;
}

.assumptions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.disclaimer {
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ===== List Page ===== */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.analysis-table-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

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

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

.analysis-table th {
    background: var(--light);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-light);
}

.analysis-table td a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.analysis-table td a:hover {
    text-decoration: underline;
}

.analysis-table .number {
    text-align: right;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

.analysis-table .actions {
    display: flex;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* ===== Recent Analyses ===== */
.recent-section {
    margin-top: 50px;
}

.recent-section h2 {
    margin-bottom: 20px;
    color: var(--dark);
}

.analysis-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.analysis-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.analysis-card h4 {
    color: var(--dark);
    margin-bottom: 5px;
}

.analysis-card p {
    color: var(--text-light);
    font-size: 14px;
}

.analysis-card .date {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-light);
}

/* ===== Alerts ===== */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ===== Footer ===== */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,0.6);
    padding: 20px 0;
    text-align: center;
    font-size: 14px;
    margin-top: auto;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .results-header {
        flex-direction: column;
    }
    
    .results-actions {
        width: 100%;
    }
    
    .results-actions .btn {
        flex: 1;
        text-align: center;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        flex-direction: column;
    }
    
    .metric-card {
        min-width: 100%;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .rent-roll-row {
        flex-wrap: wrap;
    }
    
    .rent-roll-row input {
        flex: 1 1 100%;
    }
    
    .rent-roll-row input:first-child {
        flex: 1 1 100%;
    }
    
    .opex-row {
        flex-wrap: wrap;
    }
    
    .opex-row input:first-child {
        flex: 1 1 100%;
    }
    
    .opex-row .opex-type-select {
        flex: 0 0 auto;
    }
    
    .opex-row .opex-value-input {
        flex: 1 1 60%;
    }
    
    .capital-cost-row {
        flex-wrap: wrap;
    }
    
    .capital-cost-row label {
        flex: 1 1 100%;
        margin-bottom: 5px;
    }
    
    .capital-cost-row .capital-cost-type {
        flex: 0 0 auto;
    }
    
    .capital-cost-row .capital-cost-input {
        flex: 1 1 60%;
    }
    
    .detailed-tenant-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .collapsible-toggle {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .opex-mode-toggle {
        flex-direction: column;
        gap: 10px;
    }
    
    .opex-general-row {
        flex-wrap: wrap;
    }
    
    .opex-general-row label {
        flex: 1 1 100%;
        margin-bottom: 5px;
    }
    
    .opex-general-row .opex-type-select {
        flex: 0 0 auto;
    }
    
    .opex-general-row .opex-general-input {
        flex: 1 1 60%;
    }
}

/* ===== Print Styles ===== */
@media print {
    /* Hide navigation and buttons */
    .navbar,
    .footer,
    .results-actions,
    .preview-banner,
    .no-print,
    .btn {
        display: none !important;
    }
    
    /* Reset page margins */
    body {
        background: white;
        font-size: 10pt;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    /* Report section page breaks */
    .report-section.page-break {
        page-break-before: always;
    }
    
    .report-section {
        margin-bottom: 0;
    }
    
    /* Report header for print */
    .report-header {
        background: #1e293b !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        padding: 15px 20px;
        margin-bottom: 0;
    }
    
    .report-title {
        font-size: 14pt;
        color: white !important;
    }
    
    .report-property-info {
        color: white !important;
    }
    
    .report-property-info .property-name {
        font-size: 10pt;
    }
    
    /* Report content for print */
    .report-content-grid {
        display: block;
        border: none;
    }
    
    .report-card {
        border: 1px solid #ccc;
        margin-bottom: 15px;
        break-inside: avoid;
    }
    
    .report-card h2 {
        font-size: 11pt;
        border-bottom-color: #333;
    }
    
    /* Clean up cards for print */
    .results-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
        margin-bottom: 15px;
    }
    
    .metric-card {
        border: 1px solid #ccc;
    }
    
    .metrics-grid {
        border: none;
    }
    
    /* Ensure tables don't break across pages */
    .results-table {
        break-inside: avoid;
    }
    
    /* Show full width */
    .results-grid {
        display: block;
    }
    
    .results-grid .results-card {
        margin-bottom: 20px;
    }
    
    /* Header styling for print */
    .results-header {
        border-bottom: 2px solid #333;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }
    
    .results-header h1 {
        font-size: 18pt;
    }
    
    /* Disclaimer at bottom */
    .disclaimer {
        margin-top: 20px;
        font-size: 9pt;
    }
    
    /* NOI summary background for print */
    .noi-summary {
        background: #f0f9ff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Monthly cash flows - remove scroll container for print */
    .monthly-table-wrapper {
        max-height: none !important;
        overflow: visible !important;
        border: none;
    }
    
    .monthly-cf-table {
        font-size: 9pt;
    }
    
    .monthly-cf-table thead th {
        position: static;
    }
    
    /* Monthly cash flows page break */
    .monthly-cash-flow-section {
        page-break-before: always;
    }
}

/* ===== Modal Styles ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

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

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--dark);
}

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

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

.modal-body {
    padding: 20px;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

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

.modal-body label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
}

.modal-body select,
.modal-body input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    color: var(--text);
}

.modal-body select:focus,
.modal-body input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-body small {
    display: block;
    margin-top: 6px;
    color: var(--text-light);
    font-size: 0.85rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    background: var(--light);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Save Options in Modal */
.save-option {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 15px;
    overflow: hidden;
}

.save-option:last-of-type {
    margin-bottom: 0;
}

.save-option-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--light);
    cursor: pointer;
    margin: 0;
}

.save-option-label input[type="radio"] {
    margin: 0;
    width: 18px;
    height: 18px;
}

.save-option-title {
    font-weight: 600;
    color: var(--dark);
}

.save-option-content {
    padding: 15px;
    border-top: 1px solid var(--border);
}

.save-option-content.disabled {
    opacity: 0.5;
    pointer-events: none;
    background: #f9f9f9;
}

.save-option-content input[type="text"],
.save-option-content select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
}

.save-option-content input[type="text"]:focus,
.save-option-content select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.save-option-content small {
    display: block;
    margin-top: 8px;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Smaller modal for dialogs */
.modal-small {
    max-width: 400px;
}

.modal-small .modal-body p {
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.modal-small .modal-body p:last-child {
    margin-bottom: 0;
}

.duplicate-buttons {
    flex-wrap: wrap;
    gap: 8px;
}

.duplicate-buttons .btn {
    flex: 1;
    min-width: 100px;
    text-align: center;
}

@media print {
    .modal-overlay {
        display: none !important;
    }
}
