@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Sidebar & Header - Keep existing blues */
    --primary-blue: #004e89;
    --dark-blue: #003d6b;
    --light-blue: #e6f0f7;
    --sidebar-bg: #004e89;
    --accent-blue: #1a659e;

    /* Paper aesthetic - warm and natural */
    --bg-surface: #eae7e1;          /* Desk/background surface */
    --bg-paper: #fefdfb;             /* Paper/section background */
    --text-primary: #37352f;         /* Ink - soft brown-gray */
    --text-secondary: #6b6960;       /* Secondary text - lighter ink */
    --text-light: #6b6960;           /* Fallback for light text */
    --border-color: #e6e3dc;         /* Soft pencil-like borders */
    --accent-color: #bfa094;         /* Earthy terracotta accent */

    /* Semantic colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: white;
    padding: 35px 30px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.header h1 {
    font-size: 2.2em;
    margin-bottom: 8px;
    font-weight: 700;
}

.header p {
    font-size: 1em;
    opacity: 0.95;
    font-weight: 400;
}

/* Mobile hamburger button */
.header-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.4em;
    transition: all 0.3s ease;
}

.header-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Main Layout - Sidebar + Content */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Tab Content - Ensure flex layout for sidebar + main content */
.tab-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0f172a 100%);
    color: white;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    border-right: 3px solid var(--primary-blue);
    transition: width 0.3s ease;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.sidebar.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.sidebar-content {
    padding: 25px 20px;
}

.sidebar.collapsed .sidebar-content {
    padding: 0;
}

/* Filter Sections */
.filter-section {
    margin-bottom: 28px;
    transition: all 0.3s ease;
}

.filter-section:first-child {
    margin-top: 0;
}

.sidebar.collapsed .filter-section {
    margin-bottom: 0;
    padding: 8px 0;
    display: flex;
    justify-content: center;
}

.filter-title {
    font-size: 0.95em;
    font-weight: 700;
    color: white;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .filter-title {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* Filter Select */
.filter-select {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--accent-blue);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:hover {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
    background: white;
}

.sidebar.collapsed .filter-select {
    display: none;
}

/* Filter Group */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Checkbox & Radio Styling */
.filter-checkbox,
.filter-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.95em;
    font-weight: 500;
}

.filter-checkbox:hover,
.filter-radio:hover {
    background: rgba(59, 130, 246, 0.15);
}

.filter-checkbox input[type="checkbox"],
.filter-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-blue);
}

.filter-checkbox span,
.filter-radio span {
    color: white;
    user-select: none;
}

/* Action Buttons */
.filter-actions {
    display: flex;
    gap: 12px;
    flex-direction: column;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.sidebar.collapsed .filter-actions {
    display: none;
}

.btn-primary,
.btn-secondary {
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--primary-blue) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Info Box */
.info-box {
    background: rgba(59, 130, 246, 0.15);
    border-left: 4px solid var(--accent-blue);
    padding: 16px;
    border-radius: 8px;
    margin-top: 25px;
    transition: all 0.3s ease;
}

.sidebar.collapsed .info-box {
    display: none;
}

.info-box h4 {
    color: white;
    font-size: 0.95em;
    margin-bottom: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.info-box li {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85em;
    margin-bottom: 8px;
    padding-left: 0;
    line-height: 1.5;
}

.info-box li:last-child {
    margin-bottom: 0;
}

/* Main Content Area */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
    background: var(--bg-surface);
}

.report-container {
    max-width: 297mm;
    margin: 0 auto;
    min-height: 400px;
}

.empty-state {
    text-align: center;
    padding: 80px 40px;
    color: var(--text-secondary);
    font-size: 1.2em;
    background: var(--bg-paper);
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* Loading Text */
#loading-text {
    color: var(--accent-blue) !important;
    font-weight: 600;
    font-size: 1.1em;
}

/* Sections */
.section {
    margin-bottom: 40px;
    background: var(--bg-paper);
    padding: 30px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--accent-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
}

.section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    background-image:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    border-radius: 2px;
    z-index: 1;
}

.section > * {
    position: relative;
    z-index: 2;
}

.section:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 6px 16px rgba(0, 0, 0, 0.06);
}

.section-title {
    font-family: 'Merriweather', 'Georgia', serif;
    font-size: 1.6em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.01em;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 30px;
    background: var(--accent-color);
    border-radius: 1px;
}

.section-components {
    display: grid;
    gap: 30px;
}

.section-components.layout-single {
    grid-template-columns: 1fr;
}

.section-components.layout-two-column {
    grid-template-columns: repeat(2, 1fr);
}

.section-components.layout-three-column {
    grid-template-columns: repeat(3, 1fr);
}

.section-components.layout-four-column {
    grid-template-columns: repeat(4, 1fr);
}

/* Component */
.component {
    background: var(--bg-paper);
    padding: 25px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
}

.component::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    background-image:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    border-radius: 2px;
    z-index: 1;
}

.component > * {
    position: relative;
    z-index: 2;
}

.component:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 6px 16px rgba(0, 0, 0, 0.06);
}

.component-title {
    font-family: 'Merriweather', 'Georgia', serif;
    font-size: 1.2em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: -0.01em;
}

/* Text Component */
.component-text {
    line-height: 1.7;
    color: var(--text-primary);
    font-size: 1em;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.component-text h3,
.component-text h4 {
    font-family: 'Merriweather', 'Georgia', serif;
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 1.15em;
    letter-spacing: -0.01em;
}

.component-text h3:first-child,
.component-text h4:first-child {
    margin-top: 0;
}

.component-text p {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.component-text ul,
.component-text ol {
    margin-left: 25px;
    margin-bottom: 15px;
}

.component-text li {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.component-text strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* Chart Component */
.component-chart {
    position: relative;
    height: 420px;
}

.component-chart canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Table Component */
.component-table {
    overflow-x: auto;
}

.component-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.component-table thead {
    background: var(--accent-color);
    color: white;
}

.component-table th {
    padding: 15px;
    text-align: left;
    font-weight: 700;
    border: none;
    font-size: 0.95em;
}

.component-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.component-table tbody tr:hover {
    background: rgba(191, 160, 148, 0.1);
}

.component-table tbody tr:nth-child(even) {
    background: rgba(191, 160, 148, 0.04);
}

/* Map Component */
.component-map {
    position: relative;
    height: 280px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.component-map #map {
    width: 100%;
    height: 100%;
}

/* Choropleth Map Component */
.component-choropleth {
    position: relative;
    height: 350px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.component-choropleth > div {
    width: 100%;
    height: 100%;
}

/* Choropleth tooltip styling */
.choropleth-tooltip {
    background: white !important;
    border: 1px solid #333 !important;
    border-radius: 4px !important;
    padding: 6px 10px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
    font-size: 12px !important;
}

.choropleth-tooltip strong {
    font-weight: bold;
    display: block;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue);
}

/* Responsive Design - Tablet */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
        padding: 20px 0;
    }

    .sidebar-content {
        padding: 0 16px;
    }

    .filter-title {
        font-size: 0.9em;
    }

    .section-components.layout-two-column {
        grid-template-columns: 1fr;
    }

    .section-components.layout-three-column {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-components.layout-four-column {
        grid-template-columns: repeat(2, 1fr);
    }

    .main-content {
        padding: 20px 30px;
    }

    .component-chart {
        height: 380px;
    }

    .component-map {
        height: 300px;
    }

    .component-choropleth {
        height: 320px;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    body {
        display: flex;
        flex-direction: column;
    }

    .main-layout {
        flex-direction: row;
        min-height: 0;
        flex: 1;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 85vw;
        max-width: 320px;
        height: 100vh;
        z-index: 1000;
        border-right: 3px solid var(--primary-blue);
        border-bottom: none;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding: 0;
        flex-shrink: 0;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .sidebar-content {
        padding: 20px 15px;
        height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .main-content {
        padding: 15px;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        width: 100%;
    }

    .report-container {
        max-width: 100%;
    }

    .sidebar-header {
        display: none;
    }

    .sidebar-toggle {
        display: none !important;
    }

    .header {
        padding: 20px 15px;
        gap: 15px;
    }

    .header > div {
        flex: 1;
    }

    .header h1 {
        font-size: 1.4em;
        margin-bottom: 2px;
    }

    .header p {
        font-size: 0.8em;
    }

    .header-menu-toggle {
        display: block !important;
        flex-shrink: 0;
    }

    .section {
        padding: 20px;
        margin-bottom: 25px;
    }

    .section-title {
        font-size: 1.3em;
    }

    .component {
        padding: 15px;
    }

    .component-title {
        font-size: 1.05em;
    }

    .component-chart {
        height: 340px;
    }

    .component-map {
        height: 280px;
    }

    .component-choropleth {
        height: 300px;
    }

    .empty-state {
        padding: 50px 20px;
        font-size: 1em;
    }

    .filter-section {
        margin-bottom: 20px;
    }

    .filter-title {
        font-size: 0.85em;
    }

    .filter-select,
    .btn-primary,
    .btn-secondary {
        font-size: 0.9em;
        padding: 10px 12px;
    }

    .filter-actions {
        flex-direction: row;
        gap: 10px;
    }

    .btn-primary,
    .btn-secondary {
        flex: 1;
        padding: 10px;
        font-size: 0.85em;
    }

    .info-box {
        margin-top: 15px;
        padding: 12px;
    }

    .info-box h4 {
        font-size: 0.85em;
        margin-bottom: 8px;
    }

    .info-box li {
        font-size: 0.8em;
        margin-bottom: 6px;
    }
}

/* Responsive Design - Small Mobile */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.4em;
    }

    .sidebar {
        max-height: 60vh;
    }

    .filter-title {
        font-size: 0.8em;
    }

    .section-title {
        font-size: 1.2em;
    }

    .component-title {
        font-size: 1em;
    }

    .component-text {
        font-size: 0.9em;
    }

    .component-table {
        font-size: 0.8em;
    }

    .component-table th,
    .component-table td {
        padding: 8px;
    }

    .filter-select {
        font-size: 0.85em;
        padding: 9px 12px;
    }

    .btn-primary,
    .btn-secondary {
        font-size: 0.8em;
        padding: 9px;
    }
}

/* ============== Print Styles for PDF Export ============== */

@media print {
    /* Hide non-essential UI elements */
    .header {
        background: white !important;
        color: var(--text-primary) !important;
        box-shadow: none !important;
        border-bottom: 3px solid var(--primary-blue);
        padding: 20px 30px;
        margin-bottom: 20px;
    }

    .header h1 {
        color: var(--primary-blue) !important;
        font-size: 1.8em !important;
        margin: 0 0 8px 0 !important;
    }

    .header p {
        color: var(--text-light) !important;
        opacity: 1 !important;
        margin: 0 !important;
    }

    .main-layout {
        display: block !important;
    }

    .tab-navigation {
        display: none !important;
    }

    .sidebar {
        display: none !important;
    }

    .main-content {
        padding: 0 !important;
        overflow: visible !important;
        flex: none !important;
    }

    .report-container {
        max-width: 100% !important;
        margin: 0 !important;
    }

    .empty-state {
        display: none !important;
    }

    #loading-text {
        display: none !important;
    }

    .builder-container {
        display: none !important;
    }

    /* Page setup for printing */
    body {
        background: var(--bg-paper) !important;
        font-size: 11pt;
        line-height: 1.4;
        color: var(--text-primary);
    }

    /* Section styles for print */
    .section {
        page-break-inside: avoid;
        margin-bottom: 25px;
        padding: 20px 0;
        background: var(--bg-paper) !important;
        border: none !important;
        border-bottom: 1px solid #ccc;
        box-shadow: none !important;
    }

    .section::before {
        display: none !important;
    }

    .section:last-child {
        border-bottom: none;
    }

    .section-title {
        font-size: 1.4em !important;
        margin: 0 0 15px 0 !important;
        color: var(--text-primary) !important;
        page-break-after: avoid;
    }

    .section-title::before {
        display: none !important;
    }

    .section-components {
        gap: 15px !important;
    }

    .section-components.layout-two-column {
        grid-template-columns: 1fr !important;
    }

    .section-components.layout-three-column {
        grid-template-columns: 1fr !important;
    }

    .section-components.layout-four-column {
        grid-template-columns: 1fr !important;
    }

    /* Component styles for print */
    .component {
        page-break-inside: avoid;
        margin-bottom: 15px;
        padding: 15px 0;
        border: none !important;
        border-bottom: 1px solid #e0e0e0;
        background: var(--bg-paper) !important;
        box-shadow: none !important;
    }

    .component::before {
        display: none !important;
    }

    .component:last-child {
        border-bottom: none;
    }

    .component-title {
        font-size: 1.1em !important;
        margin: 0 0 12px 0 !important;
        border: none !important;
        color: var(--text-primary) !important;
        padding: 0 !important;
        page-break-after: avoid;
    }

    /* Text component */
    .component-text {
        font-size: 10pt;
        line-height: 1.5;
    }

    .component-text h3,
    .component-text h4 {
        margin-top: 8px !important;
        margin-bottom: 6px !important;
        font-size: 1em !important;
    }

    .component-text h3:first-child,
    .component-text h4:first-child {
        margin-top: 0 !important;
    }

    .component-text p {
        margin-bottom: 6px !important;
    }

    /* Chart component */
    .component-chart {
        page-break-inside: avoid;
        height: 360px !important;
        margin: 10px 0 !important;
    }

    .component-chart canvas {
        max-width: 100%;
        height: auto !important;
    }

    /* Table component */
    .component-table {
        page-break-inside: avoid;
    }

    .component-table table {
        width: 100%;
        font-size: 9pt;
        border-collapse: collapse;
    }

    .component-table thead {
        background: var(--accent-color) !important;
        color: white !important;
    }

    .component-table th {
        padding: 10px 8px !important;
        border: 1px solid #ccc !important;
        font-weight: 700 !important;
        font-size: 9pt !important;
        text-align: left;
    }

    .component-table td {
        padding: 8px !important;
        border: 1px solid #ddd !important;
        color: var(--text-primary);
        font-size: 9pt;
    }

    .component-table tbody tr:hover {
        background: white !important;
    }

    .component-table tbody tr:nth-child(even) {
        background: white !important;
    }

    /* Map component */
    .component-map {
        page-break-inside: avoid;
        height: 220px !important;
        border: 1px solid #ccc !important;
        margin: 10px 0 !important;
    }

    .component-map #map {
        width: 100%;
        height: 100%;
    }

    /* Choropleth map component */
    .component-choropleth {
        page-break-inside: avoid;
        height: 280px !important;
        border: 1px solid #ccc !important;
        margin: 10px 0 !important;
    }

    .component-choropleth > div {
        width: 100%;
        height: 100%;
    }

    /* Remove interactive elements from print */
    button,
    .btn-primary,
    .btn-secondary,
    input,
    select,
    textarea {
        display: none !important;
    }

    /* Links should be black in print */
    a {
        color: var(--primary-blue) !important;
        text-decoration: underline !important;
    }

    /* Print quality improvements */
    img {
        max-width: 100%;
        height: auto !important;
    }

    /* Scrollbars not visible in print */
    ::-webkit-scrollbar {
        display: none !important;
    }

    /* Add metadata header for filtered reports */
    .print-metadata {
        page-break-after: avoid;
        margin-bottom: 15px;
        padding: 12px;
        background: rgba(191, 160, 148, 0.1);
        border-left: 4px solid var(--accent-color);
        font-size: 9pt;
        color: var(--text-primary);
    }

    .print-metadata strong {
        display: block;
        margin-bottom: 6px;
        color: var(--accent-color);
    }

    /* Ensure good contrast for print */
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Adjust margins */
    @page {
        margin: 0.5in 0.75in;
    }
}
