.property-report {
    font-family: 'Roboto', sans-serif;
    color: #333;
    line-height: 1.6;
}

.report-page {
    padding: 30px;
    background: white;
}

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

.report-header {
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 12px;
    color: white;
}

.agent-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.agent-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
}

.agent-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: white;
}

.agent-company {
    margin: 5px 0;
    opacity: 0.9;
}

.agent-contact {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.company-logo {
    max-height: 60px;
    max-width: 150px;
    object-fit: contain;
}

.property-address-banner {
    background: var(--accent-color);
    color: white;
    padding: 15px 25px;
    margin-top: 15px;
    border-radius: 8px;
    text-align: center;
}

.property-address-banner h1 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 1px;
}

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

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-content {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.info-row.full-width {
    grid-column: span 2;
    flex-direction: column;
}

.info-label {
    font-weight: 500;
    color: #64748b;
    font-size: 0.9rem;
}

.info-value {
    font-weight: 600;
    color: #1e293b;
    text-align: right;
}

.info-row.full-width .info-value {
    text-align: left;
    margin-top: 5px;
}

.property-details-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-top: 20px;
    max-width: 100%;
}

.detail-box {
    background: white;
    padding: 12px 6px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    min-width: 0;
    overflow: hidden;
}

.detail-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    word-break: break-word;
}

.detail-label {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 5px;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    table-layout: fixed;
}

.data-table th {
    background: var(--primary-color);
    color: white;
    padding: 8px 6px;
    text-align: left;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.data-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #e2e8f0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 150px;
}

.data-table tr:nth-child(even) {
    background: #f8fafc;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-left: 4px solid var(--accent-color);
}

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

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 5px;
}

.comp-card {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.comp-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.comp-number {
    background: var(--primary-color);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.comp-address {
    flex: 1;
    font-weight: 600;
}

.comp-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.comp-details {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #64748b;
}

.demographics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.demo-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.demo-card h4 {
    color: var(--primary-color);
    font-size: 1rem;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
}

.demo-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.demo-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.demo-row.highlight {
    background: #f0fdf4;
    padding: 8px;
    border-radius: 4px;
    margin: 5px -8px;
}

.demo-row.highlight span:last-child {
    color: #16a34a;
    font-weight: 600;
}

.age-distribution {
    margin-top: 25px;
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.age-distribution h4 {
    color: var(--primary-color);
    margin: 0 0 15px 0;
}

.age-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.age-bar-item {
    display: grid;
    grid-template-columns: 50px 1fr 50px;
    align-items: center;
    gap: 10px;
}

.age-label {
    font-size: 0.85rem;
    color: #64748b;
}

.age-bar-container {
    background: #e2e8f0;
    height: 20px;
    border-radius: 4px;
    overflow: hidden;
}

.age-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

.age-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: right;
}

.school-category {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.schools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.school-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.school-card h5 {
    color: var(--primary-color);
    font-size: 0.95rem;
    margin: 0 0 5px 0;
}

.school-address {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 10px 0;
}

.school-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.8rem;
    color: #64748b;
}

.school-details span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.api-badge {
    background: #16a34a;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.report-footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #e2e8f0;
    margin-top: 30px;
    color: #64748b;
    font-size: 0.85rem;
}

.disclaimer {
    font-style: italic;
    font-size: 0.75rem;
}

/* Template styles - apply via container OR directly on .property-report */
.template-modern .header-content,
.property-report.template-modern .header-content {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
}

.template-classic .header-content {
    background: linear-gradient(135deg, #44403c 0%, #57534e 100%);
    border-radius: 0;
}

.template-classic .property-address-banner {
    background: #78716c;
    border-radius: 0;
}

.template-classic .section-title {
    font-family: 'Playfair Display', serif;
    border-bottom-style: double;
    border-bottom-width: 4px;
}

.template-luxury .header-content {
    background: linear-gradient(135deg, #1c1917 0%, #292524 100%);
    border: 2px solid #d4af37;
}

.template-luxury .property-address-banner {
    background: linear-gradient(90deg, #d4af37, #f5d17d, #d4af37);
    color: #1c1917;
}

.template-luxury .section-title {
    color: #d4af37;
    border-bottom-color: #d4af37;
}

.template-luxury .stat-box,
.template-luxury .comp-number {
    background: #1c1917;
    color: #d4af37;
}

.template-luxury .stat-value,
.template-luxury .detail-value {
    color: #d4af37;
}

.template-minimal .header-content {
    background: #f8fafc;
    color: #1e293b;
    border: 1px solid #e2e8f0;
}

.template-minimal .agent-name,
.template-minimal .agent-company,
.template-minimal .agent-contact {
    color: #1e293b;
}

.template-minimal .property-address-banner {
    background: #1e293b;
}

.template-minimal .section-content {
    background: white;
    border: 1px solid #e2e8f0;
}

.template-corporate .header-content {
    background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%);
}

.template-corporate .property-address-banner {
    background: #0284c7;
}

.template-corporate .section-title {
    color: #0c4a6e;
    border-bottom-color: #0c4a6e;
}

.template-bold .header-content {
    background: linear-gradient(135deg, #7c2d12 0%, #c2410c 100%);
}

.template-bold .property-address-banner {
    background: #ea580c;
}

.template-bold .section-title {
    color: #c2410c;
    border-bottom-color: #c2410c;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.template-neutral .header-content {
    background: linear-gradient(135deg, #78716c 0%, #a8a29e 100%);
}

.template-neutral .property-address-banner {
    background: #d6d3d1;
    color: #44403c;
}

.template-neutral .section-content {
    background: #fafaf9;
}

.template-tech .header-content {
    background: linear-gradient(135deg, #1e1b4b 0%, #3730a3 100%);
}

.template-tech .property-address-banner {
    background: #6366f1;
}

.template-tech .section-title {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}

.template-tech .detail-box,
.template-tech .stat-box {
    border: 1px solid #e0e7ff;
}

.template-traditional .header-content {
    background: linear-gradient(135deg, #14532d 0%, #166534 100%);
}

.template-traditional .property-address-banner {
    background: #15803d;
}

.template-traditional .section-title {
    color: #166534;
    border-bottom-color: #166534;
    font-family: 'Playfair Display', serif;
}

.template-vibrant .header-content {
    background: linear-gradient(135deg, #be185d 0%, #db2777 100%);
}

.template-vibrant .property-address-banner {
    background: #06b6d4;
}

.template-vibrant .section-title {
    color: #be185d;
    border-bottom-color: #be185d;
}

.template-vibrant .stat-value,
.template-vibrant .detail-value {
    color: #0891b2;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .agent-info {
        flex-direction: column;
    }
    
    .property-details-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .info-row.full-width {
        grid-column: span 1;
    }
    
    .stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .demographics-grid {
        grid-template-columns: 1fr;
    }
    
    .schools-grid {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 0.75rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 8px;
    }
}

@media print {
    .report-page {
        padding: 15mm;
        margin: 0;
        width: 210mm;
        min-height: 297mm;
        box-sizing: border-box;
    }
    
    .page-break {
        page-break-before: always;
        padding-top: 15mm;
    }
    
    .header-content {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .property-address-banner {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .section-content {
        break-inside: avoid;
    }
    
    .comp-card {
        break-inside: avoid;
    }
    
    .school-card {
        break-inside: avoid;
    }
    
    .demo-card {
        break-inside: avoid;
    }
    
    .data-table {
        break-inside: auto;
    }
    
    .data-table tr {
        break-inside: avoid;
    }
    
    .report-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
    }

    @page {
        margin: 10mm;
        size: A4;
    }
}

/* Duplicate template rules for when class is directly on .property-report */
.property-report.template-classic .header-content { background: linear-gradient(135deg, #44403c 0%, #57534e 100%); border-radius: 0; }
.property-report.template-classic .property-address-banner { background: #78716c; border-radius: 0; }
.property-report.template-classic .section-title { font-family: 'Playfair Display', serif; border-bottom-style: double; border-bottom-width: 4px; }

.property-report.template-luxury .header-content { background: linear-gradient(135deg, #1c1917 0%, #292524 100%); border: 2px solid #d4af37; }
.property-report.template-luxury .property-address-banner { background: linear-gradient(90deg, #d4af37, #f5d17d, #d4af37); color: #1c1917; }
.property-report.template-luxury .section-title { color: #d4af37; border-bottom-color: #d4af37; }
.property-report.template-luxury .stat-box, .property-report.template-luxury .comp-number { background: #1c1917; color: #d4af37; }
.property-report.template-luxury .stat-value, .property-report.template-luxury .detail-value { color: #d4af37; }

.property-report.template-minimal .header-content { background: #f8fafc; color: #1e293b; border: 1px solid #e2e8f0; }
.property-report.template-minimal .agent-name, .property-report.template-minimal .agent-company, .property-report.template-minimal .agent-contact { color: #1e293b; }
.property-report.template-minimal .property-address-banner { background: #1e293b; }
.property-report.template-minimal .section-content { background: white; border: 1px solid #e2e8f0; }

.property-report.template-corporate .header-content { background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 100%); }
.property-report.template-corporate .property-address-banner { background: #0284c7; }
.property-report.template-corporate .section-title { color: #0c4a6e; border-bottom-color: #0c4a6e; }

.property-report.template-bold .header-content { background: linear-gradient(135deg, #7c2d12 0%, #c2410c 100%); }
.property-report.template-bold .property-address-banner { background: #ea580c; }
.property-report.template-bold .section-title { color: #c2410c; border-bottom-color: #c2410c; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

.property-report.template-neutral .header-content { background: linear-gradient(135deg, #78716c 0%, #a8a29e 100%); }
.property-report.template-neutral .property-address-banner { background: #d6d3d1; color: #44403c; }
.property-report.template-neutral .section-content { background: #fafaf9; }

.property-report.template-tech .header-content { background: linear-gradient(135deg, #1e1b4b 0%, #3730a3 100%); }
.property-report.template-tech .property-address-banner { background: #6366f1; }
.property-report.template-tech .section-title { color: #4f46e5; border-bottom-color: #4f46e5; }
.property-report.template-tech .detail-box, .property-report.template-tech .stat-box { border: 1px solid #e0e7ff; }

.property-report.template-traditional .header-content { background: linear-gradient(135deg, #14532d 0%, #166534 100%); }
.property-report.template-traditional .property-address-banner { background: #15803d; }
.property-report.template-traditional .section-title { color: #166534; border-bottom-color: #166534; font-family: 'Playfair Display', serif; }

.property-report.template-vibrant .header-content { background: linear-gradient(135deg, #be185d 0%, #db2777 100%); }
.property-report.template-vibrant .property-address-banner { background: #06b6d4; }
.property-report.template-vibrant .section-title { color: #be185d; border-bottom-color: #be185d; }
.property-report.template-vibrant .stat-value, .property-report.template-vibrant .detail-value { color: #0891b2; }
