/* ==========================================================================
   Ecaron Mission Control - Generated Project Report Document Styles
   Applies to the rendered A4 report document result (preview and print),
   separate from the report generator modal dialog and controls.
   ========================================================================== */

:root {
    --report-primary: var(--color-primary, #2c5545);
    --report-primary-hover: var(--color-primary-hover, #3c6555);
    --report-primary-subtle: #eef3f0;
    --report-paper-bg: #ffffff;
    --report-surface-alt: #f8faf9;
    --report-surface-row-alt: #fbfdfc;
    --report-border: #e2e8f0;
    --report-border-subtle: #edf2f7;
    --report-text-dark: #1c2320;
    --report-text-body: #2d3748;
    --report-text-muted: #718096;
    --report-text-subtle: #8a9690;
    --report-text-dim: #a0aec0;
    --report-badge-whole-bg: #def7ec;
    --report-badge-whole-text: #03543f;
    --report-badge-partial-bg: #fef08a;
    --report-badge-partial-text: #713f12;
}

/* Simulated A4 Paper Sheets */
.report-page {
    position: relative;
    width: 210mm;
    height: 296mm !important;
    min-height: 296mm;
    max-height: 296mm !important;
    background: #ffffff;
    color: #1a1a1a;
    padding: 16mm 20mm !important;
    box-sizing: border-box;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    font-size: 1rem;
    line-height: 1.5;
    max-width: 210mm !important;
    border-radius: 0 !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    page-break-before: always !important;
    break-before: page !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;

}

/* ==========================================================================
    Cover Page Layout
   ========================================================================== */

.report-cover-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.report-logo {
    height: 48px;
    width: auto;
}

.report-badge {
    background: var(--report-primary);
    color: #ffffff;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 3px;
}

.report-cover-main {
    margin-top: 40px;
    flex: 1;
}

.report-accent-line {
    width: 60px;
    height: 4px;
    background: var(--report-primary);
    margin-bottom: 20px;
}

.report-title {
    font-size: 2.3rem;
    color: var(--report-text-dark);
    margin: 0 0 10px 0;
    line-height: 1.2;
    font-weight: 700;
}

.report-subtitle {
    font-size: 1.2rem;
    color: #555555;
    margin: 0 0 30px 0;
}

.report-cover-image-box {
    position: relative;
    margin-top: 20px;
    border: 1px solid var(--report-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--report-surface-alt);
    width: 100%;
    box-sizing: border-box;
}

.report-cover-map-box {
    position: relative;
    width: 100%;
}

.report-map-svg,
.report-cover-map-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.report-cover-empty-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    width: 100%;
    border: 1px dashed var(--report-border);
    background: var(--report-surface-alt);
    padding: 20px;
    text-align: center;
}

.report-cover-img {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: cover;
    display: block;
}

.report-cover-meta-grid,
.report-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: auto;
    margin-bottom: 24px;
    padding-top: 20px;
}

.report-meta-card {
    background: var(--report-surface-alt);
    border: 1px solid #e8ece9;
    border-left: 3px solid var(--report-primary);
    padding: 8px 12px;
    border-radius: 3px;
}

.report-meta-label {
    display: block;
    font-size: 0.714rem;
    text-transform: uppercase;
    color: var(--report-text-muted);
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 2px;
}

.report-meta-value {
    display: block;
    font-size: 1rem;
    color: #1a202c;
    font-weight: 600;
}

.report-species-metrics {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.report-area-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.report-ecological-card {
    grid-column: 1 / -1;
}

.report-ecological-text {
    margin: 4px 0 0 0;
    font-size: 0.857rem;
    line-height: 1.5;
    color: var(--report-text-body);
    font-weight: 400;
}

/* ==========================================================================
   Generic Content Page Layout
   ========================================================================== */

.report-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.714rem;
    color: var(--report-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--report-border);
    margin-bottom: 16px;
}

.report-header-project {
    font-weight: 600;
    color: var(--report-primary);
}

.report-section-heading {
    margin-bottom: 16px;
}

.report-section-heading h2 {
    font-size: 1.429rem;
    color: var(--report-text-dark);
    margin: 0 0 4px 0;
}

.report-section-subtitle {
    font-size: 0.857rem;
    color: var(--report-text-muted);
}

.report-table-wrapper {
    flex: 1;
}

.report-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.857rem;
}

.report-data-table th {
    background: var(--report-primary);
    color: #ffffff;
    text-align: left;
    padding: 8px 10px;
    font-weight: 600;
    font-size: 0.786rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-data-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--report-border);
    color: var(--report-text-body);
}

.report-data-table tr.even-row td {
    background-color: var(--report-surface-row-alt);
}

.report-data-table tfoot th {
    background: var(--report-primary-subtle);
    color: var(--report-text-dark);
    border-top: 2px solid var(--report-primary);
    padding: 8px 10px;
}

.report-data-table .col-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.report-notes-box {
    margin-top: 14px;
    padding: 10px;
    background: var(--report-surface-alt);
    border: 1px solid var(--report-border);
    border-radius: 3px;
    font-size: 0.786rem;
    color: #4a5568;
    line-height: 1.4;
}

.report-page-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.714rem;
    color: var(--report-text-dim);
    padding-top: 12px;
    border-top: 1px solid var(--report-border);
    margin-top: auto;
}

/* ==========================================================================
   Table of Contents
   ========================================================================== */
.report-toc-container {
    flex: 1;
    margin-top: 20px;
}

.report-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.report-toc-item {
    display: flex;
    align-items: baseline;
    cursor: pointer;
    font-size: 1rem;
    color: var(--report-text-body);
    transition: color 0.15s ease;
}

.report-toc-item:hover {
    color: var(--report-primary);
}

.report-toc-title {
    font-weight: 600;
}

.report-toc-dots {
    flex: 1;
    border-bottom: 1px dotted #cbd5e0;
    margin: 0 10px;
}

.report-toc-page {
    font-weight: 700;
    color: var(--report-primary);
    font-size: 0.929rem;
}

/* ==========================================================================
   Text Content (Summary & Introduction)
   ========================================================================== */
.report-text-content {
    flex: 1;
    font-size: 0.964rem;
    line-height: 1.65;
    color: #1a202c;
    text-align: left;
}

.report-text-content p {
    margin: 0 0 14px 0;
    text-align: left;
}

.report-empty-placeholder {
    color: var(--report-text-dim);
    font-style: italic;
    padding: 10px 0;
    text-align: left;
}

/* ==========================================================================
   Methods & Equipment Specs Grid
   ========================================================================== */
.report-spec-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.report-spec-card {
    background: var(--report-surface-alt);
    border: 1px solid var(--report-border);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.report-spec-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--report-primary);
}

.report-spec-header h4 {
    margin: 0;
    color: var(--report-text-dark);
    font-size: 1rem;
}

.report-spec-icon {
    font-size: 1.143rem;
}

.report-spec-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid var(--report-border-subtle);
    font-size: 0.857rem;
}

.report-spec-row:last-child {
    border-bottom: none;
}

.report-spec-label {
    color: var(--report-text-muted);
}

.report-spec-val {
    font-weight: 600;
    color: #1a202c;
}

.highlight-val {
    color: var(--report-primary);
    font-weight: 700;
}

/* ==========================================================================
   Area Information & Maps
   ========================================================================== */
.report-area-top-row {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 16px;
    margin-bottom: 16px;
    align-items: stretch;
}

.report-area-map-container {
    position: relative;
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm, 4px);
    overflow: hidden;
    border: 1px solid var(--report-border);
    background: var(--report-surface-alt);
    box-sizing: border-box;
    margin-bottom: 14px;
}

.report-map-base {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
}

.report-map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
}

.report-map-scale-tag {
    position: absolute;
    bottom: 6px;
    right: 8px;
    background: rgba(20, 24, 22, 0.78);
    color: #ffffff;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 3px;
    pointer-events: none;
    letter-spacing: 0.3px;
}

.report-area-stats {
    display: flex;
    flex-direction: column;
}

.report-area-stats .report-spec-card {
    height: 100%;
    box-sizing: border-box;
}

.report-tables-split {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.report-tables-split.single-column {
    grid-template-columns: 1fr;
}

.report-table-card {
    border: 1px solid var(--report-border);
    border-radius: var(--radius-sm, 4px);
    background: #ffffff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.report-table-card h4 {
    margin: 0;
    padding: 8px 12px;
    background: var(--report-surface-alt);
    border-bottom: 1px solid var(--report-border);
    font-size: 0.857rem;
    color: var(--report-text-dark);
}

.report-table-scroll {
    overflow-x: auto;
    flex: 1;
}

.report-ahn-grid,
.report-ahn-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

.report-elevation-card {
    border: 1px solid var(--report-border);
    border-radius: var(--radius-sm, 4px);
    overflow: hidden;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.report-elevation-header {
    background: var(--report-surface-alt);
    padding: 8px 12px;
    border-bottom: 1px solid var(--report-border);
}

.report-elevation-header h4 {
    margin: 0 0 2px 0;
    font-size: 0.857rem;
    color: var(--report-text-dark);
}

.report-elevation-sub {
    font-size: 0.714rem;
    color: var(--report-text-muted);
}

.report-elevation-img-box {
    position: relative;
    width: 100%;
    height: auto;
    background: var(--report-border-subtle);
    overflow: hidden;
}

.report-elevation-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.report-area-subcard {
    border: 1px solid var(--report-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    background: var(--report-surface-row-alt);
}

.report-area-subcard h4 {
    margin: 0 0 8px 0;
    font-size: 0.857rem;
    color: var(--report-primary);
}

.report-compact-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.786rem;
}

.report-compact-table th {
    background: var(--report-border-subtle);
    color: #4a5568;
    text-align: left;
    padding: 5px 6px;
    font-size: 0.714rem;
    text-transform: uppercase;
    font-weight: 600;
}

.report-compact-table td {
    padding: 5px 6px;
    border-bottom: 1px solid var(--report-border-subtle);
    color: var(--report-text-body);
}

.badge-whole {
    background: var(--report-badge-whole-bg);
    color: var(--report-badge-whole-text);
}

.badge-partial {
    background: var(--report-badge-partial-bg);
    color: var(--report-badge-partial-text);
}


/* ==========================================================================
   Appendix Observations Registry Table
   ========================================================================== */
.report-appendix-table {
    font-size: 0.786rem;
}

.report-appendix-table th {
    padding: 6px 8px;
    font-size: 0.714rem;
}

.report-appendix-table td {
    padding: 5px 8px;
}

.col-coord {
    font-size: 0.714rem;
    color: #4a5568;
}

.col-photo {
    font-size: 0.714rem;
    color: var(--report-text-muted);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Report Generator Settings Panel & Content Utilities */
.report-setting-textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--color-bg-input, #141816);
    color: #ffffff;
    border: 1px solid var(--color-border, #313c36);
    border-radius: 4px;
    padding: 6px;
    font-family: inherit;
    font-size: 12px;
}

.report-setting-textarea:focus {
    border-color: var(--report-primary);
    outline: none;
}

.report-setting-label {
    margin-bottom: 4px;
    display: block;
}

.report-columns-group {
    margin-top: 8px;
}

.report-columns-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--report-text-subtle);
    font-weight: 600;
    display: block;
}

.report-columns-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.report-hint-muted {
    font-size: 12px;
    color: var(--report-text-subtle);
}

.report-hint-small {
    font-size: 11px;
    color: var(--report-text-subtle);
}

.report-table-empty-cell {
    text-align: center;
    color: #888888;
    padding: 20px;
    font-style: italic;
}

.report-tables-split.has-spacing,
.report-table-card.has-spacing,
.report-data-table-container.has-spacing {
    margin-top: 15px;
}

.report-notes-box.has-spacing {
    margin-top: 20px;
}

.report-spec-val-coord {
    font-size: 11px;
}

.report-preview-empty-state {
    padding: 50px 20px;
    text-align: center;
    color: var(--report-text-subtle);
    max-width: 420px;
    margin: 0 auto;
}

.report-preview-empty-state p {
    font-size: 13px;
    margin-top: 8px;
}

.report-section-intro {
    margin-top: 0;
    margin-bottom: 12px;
    color: #4a5550;
    font-size: 13px;
}

.report-section-intro.is-compact {
    margin-bottom: 8px;
    font-size: 12px;
    color: #666666;
}

.report-appendix-table th.col-idx,
.report-appendix-table td.col-idx {
    width: 35px;
    color: #888888;
}

.report-print-iframe {
    position: fixed;
    right: 0;
    bottom: 0;
    width: 0;
    height: 0;
    border: none;
}

/* ==========================================================================
   Print Rules for Project Report
   ========================================================================== */

@media print {
    @page {
        size: A4 portrait;
        margin: 0;
        /* Suppresses browser-injected header (timestamp/title) and footer (URL/page numbers) */
    }

    *,
    *:before,
    *:after {
        box-sizing: border-box !important;
    }

    html,
    body {
        display: block !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        color: #1a1a1a !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .report-page:first-child {
        page-break-before: auto !important;
        break-before: auto !important;
    }

    .report-page:last-child {
        page-break-after: auto !important;
        break-after: auto !important;
        margin-bottom: 0 !important;
    }

    .report-cover-page {
        border-top: 6px solid var(--report-primary) !important;
    }

    .report-content-page {
        border-top: 3px solid var(--report-primary) !important;
    }

    .report-badge,
    .report-accent-line,
    .report-data-table th,
    .report-meta-card,
    .report-brp-swatch,
    .report-brp-map-legend {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

.report-data-table code {
    font-family: inherit;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--report-text-dark, #1c2320);
    background: var(--report-surface-alt, #f4f6f5);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--report-border, #e8ece9);
    display: inline-block;
    letter-spacing: 0.3px;
}

.cadastral-parcel-label text {
    user-select: none;
    pointer-events: none;
}

.report-brp-crop-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.report-brp-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1.5px solid transparent;
    flex-shrink: 0;
    box-sizing: border-box;
}

.report-brp-map-legend {
    position: absolute;
    bottom: 6px;
    left: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(20, 24, 22, 0.84);
    color: #ffffff;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 3px;
    pointer-events: none;
    max-width: 68%;
}

.report-brp-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.report-data-table thead {
    display: table-header-group;
}

.report-data-table tfoot {
    display: table-footer-group;
}

.report-data-table tr {
    page-break-inside: avoid;
    break-inside: avoid;
}
