:root {
    --primary: #007bff;
    --secondary: #f8f9fa;
    --accent: #28a745;
    --danger: #dc3545;
    --dark: #343a40;
    --light: #fff;
    --gray: #6c757d;
    --border-radius: 10px;
    --header-bg: #B22222;
    --header-text: #fff;
    --posb-title: #b71c1c;
    --posb-subtitle: #1976d2;
    --posb-table-header: #1565c0;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #f2f6fc 0%, #e9ebf1 100%);
    margin: 0;
    padding: 0;
}

.main-header {
    width: 100%;
    background: var(--header-bg);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
}

.header-title {
    font-weight: bold;
    font-size: 1.4rem;
    color: var(--header-text);
    letter-spacing: 0.5px;
    text-align: center;
    width: 100%;
    line-height: 1;
}

.container {
    max-width: 1250px;
    margin: 2rem auto;
    background: var(--light);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-top:5px;
}

.filter-box {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid pink;
    border-bottom-width: 2px;
    background-color: #fff;
}

.selector {
    flex: 1 1 180px;
    min-width: 180px;
    margin: 0;
    padding: 0;
    border: 2px solid rgb(207, 168, 174);
    border-bottom-width: 4px;
    border-radius: 4px;
    background-color: #fff;
}

.selector select {
    width: 100%;
    padding: 0.45rem 0.5rem;
    border-radius: 7px;
    border: 1px solid var(--gray);
    background: var(--secondary);
    font-size: 1rem;
    margin: 0;
    transition: border 0.2s;
}


.report-prompt {
    background: var(--secondary);
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(156, 86, 86, 0.06);
    font-size: 1.3rem;
    font-weight: 700;
    color: #2907a2;
    text-align: center;
    margin: 1rem auto;
    padding: 2rem;
    width: 99%;
    max-width: 1100px;
}

.report-position-table-title {
    text-align: center;
    margin: 1em 0 0.5em 0;
    font-size: 1em;
    font-weight: bold;
    color: #1976d2;
    width: 100%;
    display: block;
}
.report-position-table-title span, 
.report-position-table-title strong {
    display: inline-block;
    text-align: center;
    width: 100%;
}
.export-btn-block {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.3rem;
}

.export-btn {
    padding: 0.5rem 1.2rem;
    margin-top:-10px;
    background: var(--primary);
    color: var(--light);
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: background 0.2s;
    min-width: 120px;
}

.export-btn:hover {
    background: #0056b3;
}

.report-section {
    margin-bottom: 2.5rem;
    background: var(--secondary);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    padding: 1.5rem;
    overflow-x: auto;
    position: relative;
}

.report-section h2,
.report-section h3 {
    text-align: center;
    margin-bottom: 0.5rem;
    margin-top: 0;
    font-weight: 800;
    width: 100%;
}

.report-section h2 {
    color: var(--posb-title);
    font-size: 1.3rem;
    letter-spacing: 0.5px;
    font-weight: 800;
    margin-top:-40px;
}

.report-section h3 {
    color: var(--posb-subtitle);
    font-size: 1.07rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.table-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.data-table {
    border-collapse: collapse;
    margin-bottom: 1.2rem;
    background: var(--light);
    border-radius: var(--border-radius);
    overflow: hidden;
    min-width: 700px;
    width: unset;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.data-table th, .data-table td {
    padding: 0.5rem 0.48rem;
    border-bottom: 1px solid #dee2e6;
    text-align: center;
    white-space: nowrap;
    font-size: 0.96rem;
}

.data-table th {
    background-color: var(--posb-table-header);
    color: var(--light);
    font-weight: bold;
    font-size: 1.01rem;
    position: sticky;
    top: 0;
    z-index: 2;
    letter-spacing: 0.5px;
}

.data-table tr:last-child td {
    font-weight: bold;
    background: #bcc4cc;
    color:#B22222;
}

.report-position-table-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.report-position-table {
    border-collapse: collapse;
    margin-bottom: 0.7rem;
    min-width: 440px;
    width: unset;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.report-position-table th,
.report-position-table td {
    padding: 0.5rem 0.48rem;
    border-bottom: 1px solid #dee2e6;
    text-align: center;
    white-space: nowrap;
    font-size: 0.94rem;
}

.report-position-table th {
    background: var(--posb-table-header);
    color: var(--light);
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 2;
    letter-spacing: 0.5px;
}

/* Tablets (portrait and landscape) */
@media (max-width: 1024px) {
    .container {
        max-width: 98vw;
        padding: 1rem;
    }
    .data-table, .report-position-table {
        min-width: 500px;
    }
    .filter-box {
        display: flex;
        flex-wrap: wrap;
        gap: 1; /* Remove gap between selectors */
        justify-content: center;
        margin-bottom: 2rem;
    }
    .selector {
        flex: 1 1 180px;
        min-width: 210px;
        margin: 0;
        padding: 0;
    }
}

/* Phones (landscape and portrait), iPhones, iPods */
@media (max-width: 650px) {
    .container {
        padding: 0.2rem;
        max-width: 100vw;
    }
    .main-header {
        min-height: 34px;
    }
    .header-title {
        font-size: 0.96rem;
        padding: 0.1rem 0;
    }
    .filter-box {
        display: flex;
        flex-wrap: wrap;
        gap: 2; /* Remove gap between selectors */
        justify-content: center;
        margin-bottom: 5rem;
    }
    .selector {
        flex: 1 1 180px;
        min-width: 210px;
        margin: 0;
        padding: 0;
    }
    .selector select {
        margin: 0.2rem;
        padding: 0.15rem 0.07rem;
        font-size: 1rem;
        color:#000000;
    }
    .report-section {
        padding: 0.5rem;
        margin-bottom:-20px;
    }
    .report-section h2,
    .report-section h3 {
        position: relative;
        left: 0;
        margin-top:20px;
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(-1 * ((100vw - 100%) / 2));
        padding-left: 0;
        padding-right: 0;
        box-sizing: border-box;
        background: var(--secondary);
        z-index: 50;
    }
    .export-btn-block {
        width: 100vw;
        max-width: 100vw;
        justify-content: flex-end;
        margin-bottom: 0.25rem;
        /* Move button a little up in mobile view */
        margin-top: -14px;
    }
    .export-btn {
        margin-top: 40px; /* Move button up in mobile view */
    }
    .table-wrap, .report-position-table-wrap {
        justify-content: flex-start;
        align-items: flex-start;
        width: 100vw;
        overflow-x: auto;
    }
    .data-table, .report-position-table {
        min-width: 280px;
        font-size: 0.88rem;
    }
    .report-prompt {
        margin: -4rem auto;
        }
}

/* Even smaller screens (older iPhones, iPod Touch) */
@media (max-width: 375px) {
    .container {
        padding: 0.05rem;
    }
    .header-title {
        font-size: 1.3rem;
    }
    .selector select {
        padding: 0.10rem 0.03rem;
        font-size: 1rem;
    }
    .data-table, .report-position-table {
        font-size: 0.82rem;
        min-width: 220px;
    }
    .report-section h2, .report-section h3 {
        font-size: 0.95rem;
    }
}