/* stylelint-disable at-rule-no-unknown */
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --primary: #1f3a93;
    --text-light: #0c0000;
    --accent: #ffd700;
}

.bg-primary {
    background-color: var(--primary);
}

.text-accent {
    color: var(--accent);
}

.progress-bar-0 {
    width: 0%;
}

.progress-bar-75 {
    width: 75%;
}

.progress-bar-100 {
    width: 100%;
}

.progress-bar-65 {
    width: 65%;
}

.progress-bar-dynamic {
    width: calc(var(--progress-width, 0) * 1%);
}

.hidden-initially {
    display: none;
}

.job-card {
    @apply bg-white rounded-xl shadow-md p-6 transition-all duration-300 hover:shadow-xl hover:-translate-y-1 border border-gray-100;
}

.job-card h2 {
    @apply text-lg font-bold text-primary mb-2;
}

/* Completion Tracker Tooltips */
.info-icon {
    transition: opacity 0.2s ease-in-out;
    opacity: 0;
    cursor: help;
}

.group:hover .info-icon {
    opacity: 1;
}

/* Tooltip styling - ensure proper display on hover */
#completion-sections-list .group {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#completion-sections-list .group .tooltip-container {
    position: relative;
}

#completion-sections-list .group .tooltip-container:hover .tooltip-box {
    display: block;
    opacity: 1;
    visibility: visible;
}

#completion-sections-list .group .tooltip-box {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 8px;
    background-color: #1f2937;
    color: #fff;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    padding: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    width: 20rem;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

#completion-sections-list .group .tooltip-box:before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 20px;
    border-width: 0 6px 6px 6px;
    border-style: solid;
    border-color: transparent transparent #1f2937 transparent;
}

#completion-sections-list .group .tooltip-box ul {
    list-style-type: disc;
    padding-left: 1rem;
}

#completion-sections-list .group .tooltip-box li {
    margin-bottom: 0.25rem;
}

.job-card p {
    @apply text-gray-600 text-sm;
}

.status-badge {
    @apply px-2 py-1 text-xs font-semibold rounded-full;
}

.status-draft {
    @apply bg-gray-200 text-gray-800;
}

.status-final {
    @apply bg-green-200 text-green-800;
}

.loading-spinner {
    @apply border-t-4 border-b-4 border-primary rounded-full w-16 h-16 animate-spin;
    margin: 4rem auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form Wizard Styles */
#progress-indicator .step {
    @apply text-center text-gray-500;
}
#progress-indicator .step.active {
    @apply text-primary font-bold;
}
#progress-indicator .step span {
    @apply block w-8 h-8 mx-auto rounded-full bg-gray-300 text-white flex items-center justify-center;
}
#progress-indicator .step.active span {
    @apply bg-primary;
}

.form-step {
    display: none;
    animation: fadeIn 0.5s;
}
.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

input.border-red-500 {
    border-color: #ef4444;
}

/* Tab Navigation */
.tab-nav {
    @apply flex gap-2 bg-gray-100 p-2 rounded-lg;
}

.tab-link {
    @apply px-4 py-2 text-sm font-medium text-gray-600 bg-white rounded-lg border border-gray-200 transition-all duration-200 hover:text-blue-600 hover:bg-blue-50 hover:border-blue-200 whitespace-nowrap shadow-sm;
}

.tab-link.active {
    @apply text-white bg-blue-600 border-blue-600 shadow-md;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block !important;
}

#sales-history-encumbrances.tab-content {
    display: none;
}

#sales-history-encumbrances.tab-content.active {
    display: block !important;
}

/* Modern Card Styling */
#tab-content {
    @apply bg-white rounded-b-lg shadow-lg border border-gray-200;
}

.form-section {
    @apply mb-6;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #9ca3af !important;
    border-radius: 0.5rem;
    margin-top: 0.25rem;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-section-bordered {
    @apply border-2 border-blue-300 rounded-lg p-5 bg-white shadow-sm mb-6;
}

.form-input.error {
    @apply border-red-500;
}

.form-input.success {
    @apply border-green-500;
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Report Preview Styles */
.section-header {
    text-align: center;
    margin-bottom: 0.5in;
}

.section-title {
    font-size: 16pt;
    color: #002E78;
    letter-spacing: 1.0pt;
    margin: 0;
    text-align: center;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    border: 1pt solid #999999;
    margin-bottom: 10pt;
}

.preview-table-header {
    background-color: #f0f0f0;
}

.preview-table-th {
    width: 25%;
    padding: 8pt 4pt;
    text-align: left;
    border-bottom: 1pt solid #999999;
    font-weight: bold;
}

.preview-table-th-wide {
    width: 75%;
    padding: 8pt 4pt;
    text-align: left;
    border-bottom: 1pt solid #999999;
    border-left: 1pt solid #999999;
}

.preview-table-td {
    padding: 6pt 4pt;
    vertical-align: top;
    border-bottom: 1pt solid #999999;
}

.preview-table-td-wide {
    padding: 6pt 4pt;
    vertical-align: top;
    border-bottom: 1pt solid #999999;
    border-left: 1pt solid #999999;
}

.services-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10pt;
}

.service-item {
    margin-right: 10pt;
}

.property-type-specific {
    margin-top: 0.5in;
}

.property-commentary {
    text-align: justify;
    margin: 0;
}

.building-preview-container {
    font-family: 'Times New Roman', serif;
    line-height: 1.6;
    font-size: 12pt;
    padding: 10px 0;
}

.building-table {
    width: 100%;
    border-collapse: collapse;
    border: 1pt solid #999999;
    margin: 10pt 0;
}

.building-table-th-narrow {
    width: 30%;
    padding: 8pt 4pt;
    text-align: left;
    border-bottom: 1pt solid #999999;
    font-weight: bold;
}

.building-table-th-wide {
    width: 70%;
    padding: 8pt 4pt;
    text-align: left;
    border-bottom: 1pt solid #999999;
    border-left: 1pt solid #999999;
}

.building-table-td-narrow {
    padding: 6pt 4pt;
    vertical-align: top;
    border-bottom: 1pt solid #999999;
}

.building-table-td-wide {
    padding: 6pt 4pt;
    vertical-align: top;
    border-bottom: 1pt solid #999999;
    border-left: 1pt solid #999999;
}

.construction-details-header {
    font-size: 12pt;
    color: #002E78;
    margin: 12pt 0 6pt 0;
    border-bottom: 1pt solid #ccc;
}

.construction-table {
    width: 100%;
    border-collapse: collapse;
    margin: 6pt 0;
}

.construction-table-td-narrow {
    width: 30%;
    padding: 6pt 4pt;
    vertical-align: top;
}

.construction-table-td-wide {
    width: 70%;
    padding: 6pt 4pt;
    vertical-align: top;
}

.industrial-section-hidden {
    display: none;
}

/* Phase 2 — Conditional preview sections */
.retail-section-hidden {
    display: none;
}

.multi-res-section-hidden {
    display: none;
}

.final-commentary {
    text-align: justify;
    margin: 10pt 0 0 0;
    min-height: 1.2em; /* Ensure space is reserved even when empty */
}

/* Building commentary wrap — hidden until populated (controlled by JS) */
[data-commentary-wrap] {
    display: none;
}

/* Site Improvements Preview Styles */
.site-improvements-header {
    text-align: center;
    margin-bottom: 0.5in;
}

.site-improvements-title {
    font-size: 16pt;
    color: #002E78;
    letter-spacing: 1.0pt;
    margin: 0;
    text-align: center;
}

.site-improvements-table {
    width: 100%;
    border-collapse: collapse;
    border: 1pt solid #999999;
    margin-bottom: 10pt;
}

.site-improvements-table-header {
    background-color: #f0f0f0;
}

.site-improvements-th {
    width: 15%;
    padding: 8pt 4pt;
    text-align: left;
    border-bottom: 1pt solid #999999;
    font-weight: bold;
}

.site-improvements-th:nth-child(2) {
    width: 25%;
}

.site-improvements-th:nth-child(3) {
    width: 15%;
}

.site-improvements-th:nth-child(4) {
    width: 20%;
}

.site-improvements-th:nth-child(5) {
    width: 25%;
}

.site-improvements-td {
    padding: 6pt 4pt;
    vertical-align: top;
    border-bottom: 1pt solid #999999;
}

.site-improvements-td:not(:first-child) {
    border-left: 1pt solid #999999;
}

.site-improvements-narrative {
    margin-top: 0.5in;
}

.site-improvements-paragraph {
    text-align: justify;
    margin: 0;
}

.property-specific-commentary {
    margin-top: 1em;
    font-style: italic;
}

.property-specific-paragraph {
    text-align: justify;
    margin: 0;
}

/* Geography Selector - Stable Layout */
.geography-item {
    position: relative;
}

.geography-metadata {
    @apply text-xs text-gray-500 opacity-60;
    transition: opacity 0.2s ease;
}

.geography-item:hover .geography-metadata {
    @apply opacity-100;
}

/* Enhanced visual hierarchy */
.geography-dropdown-panel {
    border: 2px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.geography-dropdown-panel:focus-within {
    border-color: #3b82f6;
}

.group-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

/* Improved accessibility */
.geography-item[aria-selected="true"] {
    @apply bg-blue-100 border-blue-300;
}

.geography-item:focus {
    @apply outline-none ring-2 ring-blue-500 ring-opacity-50;
}

/* Animation for dropdown */
.geography-dropdown-panel:not(.hidden) {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Drag and drop visual feedback */
.selected-item.drag-over {
    @apply border-blue-400 bg-blue-100;
    transform: scale(1.02);
}

.selected-item.dragging {
    @apply shadow-lg;
    z-index: 1000;
}

/* Empty state */
.selected-jurisdictions-list:empty::after {
    content: 'No jurisdictions selected. Choose from the dropdown above.';
    @apply text-gray-500 text-sm italic p-4 text-center block;
}

/* Metric Visualization Styles */
.metrics-display-area {
    margin-top: 1rem;
    max-height: 400px; /* Limit maximum height to prevent pushing content off page */
    overflow-y: auto;
}

.metrics-header {
    @apply font-semibold text-gray-900 mb-3 text-lg;
}

.metric-card {
    @apply border rounded p-3 mb-2 transition-all duration-200;
}

.metric-card.favorable {
    @apply bg-green-50 text-green-800 border-green-200;
}

.metric-card.neutral {
    @apply bg-blue-50 text-blue-800 border-blue-200;
}

.metric-card.unfavorable {
    @apply bg-red-50 text-red-800 border-red-200;
}

.metric-card.strong {
    @apply bg-green-50 text-green-800 border-green-200;
}

.metric-card.moderate {
    @apply bg-blue-50 text-blue-800 border-blue-200;
}

.metric-card.weak {
    @apply bg-red-50 text-red-800 border-red-200;
}

.metric-card-label {
    @apply font-medium mb-1;
}

.metric-card-value {
    @apply text-xl font-bold mb-1;
}

.metric-card-interpretation {
    @apply text-sm text-gray-700;
}

.metric-card-strength {
    @apply text-xs font-semibold uppercase inline-block px-2 py-1 rounded-full;
}

.metric-card-strength.favorable {
    @apply bg-green-100 text-green-800;
}

.metric-card-strength.neutral {
    @apply bg-blue-100 text-blue-800;
}

.metric-card-strength.unfavorable {
    @apply bg-red-100 text-red-800;
}

.metrics-summary {
    @apply text-sm text-gray-600 mt-2;
}

/* Metric Charts */
.metric-chart-container {
    @apply bg-white p-4 rounded-lg border border-gray-200 my-4;
    max-height: 300px; /* Limit chart height to prevent page overflow */
}

.metric-chart {
    @apply w-full h-64;
    max-height: 250px;
}

/* Data Validation & Transparency Styling */
.database-record {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
}

.database-record .record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dee2e6;
}

.database-record .record-id {
    font-weight: 600;
    color: #495057;
}

.database-record .vector-id {
    font-family: monospace;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
}

.database-record .last-updated {
    color: #212529;
    font-size: 0.85em;
}

.database-record .record-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.database-record .field {
    display: flex;
    gap: 8px;
}

.database-record .field label {
    font-weight: 600;
    color: #212529;
    min-width: 120px;
}

.database-record .field span {
    color: #212529;
}

.formula-box {
    background: #f8f9fa;
    border-left: 4px solid #3B82F6;
    padding: 12px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.formula-box .formula-title {
    font-weight: 600;
    color: #1f3a93;
    margin-bottom: 8px;
}

.formula-box .formula-content {
    color: #495057;
    line-height: 1.6;
}

.lineage-item {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.9em;
}

.lineage-arrow {
    color: #6c757d;
    margin: 4px 0;
    padding-left: 12px;
}

.badge-green {
    background: #d4edda;
    color: #155724;
}

.badge-yellow {
    background: #fff3cd;
    color: #856404;
}

.badge-red {
    background: #f8d7da;
    color: #721c24;
}

.badge-blue {
    background: #d1ecf1;
    color: #0c5460;
}

/* Enhanced Geography Selector Styles */
.geography-selector-container {
    position: relative;
    width: 100%;
}

.geography-dropdown-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.geography-selected-display {
    @apply w-full p-3 border border-gray-300 rounded-lg bg-white cursor-pointer flex justify-between items-center;
    min-height: 44px;
}

.geography-selected-display:hover {
    @apply border-blue-400;
}

.selected-count {
    @apply text-gray-700 font-medium;
}

.selected-count.at-limit {
    @apply text-red-600 font-bold;
}

.dropdown-arrow {
    @apply text-gray-500 transition-transform duration-200;
}

.geography-dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    margin-top: 4px;
    max-height: 400px;
    overflow-y: auto;
}

.geography-search-box {
    @apply p-3 border-b border-gray-200;
}

.geography-shortcuts {
    @apply p-2 border-b border-gray-200 flex gap-2 flex-wrap;
}

.shortcut-btn {
    @apply px-3 py-1 text-xs bg-blue-100 text-blue-700 rounded-full hover:bg-blue-200 transition-colors duration-200;
}

.geography-groups {
    @apply p-2;
}

.geography-group {
    @apply mb-4;
}

.group-header {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    padding: 4px 8px;
    background: #2f00ff;
    border-radius: 4px;
}

.group-items {
    @apply space-y-1;
}

.geography-item {
    @apply p-2 rounded hover:bg-gray-50 transition-colors duration-150;
}

.geography-item.subject-market {
    @apply bg-yellow-50 border border-yellow-200;
}

.geography-checkbox {
    @apply flex items-center gap-2 w-full;
}

.geography-checkbox input[type="checkbox"] {
    @apply w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500;
}

.geography-checkbox label {
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    font-weight: 500;
}

.geography-metadata {
    @apply flex gap-2 text-xs text-gray-500 w-full;
    margin-top: 2px;
}

.metadata-item {
    @apply px-2 py-1 bg-gray-100 rounded;
}

.selection-limit-warning {
    @apply p-3 bg-red-50 text-red-700 text-sm border-t border-red-200;
}

.selected-jurisdictions-list {
    @apply space-y-2;
    min-height: 40px;
}

.selected-item {
    @apply flex items-center gap-3 p-3 bg-blue-50 border border-blue-200 rounded-lg;
    transition: all 0.2s;
}

.selected-item:hover {
    @apply bg-blue-100;
}

.selected-item.dragging {
    @apply opacity-50 transform rotate-2;
}

.drag-handle {
    @apply text-gray-400 cursor-move hover:text-gray-600;
    font-size: 16px;
}

.selected-name {
    @apply flex-1 font-medium text-gray-800;
}

.remove-btn {
    @apply w-6 h-6 bg-red-100 text-red-600 rounded-full hover:bg-red-200 flex items-center justify-center text-sm font-bold transition-colors duration-200;
}

/* Keyboard navigation support */
.geography-item:focus-within {
    @apply bg-blue-50 ring-2 ring-blue-500 ring-opacity-50;
}

.geography-checkbox input[type="checkbox"]:focus {
    @apply ring-2 ring-blue-500 ring-opacity-50;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .geography-shortcuts {
        @apply flex-col;
    }
    
    .shortcut-btn {
        @apply text-center;
    }
    
    .geography-metadata {
        @apply flex-col gap-1;
    }
    
    .selected-item {
        @apply flex-col items-start gap-2;
    }
    
    .drag-handle {
        @apply self-end;
    }
    
    .geography-dropdown-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90vw;
        max-width: none;
        max-height: 80vh;
    }
    
    .geography-item:hover .geography-metadata {
        position: fixed;
        top: auto;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .geography-item {
        border: 1px solid;
    }
    
    .geography-item.subject-market {
        border: 2px solid #f59e0b;
        background: #fef3c7;
    }
    
    .selected-item {
        border: 2px solid #3b82f6;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .geography-dropdown-panel,
    .geography-metadata,
    .selected-item {
        transition: none;
        animation: none;
    }
}


/* Market Overview Comparison Table Styling - EXACT MATCH to 12_regional_city_data.html reference template */
.mo-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    background: white;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border-radius: 10px;
    overflow: hidden;
}

.mo-comparison-table thead {
    background: linear-gradient(135deg, #1f3a93 0%, #2a4db8 100%);
    color: white;
}

.mo-comparison-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 0.5px;
}

.mo-comparison-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ecf0f1;
}

.mo-comparison-table tbody tr:hover {
    background: #f8f9fa;
}

.mo-comparison-table tbody tr.subject-row {
    background-color: #fff9e6;
    font-weight: 600;
}

.mo-comparison-table tbody tr.subject-row td {
    border-top: 2px solid #ffd700;
    border-bottom: 2px solid #ffd700;
}

.mo-data-source {
    font-size: 0.8em;
    color: #7f8c8d;
    font-style: italic;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #ecf0f1;
}

/* Performance Indicators - Exact match to reference template */
.performance-indicator {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 8px;
}

.outperforming {
    background: #e8f5e8;
    color: #2e7d32;
}

.underperforming {
    background: #ffebee;
    color: #c62828;
}

.neutral-performance {
    background: #f5f5f5;
    color: #616161;
}

/* Year-over-Year Change Indicators */
.metric-change {
    font-size: 0.85em;
    display: inline-block;
    margin-left: 5px;
}

.metric-change.positive {
    color: #27ae60;
}

.metric-change.negative {
    color: #e74c3c;
}

.metric-change.neutral {
    color: #95a5a6;
}

/* Reconciliation tab styles */
.section-heading {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16pt;
    color: #1e40af;
    margin-top: 25px;
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid #d1d5db;
    font-weight: bold;
}

.subsection-heading {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14pt;
    color: #374151;
    margin: 25px 0 10px 0;
    font-weight: bold;
}

.approach-selector {
    background-color: #f8fafc;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.approach-item {
    margin: 15px 0;
    padding: 15px;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.approach-item.selected {
    background-color: #dbeafe;
    border-color: #3b82f6;
}

.sub-checkbox {
    margin-left: 30px;
    padding: 10px;
    background-color: #f9fafb;
    border-radius: 4px;
}

.narrative-section {
    margin: 20px 0;
    padding: 20px;
    background-color: #fefce8;
    border-left: 4px solid #fde047;
    border-radius: 4px;
}

.narrative-section.hidden {
    display: none;
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-family: 'Times New Roman', serif;
    font-size: 14pt;
    line-height: 1.6;
    color: #000000;
    resize: vertical;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 11pt;
}

th {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    padding: 12px;
    text-align: left;
    font-weight: bold;
}

td {
    border: 1px solid #d1d5db;
    padding: 10px;
}

tr:nth-child(even) {
    background-color: #f9fafb;
}

.total-row {
    background-color: #dbeafe !important;
    font-weight: bold;
    font-size: 12pt;
}

.final-value-row {
    background-color: #bfdbfe !important;
    font-weight: bold;
    font-size: 13pt;
}

.input-weight {
    width: 80px;
    padding: 6px;
    text-align: right;
    border: 1px solid #d1d5db;
    border-radius: 3px;
}

.value-display {
    font-weight: bold;
    color: #1e40af;
}

.warning {
    background-color: #fef3c7;
    border: 1px solid #fbbf24;
    padding: 12px;
    border-radius: 4px;
    margin: 15px 0;
}

.error {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    padding: 12px;
    border-radius: 4px;
    margin: 15px 0;
}

.success {
    background-color: #d1fae5;
    border: 1px solid #10b981;
    padding: 12px;
    border-radius: 4px;
    margin: 15px 0;
}

.checkbox-label {
    font-size: 12pt;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.radio-label {
    font-size: 11pt;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.intro-text {
    background-color: #f0f9ff;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    font-style: italic;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11pt;
    margin: 5px;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.final-reconciliation-box {
    background-color: #dbeafe;
    border: 3px solid #3b82f6;
    border-radius: 8px;
    padding: 25px;
    margin: 30px 0;
    text-align: center;
}

.final-value {
    font-size: 24pt;
    font-weight: bold;
    color: #1e40af;
    margin: 15px 0;
}

.text-right {
    text-align: right;
}

.hidden {
    display: none;
}

/* Timestamp Display - Dual timestamps for data lineage clarity */
.mo-data-source strong {
    color: #1f3a93;
}

.mo-data-source em {
    color: #6c757d;
    font-size: 0.9em;
}

/* Responsive Table Behavior - Mobile Support */
@media (max-width: 768px) {
    .mo-comparison-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .mo-comparison-table th:first-child,
    .mo-comparison-table td:first-child {
        position: sticky;
        left: 0;
        background: inherit;
        z-index: 1;
    }
    
    .mo-comparison-table thead th:first-child {
        background: linear-gradient(135deg, #1f3a93 0%, #2a4db8 100%);
    }
    
    .mo-comparison-table tbody tr.subject-row td:first-child {
        background-color: #fff9e6;
    }
    
    .mo-comparison-table::after {
        content: '← Scroll to see more data →';
        display: block;
        text-align: center;
        font-size: 0.8em;
        color: #7f8c8d;
        font-style: italic;
        margin-top: 8px;
    }
}

/* Fix for SVG elements inside buttons preventing click events */
.add-lease-btn svg,
.add-lease-btn svg * {
    pointer-events: none;
}

.add-lease-btn {
    cursor: pointer;
}

/* ── Job Editor Viewport Layout ─────────────────────────────────────────── */
.job-editor-outer {
    height: 100vh;
    overflow: hidden;
}

.job-editor-sidebar {
    height: 100%;
    overflow-y: auto;
    flex-shrink: 0;
}

/* ── Sidebar Auto-Hide / Reveal Styles ──────────────────────────────────── */

#main-sidebar {
    position: relative;
    /* overflow managed by .job-editor-sidebar class below */
    transition: width 0.3s ease-in-out, min-width 0.3s ease-in-out,
                padding 0.3s ease-in-out;
}

#main-sidebar.sidebar-collapsed {
    width: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    /* Keep vertical scrolling available even when collapsed */
    overflow-y: auto;
    overflow-x: hidden;
}

#main-sidebar.sidebar-collapsed .sidebar-content,
#main-sidebar.sidebar-collapsed nav,
#main-sidebar.sidebar-collapsed h1 {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out;
}

#main-sidebar:not(.sidebar-collapsed) .sidebar-content,
#main-sidebar:not(.sidebar-collapsed) nav,
#main-sidebar:not(.sidebar-collapsed) h1 {
    opacity: 1;
    transition: opacity 0.25s ease-in-out 0.05s;
}

/* Hover trigger strip - positioned at LEFT edge of main content area */
#sidebar-hover-strip {
    position: fixed;
    top: 0;
    left: 256px;  /* matches sidebar width when expanded; when collapsed,
                     main content shifts left so we adjust dynamically */
    width: 8px;
    height: 100vh;
    background: transparent;
    z-index: 100;
    cursor: pointer;
    transition: left 0.3s ease-in-out;
}

#sidebar-hover-strip:hover,
#sidebar-hover-strip.strip-active {
    background: rgba(59, 130, 246, 0.15);
}

/* Sidebar labels hide when collapsed */
#main-sidebar.sidebar-collapsed .sidebar-label {
    display: none;
}

.job-editor-main-col {
    overflow: hidden;
}

.job-editor-main {
    flex: 1;
    overflow-y: auto;
}
/* ─────────────────────────────────────────────────────────────────────────── */

/* ── Migrated from edit_job_new.html (Phase 1) ──────────────────────────── */

/* Loading Overlay Animation */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Site Description Preview Table */
.site-details-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    border: none;
}
#site-preview-content h3 {
    font-weight: bold;
}
.site-details-table td {
    padding: 0.5em 1em;
    border: none;
    vertical-align: top;
}
.site-details-table td.label {
    width: 1%;
    min-width: 15em;
    white-space: normal;
    font-weight: normal;
    text-align: left;
    vertical-align: top;
    padding-right: 1.5em;
}
.site-details-table td.value {
    text-align: left;
    overflow-wrap: break-word;
    word-break: break-word;
}
.commentary {
    margin-top: 1.5em;
}

/* Sales Comparison / Land Value Report View Typography */
#report-view h2 { font-family: Arial, sans-serif; font-size: 18pt; color: #1e40af; }
#report-view h3 { font-family: Arial, sans-serif; font-size: 14pt; color: #374151; }
#report-view p  { margin: 15px 0; text-align: justify; line-height: 1.6; }
#report-view table { width: 100%; border-collapse: collapse; margin: 15px 0; font-size: 10pt; }
#report-view th { background-color: #f3f4f6; border: 1px solid #d1d5db; padding: 10px; }
#report-view td { border: 1px solid #d1d5db; padding: 8px; }
#report-view .value-box { margin: 25px 0; padding: 20px; background-color: #f0f9ff; border: 2px solid #3b82f6; border-radius: 8px; text-align: center; }
#report-view .value-display { font-size: 20pt; color: #0369a1; font-weight: bold; margin: 15px 0; }
/* ─────────────────────────────────────────────────────────────────────────── */

/* ── Migrated from edit_job_new.html (Phase 2) ──────────────────────────── */

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#loading-overlay img {
    width: 150px;
    height: 150px;
    animation: pulse 1.5s ease-in-out infinite;
}
/* ─────────────────────────────────────────────────────────────────────────── */

/* ── Migrated from edit_job_new.html (Phase 3) ──────────────────────────── */

/* Certification Preview */
#certification-preview {
    font-family: 'Times New Roman', serif;
    line-height: 1.6;
    max-width: 860px;
}
#certification-preview p {
    margin: 4px 0;
    text-align: left;
}
#certification-preview ol {
    margin: 0 0 15px 0;
    padding-left: 25px;
}
#certification-preview li {
    margin: 6px 0;
    text-align: justify;
}
#certification-preview table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}
#certification-preview td {
    padding: 2px 8px 2px 0;
}
.cert-intro-p {
    margin: 0 0 10px 0;
    text-align: justify;
}
.cert-property-heading {
    margin: 20px 0 5px 0;
}
.cert-legal-p {
    margin: 4px 0;
}
#cert-basis {
    margin: 20px 0 15px 0;
    text-align: justify;
}
.cert-assumptions-p {
    margin: 0 0 15px 0;
    text-align: justify;
}
.cert-signature-heading {
    margin: 20px 0 30px 0;
}
.cert-cosign-heading {
    margin: 0 0 30px 0;
}
.cert-cosign-block {
    margin-top: 30px;
}
.cert-sig-note {
    margin: 4px 0;
    font-style: italic;
}
/* ─────────────────────────────────────────────────────────────────────────── */

/* ── Migrated from edit_job_new.html (Phase 4) ──────────────────────────── */

/* HBU Preview */
#hbu-preview-content {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: #2c3e50;
}
#hbu-preview-content h1 { color: #1a252f; }
#hbu-preview-content h2 { color: #2c3e50; }
#hbu-preview-content h3 { color: #34495e; }
/* ─────────────────────────────────────────────────────────────────────────── */

/* ── Migrated from edit_job_new.html (Phase 5) ──────────────────────────── */

/* Income Approach Color-Coded Cells */
.income-positive { color: green; }
.income-negative { color: red; }
.income-neutral  { color: #b8860b; }
/* ─────────────────────────────────────────────────────────────────────────── */

/* ── Phase 6: Reconciliation & Sales Comparison / Land Value Report View ── */

/* Reconciliation subsection h3 — removes top margin when first in container */
.reconciliation-h3-no-top { margin-top: 0; }

/* Income sub-approach labels (Direct Cap / DCF) */
.reconciliation-label-normal { font-weight: normal; font-size: 11pt; }

/* Summary table column widths */
.reconciliation-th-approach  { width: 40%; }
.reconciliation-th-value     { width: 25%; }
.reconciliation-th-weight    { width: 20%; }
.reconciliation-th-weighted  { width: 15%; }

/* Centered button block in summary section */
.reconciliation-center-block { text-align: center; margin: 20px 0; }

/* Footnote paragraph under final narrative label */
.reconciliation-footnote { margin: 10px 0; font-size: 10pt; color: #6b7280; }

/* Land Value report view — h4 methodology headings */
.report-h4-heading {
    font-family: Arial, sans-serif;
    font-size: 12pt;
    color: #1e40af;
    margin: 15px 0 8px 0;
    font-weight: bold;
}

/* Adjustment explanations callout panel */
.report-adjustments-panel {
    margin: 20px 0;
    padding: 15px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
}

/* Value conclusion box */
.report-value-conclusion-box {
    padding: 20px;
    background-color: #f0fdf4;
    border: 2px solid #bbf7d0;
    border-radius: 8px;
    text-align: center;
    margin-top: 25px;
}
.report-value-conclusion-value   { font-size: 18pt; font-weight: bold; color: #15803d; }
.report-value-conclusion-rounded { font-size: 11pt; color: #16a34a; margin-top: 8px; }
.report-value-conclusion-date    { margin-top: 15px; font-style: italic; }

/* Final comments paragraph in report view */
.report-final-comments { margin-top: 20px; }

/* ── Phase 7: Readonly input styling ──────────────────────────────────────── */
.input-readonly {
    background-color: #f3f4f6;
    cursor: not-allowed;
}

/* ── Conditional assumptions panel (land value report view) ──────────────── */
#report-conditional-assumptions {
    margin: 20px 0;
    padding: 15px;
    background: #fef2f2;
    border: 2px solid #ef4444;
    border-radius: 6px;
    font-style: italic;
}

/* ── Appendix D: Comparable Sales ────────────────────────────────────────── */
.appendix-d-h2 { font-size: 20px; text-align: left; font-weight: bold; }
.appendix-d-h3 { font-size: 17px; text-align: left; font-weight: bold; }
.appendix-d-intro { text-align: justify; margin-bottom: 12pt; }
.appendix-d-group-heading { font-size: 17px; font-weight: bold; margin-top: 18pt; margin-bottom: 8pt; }
.appendix-d-spacer { margin-top: 12pt; margin-bottom: 12pt; }
.appendix-d-comp-heading { font-weight: bold; margin-bottom: 4pt; }
.appendix-d-image-wrap { text-align: center; }
.appendix-d-caption { font-style: italic; font-size: 10pt; text-align: center; }
.appendix-d-empty { font-style: italic; color: #666; }

/* ── Building Description Report Section ─────────────────────────────────── */
.building-commentary-section {
    margin-top: 15pt;
    padding-top: 10pt;
    border-top: 1pt solid #ccc;
}

.building-commentary-heading {
    font-size: 10pt;
    font-weight: bold;
    color: #374151;
    margin-bottom: 6pt;
}

.building-commentary-text {
    text-align: justify;
    color: #1f2937;
    line-height: 1.6;
}
/* ─────────────────────────────────────────────────────────────────────────── */

/* ── Hide Save Section and preview Refresh buttons (autosave handles persistence) ── */
#save-letter-of-transmittal-btn, #save-introduction-btn, #save-scope-of-work-btn,
#save-assumptions-btn, #save-property-identification-btn, #save-site-description-btn,
#save-site-improvements-btn, #save-assessment-taxes-btn, #save-sales-history-encumbrances-btn,
#save-lease-details-btn, #save-land-use-controls-btn, #save-regional-city-data-btn,
#save-neighbourhood-data-btn, #save-factual-data-btn, #save-analysis-btn,
#save-supporting-data-btn, #save-photos-btn, #appraiser-certification-save-btn,
#limitation-liability-save-btn, #definitions-save-btn, #save-income-btn,
#save-sales-comparison-btn, #save-reconciliation-btn, #save-land-value-btn,
#save-exposure-time-btn, #save-hbu-btn, #save-report-btn, #save-standards-report-btn,
#refresh-introduction-preview-btn, #refresh-scope-preview-btn, #refresh-assumptions-preview-btn,
#refresh-property-id-preview-btn, #refresh-site-preview-btn, #refresh-site-improvements-preview-btn,
#refresh-lease-preview-btn, #refresh-luc-preview-btn, #refresh-neighbourhood-preview-btn,
#refresh-hbu-preview-btn { display: none !important; }

/* ── Market Overview Textarea Sizing ────────────────────────────────────── */
.mo-textarea {
    min-height: 220px;
    resize: vertical;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.875rem;
    line-height: 1.65;
    color: #1f2937;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Utility classes — moved from inline styles */
.progress-bar-initial {
    width: 0%;
}

.hidden-initial {
    display: none;
}

/* ── Report Generation Spinner ──────────────────────────────────────────── */
.report-spinner-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.report-spinner-icon {
    width: 120px;
    height: 120px;
    animation: pulse 1.5s ease-in-out infinite;
}

.report-spinner-message {
    margin-top: 24px;
    font-size: 1rem;
    font-weight: 600;
    color: #1e3a5f;
}

.report-spinner-subtitle {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #6b7280;
}
