/* ==================================================
   Student Statistics Page
================================================== */

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

:root {
    --primary: #0065d8;
    --primary-dark: #004fae;
    --green: #11a944;
    --purple: #6c2bd9;

    --page-bg: #f4f7fd;
    --card-bg: #ffffff;
    --table-head: #f0f4fc;
    --table-row: #f7f9fd;

    --border: #cbd4e3;
    --text: #10213a;
    --muted: #667085;

    --font-main: "Poppins", "Battambang", sans-serif;
}

/* Apply English and Khmer Font */
.student-statistics-page,
.student-statistics-page * {
    box-sizing: border-box;
    font-family: var(--font-main);
}

.student-statistics-page {
    width: 100%;
    min-height: 100vh;
    padding: 45px 60px;
    box-sizing: border-box;
    background: var(--page-bg);
    color: var(--text);
}

@media (max-width: 1200px) {
    .student-statistics-page {
        padding-left: 40px;
        padding-right: 40px;
    }
}

@media (max-width: 768px) {
    .student-statistics-page {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .student-statistics-page {
        padding: 30px 25px;
    }
}

/* ==================================================
   Header
================================================== */

.statistics-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 30px;
}

.statistics-header .small-title {
    display: block;
    margin-bottom: 2px;
    color: var(--primary);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.statistics-header h1 {
    margin: 0 0 4px;
    color: var(--primary);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
}

.statistics-header p {
    margin: 0;
    color: #42526b;
    font-size: 18px;
    font-weight: 600;
}

/* Academic Year */

.statistics-header form {
    min-width: 140px;
}

.statistics-header form label {
    display: block;
    margin-bottom: 5px;
    color: #344054;
    font-size: 13px;
    font-weight: 500;
    text-align: right;
}

.statistics-header select {
    width: 100%;
    height: 40px;
    padding: 0 36px 0 13px;
    border: 1px solid var(--border);
    border-radius: 3px;
    outline: none;
    background-color: #ffffff;
    color: #101828;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s ease;
}

.statistics-header select:hover,
.statistics-header select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 101, 216, 0.09);
}

/* ==================================================
   Summary Cards
================================================== */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.summary-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 112px;
    padding: 22px 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--card-bg);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
    transition: transform 0.25s ease, box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(20, 50, 90, 0.09);
}

.summary-card span {
    display: block;
    margin-bottom: 1px;
    font-size: 14px;
    font-weight: 500;
}

.summary-card h2 {
    margin: 0;
    color: #101828;
    font-size: 37px;
    font-weight: 700;
    line-height: 1.12;
}

.summary-card p {
    margin: 0;
    color: #596780;
    font-size: 12px;
    font-weight: 400;
}

.summary-card .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 2px;
    font-size: 22px;
}

/* Blue Card */

.summary-card.blue span {
    color: var(--primary);
}

.summary-card.blue .icon {
    background: #edf4ff;
}

/* Green Card */

.summary-card.green span {
    color: #078b2c;
}

.summary-card.green .icon {
    background: #eafbed;
}

/* Purple Card */

.summary-card.purple {
    min-height: 150px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;

    padding: 28px 30px;

    border: 1px solid #ebeef3;
    border-radius: 16px;

    background: #ffffff;

    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.summary-card.purple:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.1);
}

.summary-card-content {
    min-width: 0;
}

.summary-card-label {
    display: block;

    margin-bottom: 8px;

    color: #768196;

    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* .summary-card.purple h2 {
    margin: 0 0 8px;

    color: #102d59;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
} */

.summary-card.purple p {
    margin: 0;

    color: #7b8493;

    font-size: 14px;
}

.summary-card.purple p strong {
    color: #102d59;
    font-weight: 700;
}

/* Clean outline icon */

.summary-card-icon {
    width: 65px;
    height: 65px;
    min-width: 65px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #d4aa22;
    background: transparent;
}

.summary-card-icon svg {
    width: 44px;
    height: 44px;
}

/* Mobile */

@media (max-width: 480px) {
    .summary-card.purple {
        min-height: 125px;
        padding: 22px;
    }

    .summary-card.purple h2 {
        font-size: 30px;
    }

    .summary-card-icon {
        width: 52px;
        height: 52px;
        min-width: 52px;
    }

    .summary-card-icon svg {
        width: 38px;
        height: 38px;
    }
}

.summary-card.purple span {
    color: var(--purple);
}

.summary-card.purple .icon {
    background: #f3edff;
}

/* ==================================================
   Clean Charts
================================================== */

.charts-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(310px, 0.7fr);
    gap: 18px;
    margin-bottom: 28px;
}

.chart-card {
    position: relative;
    min-width: 0;
    height: 410px;
    padding: 24px 26px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #ffffff;
    box-shadow: none;
}

.chart-card h3 {
    margin: 0 42px 16px 0;
    color: #111827;
    font-family: "Poppins", "Battambang", sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
}

.chart-card::after {
    content: "⋮";
    position: absolute;
    top: 23px;
    right: 24px;
    color: #667085;
    font-family: Arial, sans-serif;
    font-size: 23px;
    font-weight: 700;
    line-height: 1;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 325px;
}

.pie-wrapper {
    position: relative;
    width: 100%;
    max-width: 275px;
    height: 315px;
    margin: 0 auto;
}

.chart-wrapper canvas,
.pie-wrapper canvas {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

@media (max-width: 991px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .chart-card {
        height: 400px;
    }

    .chart-wrapper {
        height: 315px;
    }

    .pie-wrapper {
        max-width: 260px;
        height: 305px;
    }
}

@media (max-width: 576px) {
    .chart-card {
        height: 370px;
        padding: 20px 15px;
    }

    .chart-card h3 {
        font-size: 16px;
    }

    .chart-wrapper {
        height: 290px;
    }

    .pie-wrapper {
        max-width: 230px;
        height: 280px;
    }
}

/* ==================================================
   Detail Table
================================================== */

.detail-card {
    padding: 22px 18px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--card-bg);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.detail-card h3 {
    margin: 0 0 15px 6px;
    color: var(--primary);
    font-size: 17px;
    font-weight: 700;
}

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

.detail-card table {
    width: 100%;
    min-width: 700px;
    border-collapse: separate;
    border-spacing: 0;
    color: #162338;
    font-size: 12px;
}

.detail-card th,
.detail-card td {
    padding: 14px 16px;
    border: none;
    text-align: center;
    vertical-align: middle;
}

.detail-card thead th {
    background: var(--table-head);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.detail-card thead th:nth-child(2) {
    text-align: left;
}

.detail-card tbody tr {
    background: #ffffff;
    transition: background-color 0.2s ease;
}

.detail-card tbody tr:nth-child(even) {
    background: var(--table-row);
}

.detail-card tbody tr:hover {
    background: #eaf3ff;
}

.detail-card tbody td {
    border-bottom: 1px solid #eef1f6;
}

.detail-card td.program {
    color: var(--primary);
    font-family: "Poppins", "Battambang", sans-serif;
    font-weight: 500;
    text-align: left;
}

.detail-card .female {
    display: inline-block;
    margin-left: 3px;
    color: #7b879a;
    font-size: 10px;
    font-weight: 400;
}

.detail-card tfoot th {
    background: var(--table-head);
    color: var(--primary);
    font-weight: 700;
}

.detail-card tfoot th:first-child {
    text-align: right;
}

.detail-card tfoot span {
    margin-left: 3px;
    color: #667085;
    font-size: 10px;
    font-weight: 400;
}

/* ==================================================
   No Data
================================================== */

.no-data {
    padding: 60px 25px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #ffffff;
    text-align: center;
}

.no-data h3 {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 20px;
    font-weight: 700;
}

.no-data p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

/* ==================================================
   Responsive
================================================== */

@media (max-width: 991px) {
    .student-statistics-page {
        padding: 25px 20px;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-card:last-child {
        grid-column: span 2;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    /* .chart-card {
        height: 360px;
    } */
}

@media (max-width: 767px) {
    .student-statistics-page {
        padding: 22px 15px;
    }

    .statistics-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .statistics-header h1 {
        font-size: 24px;
    }

    .statistics-header form {
        width: 100%;
    }

    .statistics-header form label {
        text-align: left;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .summary-card:last-child {
        grid-column: auto;
    }

    /* .chart-card {
        height: 340px;
        padding: 20px 15px;
    } */

    /* .chart-wrapper,
    .pie-wrapper {
        height: 265px;
    } */

    .detail-card {
        padding: 20px 12px 12px;
    }
}

@media (max-width: 480px) {
    .student-statistics-page {
        padding: 18px 10px;
    }

    .statistics-header h1 {
        font-size: 22px;
    }

    .statistics-header p {
        font-size: 12px;
    }

    .summary-card {
        min-height: 105px;
        padding: 18px;
    }

    .summary-card h2 {
        font-size: 32px;
    }

    .summary-card span {
        font-size: 13px;
    }

    .summary-card .icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .chart-card h3,
    .detail-card h3 {
        font-size: 15px;
    }
}

/* អក្សរទាំងអស់ក្នុងតារាង */
.detail-card table {
    font-size: 16px;
}

/* ចំណងជើងក្បាលតារាង */
.detail-card table thead th {
    font-size: 16px;
    font-weight: 700;
}

/* ទិន្នន័យក្នុងតារាង */
.detail-card table tbody td {
    font-size: 16px;
    font-weight: 500;
}

/* ឈ្មោះកម្មវិធី */
.detail-card table tbody td.program {
    font-size: 17px;
}

/* អក្សរ Female (F:0) */
.detail-card .female,
.detail-card table tfoot span {
    font-size: 14px;
}

/* ជួរ Total ខាងក្រោម */
.detail-card table tfoot th {
    font-size: 16px;
    font-weight: 700;
}

div.summary-card.purple strong.female-total {
    color: #d1a20b !important;
}

/* C3 Female number */

.summary-card.green .c3-female-total {
    color: #d1a20b !important;
    font-weight: 700 !important;
}

/* Clean green outline icon */

.summary-card.green .green-student-icon {
    width: 65px;
    height: 65px;
    min-width: 65px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #d1a20b !important;
    background: transparent !important;
}

.summary-card.green .green-student-icon svg {
    width: 44px;
    height: 44px;
}

/* រក្សា Font ដើម */

.summary-card.green,
.summary-card.green h2,
.summary-card.green p,
.summary-card.green span,
.summary-card.green strong {
    font-family: inherit;
}

@media (max-width: 480px) {
    .summary-card.green .green-student-icon {
        width: 52px;
        height: 52px;
        min-width: 52px;
    }

    .summary-card.green .green-student-icon svg {
        width: 38px;
        height: 38px;
    }
}

/* ==================================================
   CLEAN SUMMARY CARDS
================================================== */

.summary-card.blue,
.summary-card.green,
.summary-card.purple {
    min-height: 150px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;

    padding: 28px 30px;

    border: 1px solid #ebeef3;
    border-radius: 16px;

    background: #ffffff;

    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.summary-card.blue:hover,
.summary-card.green:hover,
.summary-card.purple:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.1);
}

.summary-card-content {
    min-width: 0;
}

/* Card label */

.summary-card .summary-card-label {
    display: block;

    margin-bottom: 8px;

    color: #768196 !important;

    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* Total number */

.summary-card.blue h2,
.summary-card.green h2,
.summary-card.purple h2 {
    margin: 0 0 8px;

    color: #102d59;

    font-family: inherit;
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
}

/* Female text */

.summary-card.blue p,
.summary-card.green p,
.summary-card.purple p {
    margin: 0;

    color: #7b8493;

    font-family: inherit;
    font-size: 14px;
}

/* Female number ពណ៌លឿង */

.summary-card .female-number {
    color: #d1a20b !important;
    font-family: inherit;
    font-weight: 700 !important;
}

/* Outline icons ពណ៌លឿង */

.summary-card .summary-card-icon {
    width: 65px;
    height: 65px;
    min-width: 65px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #d1a20b !important;
    background: transparent !important;
}

.summary-card .summary-card-icon svg {
    width: 44px;
    height: 44px;

    color: inherit;
    stroke: currentColor;
}

/* Remove old icon background */

.summary-card.blue .icon,
.summary-card.green .icon,
.summary-card.purple .icon {
    background: transparent !important;
}

/* Mobile */

@media (max-width: 480px) {
    .summary-card.blue,
    .summary-card.green,
    .summary-card.purple {
        min-height: 125px;
        padding: 22px;
    }

    .summary-card.blue h2,
    .summary-card.green h2,
    .summary-card.purple h2 {
        font-size: 30px;
    }

    .summary-card .summary-card-icon {
        width: 52px;
        height: 52px;
        min-width: 52px;
    }

    .summary-card .summary-card-icon svg {
        width: 38px;
        height: 38px;
    }
}

/* Clean title color for all summary cards */

.summary-grid .summary-card .summary-card-label,
.summary-grid .summary-card > div:first-child > span {
    display: block;

    margin-bottom: 8px;

    color: #667085 !important;

    font-family: inherit;
    font-size: 13px !important;
    font-weight: 600 !important;

    letter-spacing: 0.5px;
    line-height: 1.4;
    text-transform: uppercase;
}

/* ==================================================
   CLEAN SUMMARY CARDS
================================================== */

.clean-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.clean-summary-card {
    min-width: 0;
    min-height: 240px;

    display: block !important;

    padding: 27px 30px !important;

    border: 1px solid #dfe5ed !important;
    border-radius: 17px !important;

    background: #ffffff !important;

    box-shadow:
        0 2px 3px rgba(15, 23, 42, 0.04),
        0 12px 30px rgba(15, 23, 42, 0.05) !important;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease !important;
}

.clean-summary-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 4px 8px rgba(15, 23, 42, 0.05),
        0 18px 38px rgba(15, 23, 42, 0.1) !important;
}

/* Card header */

.summary-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.summary-card-title {
    margin: 0 !important;
    padding: 0 !important;

    color: #546b89 !important;
    background: transparent !important;
    border: 0 !important;

    font-family: inherit;
    font-size: 13px !important;
    font-weight: 700 !important;

    letter-spacing: 0.45px;
    text-transform: uppercase;
}

/* Icon */

.clean-summary-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #ffd45c;
    border-radius: 13px;

    color: #e09a00;
    background: #fffdf5;

    font-size: 18px;

    box-shadow: 0 5px 15px rgba(224, 154, 0, 0.08);
}

/* Total number នៅកណ្ដាល */

.clean-summary-card .summary-total-number {
    width: 100%;

    margin: 8px 0 24px !important;

    color: #082b5c !important;

    font-family: inherit;
    font-size: 43px !important;
    font-weight: 700 !important;
    line-height: 1.15;

    text-align: center !important;
}

/* Divider */

.summary-divider {
    width: 100%;
    height: 1px;

    margin-bottom: 22px;

    background: #e8edf3;
}

/* Gender row */

.gender-ratio-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    margin-bottom: 17px;
}

.gender-ratio-label {
    margin: 0 !important;

    color: #536987 !important;

    font-size: 13px !important;
    font-weight: 500 !important;

    white-space: nowrap;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.gender-values {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 13px;
}

.gender-values > span {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;

    margin: 0 !important;
    padding: 0 !important;

    color: #243b5a !important;
    background: transparent !important;

    font-size: 12px !important;
    white-space: nowrap;
}

.gender-values strong {
    color: #082b5c;
    font-weight: 700;
}

.gender-values small {
    color: #8a98aa;
    font-size: 11px;
}

/* Male and Female dots */

.male-value > i,
.female-value > i {
    width: 9px;
    height: 9px;
    min-width: 9px;

    display: inline-block;

    border-radius: 50%;
}

.male-value > i {
    background: #2979ed;
    box-shadow: 0 0 0 3px rgba(41, 121, 237, 0.12);
}

.female-value > i {
    background: #f5a300;
    box-shadow: 0 0 0 3px rgba(245, 163, 0, 0.12);
}

.female-value strong {
    color: #dd9200;
}

/* Progress bar */

.gender-progress {
    width: 100%;
    height: 8px;

    display: flex;

    overflow: hidden;

    border: 2px solid #edf1f5;
    border-radius: 999px;

    background: #edf1f5;
}

.gender-progress span {
    display: block !important;
    height: 100%;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    border-radius: 0 !important;
}

.gender-progress {
    width: 100%;
    height: 8px;

    display: flex;

    overflow: hidden;

    border: 2px solid #edf1f5;
    border-radius: 999px;

    background: #edf1f5;
}

.gender-progress .male-progress,
.gender-progress .female-progress {
    width: 0;
    height: 100%;

    display: block !important;
    flex: 0 0 auto;

    margin: 0 !important;
    padding: 0 !important;

    border: 0 !important;
    border-radius: 0 !important;

    animation: genderProgressGrow 1.8s ease-out forwards;
}

.gender-progress .male-progress {
    background: #2979ed !important;
}

.gender-progress .female-progress {
    background: #f5a300 !important;
}

@keyframes genderProgressGrow {
    from {
        width: 0;
    }

    to {
        width: var(--progress-width);
    }
}

/* Responsive */

@media (max-width: 1100px) {
    .clean-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .clean-summary-card:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 767px) {
    .clean-summary-grid {
        grid-template-columns: 1fr;
    }

    .clean-summary-card:last-child {
        grid-column: auto;
    }

    .clean-summary-card {
        padding: 23px 20px !important;
    }

    .gender-ratio-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .gender-values {
        justify-content: flex-start;
    }
}

.clean-summary-icon svg {
    width: 25px;
    height: 25px;

    display: block;

    color: #e09a00;
    stroke: currentColor;
}

.clean-summary-icon.people-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid #ffd15c;
    border-radius: 13px;

    color: #e99700;
    background: #fffdf7;

    box-shadow: 0 5px 13px rgba(233, 151, 0, 0.09);
}

.clean-summary-icon.people-icon svg {
    width: 25px !important;
    height: 25px !important;

    display: block !important;

    color: #e99700 !important;
    stroke: currentColor !important;
    fill: none !important;
}

/* Gender Ratio text size like image 2 */

.gender-ratio-label,
.gender-values > span {
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
}

/* Male and Female numbers */

.gender-values strong {
    color: #082b5c;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
}

/* Female number color */

.gender-values .female-value strong {
    color: #e39a00 !important;
}

/* Percentage */

.gender-values small {
    color: #8a98aa !important;
    font-family: inherit !important;
    font-size: 12px !important;
    font-weight: 400 !important;
}

/* Align all text */

.gender-values {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gender-values .male-value,
.gender-values .female-value {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}   

/* ==================================================
   FORCE SUMMARY CARD FONT SIZE
================================================== */

/* Total C2 Students */

.summary-grid .clean-summary-card
.summary-card-header .summary-card-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}

/* Total number */

.summary-grid .clean-summary-card
h2.summary-total-number {
    font-size: 44px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
}

/* Gender Ratio */

.summary-grid .clean-summary-card
.gender-ratio-row .gender-ratio-label {
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
}

/* Male និង Female */

.summary-grid .clean-summary-card
.gender-values span.male-value,
.summary-grid .clean-summary-card
.gender-values span.female-value {
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
}

/* Male និង Female number */

.summary-grid .clean-summary-card
.gender-values span strong {
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}

/* Percentage */

.summary-grid .clean-summary-card
.gender-values span small {
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
}

/* ==================================================
   PROGRESS ANIMATION
================================================== */

.gender-progress .male-progress,
.gender-progress .female-progress {
    width: var(--progress-width) !important;
    height: 100%;

    transform: scaleX(0);
    transform-origin: left center;

    /* ចូល Page → Animation ម្ដង */
    animation: progressLineGrow 1.3s ease-out forwards;
}



@keyframes progressLineGrow {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

/* =========================================
   C2 and C3 Distribution
========================================= */

.distribution-card {
    position: relative;
    height: 450px;
    padding: 23px 23px 20px;
    overflow: hidden;

    border: 1px solid #edf1f6;
    border-radius: 18px;

    background: #ffffff;

    box-shadow:
        0 10px 35px rgba(15, 23, 42, 0.07);
}

.distribution-card h3 {
    margin: 0 40px 18px 0;

    color: #10213a;

    font-family: "Poppins", "Battambang", sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
}

/* សញ្ញាចុច 3 នៅខាងស្តាំ */
.distribution-card::after {
    content: "⋮";

    position: absolute;
    top: 25px;
    right: 27px;

    color: #94a3b8;

    font-family: Arial, sans-serif;
    font-size: 23px;
    font-weight: 700;
    line-height: 1;
}

/* កន្លែង Doughnut Chart */
.distribution-card .pie-wrapper {
    position: relative;

    width: 100%;
    max-width: 300px;
    height: 345px;

    margin: 0 auto;
}

.distribution-card .pie-wrapper canvas {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    max-width: 100% !important;
    max-height: 100% !important;
}

@media (max-width: 576px) {
    .distribution-card {
        height: 430px;
        padding: 22px 16px 16px;
        border-radius: 14px;
    }

    .distribution-card h3 {
        font-size: 16px;
    }

    .distribution-card .pie-wrapper {
        max-width: 280px;
        height: 335px;
    }
}

/* ប្រអប់ Chart ទាំងពីរកម្ពស់ស្មើគ្នា */
.charts-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.7fr)
        minmax(310px, 0.7fr);

    gap: 18px;
    align-items: stretch;
}

/* ប្រអប់ទាំងពីរកម្ពស់ស្មើគ្នា */
.charts-grid > .chart-card {
    height: 470px;
    min-height: 470px;
}

/* Bar Chart ខាងឆ្វេង */
.charts-grid > .chart-card .chart-wrapper {
    height: 385px;
}

/* Doughnut ខាងស្ដាំ—បន្ថយដើម្បីទុកកន្លែង Legend */
.charts-grid > .distribution-card .pie-wrapper {
    height: 320px;
    max-width: 330px;
}

.charts-grid > .distribution-card {
    overflow: hidden;
}

.charts-grid > .distribution-card .pie-custom-legend {
    width: 100%;
    margin-top: 6px;
}

body .student-statistics-page,
body .student-statistics-page *:not(i):not(svg):not(svg *):not(
    .fa, .fas, .far, .fab,
    .fa-solid, .fa-regular, .fa-brands
) {
    font-family:
        Georgia,
        "Times New Roman",
        "Battambang",
        "Khmer OS Battambang",
        serif !important;

    font-weight: 400 !important;
    font-style: normal !important;
    letter-spacing: normal !important;
    -webkit-text-stroke: 0 !important;
    text-shadow: none !important;
    font-variant-numeric: lining-nums;
}
body .student-statistics-page .gender-ratio-row {
    font-size: 14px !important;
    line-height: 1.5 !important;
}

body .student-statistics-page .gender-ratio-label,
body .student-statistics-page .gender-values,
body .student-statistics-page .gender-values span,
body .student-statistics-page .gender-values strong,
body .student-statistics-page .gender-values small {
    font-size: inherit !important;
    font-weight: 400 !important;
    line-height: inherit !important;
    vertical-align: baseline !important;
    font-variant-numeric: lining-nums !important;
}

@media (max-width: 767px) {
    body .student-statistics-page .gender-ratio-row {
        font-size: 12px !important;
    }
}

body .student-statistics-page .statistics-heading-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;

    margin: 0 0 8px !important;
    font-size: 26px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    color: #10243e;
}

body .student-statistics-page .statistics-heading-title > span {
    font-size: inherit !important;
    white-space: nowrap;
}

body .student-statistics-page .statistics-heading-khmer {
    padding-left: 14px;
    border-left: 2px solid #d1d9e4;
    color: #009bd5;

    font-family:
        "Battambang",
        "Khmer OS Battambang",
        sans-serif !important;
}

body .student-statistics-page .statistics-heading > p {
    margin: 0 !important;
    font-size: 15px !important;
    line-height: 1.6;
    color: #687b93;
}

@media (max-width: 767px) {
    body .student-statistics-page .statistics-heading-title {
        font-size: clamp(15px, 4vw, 20px) !important;
        gap: 8px;
    }

    body .student-statistics-page .statistics-heading-khmer {
        padding-left: 8px;
    }

    body .student-statistics-page .statistics-heading > p {
        font-size: 13px !important;
    }
}
body .student-statistics-page .statistics-year-dropdown {
    position: relative;
    width: 180px;
    text-align: left;
}

body .student-statistics-page .statistics-year-dropdown summary,
body .student-statistics-page .statistics-year-dropdown summary span,
body .student-statistics-page .statistics-year-options button {
    font-family: Georgia, "Times New Roman", serif !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    font-variant-numeric: lining-nums !important;
}

.statistics-year-dropdown summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #d1d9e4;
    border-radius: 8px;
    background: #fff;
    color: #10243e;
    cursor: pointer;
    list-style: none;
}

.statistics-year-dropdown summary::-webkit-details-marker {
    display: none;
}

.statistics-year-dropdown .year-arrow {
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

.statistics-year-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid #d1d9e4;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(16, 36, 62, 0.08);
}

.statistics-year-options button {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #10243e;
    text-align: left;
    cursor: pointer;
}

.statistics-year-options button:hover,
.statistics-year-options button.is-selected {
    background: #eef3ff;
    color: #203866;
}
body .student-statistics-page .statistics-year-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

body .student-statistics-page .statistics-year-dropdown {
    overflow: visible !important;
}

body .student-statistics-page .statistics-year-options {
    margin: 0 !important;
}
body .student-statistics-page .statistics-year-form {
    align-items: flex-end !important;
}

body .student-statistics-page #academicYearLabel {
    width: 98%;
    text-align: right !important;
    margin: 0 !important;
}

/* ==================================================
   FINAL MOBILE PHONE REFINEMENTS
   Appended intentionally to override earlier desktop rules.
   Desktop styles and page logic remain unchanged.
================================================== */

.student-statistics-page {
    min-width: 0;
    max-width: 100%;
}

.student-statistics-page img,
.student-statistics-page canvas,
.student-statistics-page svg {
    max-width: 100%;
}

@media (max-width: 767px) {
    .student-statistics-page {
        width: 100%;
        min-height: 0;
        padding: 22px 14px 34px !important;
        overflow-x: clip;
    }

    .statistics-header {
        display: flex;
        flex-direction: column;
        align-items: stretch !important;
        gap: 14px;
        margin-bottom: 20px;
    }

    .statistics-heading {
        min-width: 0;
        width: 100%;
    }

    body .student-statistics-page .statistics-heading-title {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 4px 9px;
        margin: 0 0 6px !important;
        font-size: clamp(18px, 5vw, 22px) !important;
        line-height: 1.35 !important;
        overflow-wrap: anywhere;
    }

    body .student-statistics-page .statistics-heading-title > span {
        white-space: normal !important;
        max-width: 100%;
    }

    body .student-statistics-page .statistics-heading-khmer {
        padding-left: 9px;
        border-left-width: 1px;
        font-size: 0.9em !important;
        line-height: 1.5 !important;
    }

    body .student-statistics-page .statistics-heading > p {
        max-width: 100%;
        font-size: 13px !important;
        line-height: 1.65 !important;
    }

    body .student-statistics-page .statistics-year-form {
        width: 100%;
        min-width: 0;
        align-items: flex-start !important;
        gap: 6px;
    }

    body .student-statistics-page #academicYearLabel {
        width: auto;
        margin: 0 !important;
        text-align: left !important;
        font-size: 12px !important;
    }

    body .student-statistics-page .statistics-year-dropdown {
        width: min(100%, 220px);
        max-width: 100%;
    }

    body .student-statistics-page .statistics-year-dropdown summary,
    body .student-statistics-page .statistics-year-dropdown summary span {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }

    body .student-statistics-page .statistics-year-options button {
        padding: 9px 10px;
        font-size: 14px !important;
    }

    /* Charts: one column, no desktop fixed-height overflow */
    .student-statistics-page .charts-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px;
        margin-bottom: 18px;
    }

    .student-statistics-page .charts-grid > .chart-card {
        width: 100%;
        min-width: 0;
        height: 350px !important;
        min-height: 0 !important;
        padding: 17px 14px 14px !important;
        border-radius: 12px;
    }

    .student-statistics-page .chart-card h3,
    .student-statistics-page .distribution-card h3 {
        margin: 0 30px 10px 0;
        font-size: 15px !important;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }

    .student-statistics-page .chart-card::after,
    .student-statistics-page .distribution-card::after {
        top: 17px;
        right: 14px;
        font-size: 21px;
    }

    .student-statistics-page .charts-grid > .chart-card .chart-wrapper {
        width: 100%;
        height: 285px !important;
        min-width: 0;
    }

    .student-statistics-page .charts-grid > .distribution-card {
        height: auto !important;
        min-height: 0 !important;
        padding-bottom: 16px !important;
        overflow: visible;
    }

    .student-statistics-page .charts-grid > .distribution-card .pie-wrapper {
        width: 100%;
        max-width: 260px !important;
        height: 235px !important;
        margin: 0 auto;
    }

    .student-statistics-page .charts-grid > .distribution-card .pie-custom-legend {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 12px;
        width: 100%;
        margin-top: 7px;
        font-size: 12px;
    }

    /* Summary cards */
    .student-statistics-page .clean-summary-grid,
    .student-statistics-page .summary-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 13px;
        margin-bottom: 20px;
    }

    .student-statistics-page .clean-summary-card,
    .student-statistics-page .summary-card.blue,
    .student-statistics-page .summary-card.green,
    .student-statistics-page .summary-card.purple {
        grid-column: auto !important;
        min-width: 0;
        min-height: 0 !important;
        padding: 18px 16px !important;
        border-radius: 14px !important;
    }

    .student-statistics-page .summary-card-header {
        gap: 10px;
    }

    .student-statistics-page .summary-grid .clean-summary-card .summary-card-header .summary-card-title {
        font-size: 15px !important;
        line-height: 1.45 !important;
        overflow-wrap: anywhere;
    }

    .student-statistics-page .clean-summary-icon,
    .student-statistics-page .clean-summary-icon.people-icon {
        width: 42px;
        height: 42px;
        min-width: 42px;
        border-radius: 11px;
    }

    .student-statistics-page .clean-summary-icon svg,
    .student-statistics-page .clean-summary-icon.people-icon svg {
        width: 22px !important;
        height: 22px !important;
    }

    .student-statistics-page .summary-grid .clean-summary-card h2.summary-total-number {
        margin: 9px 0 15px !important;
        font-size: clamp(32px, 9vw, 38px) !important;
        line-height: 1.1 !important;
    }

    .student-statistics-page .summary-divider {
        margin-bottom: 14px;
    }

    .student-statistics-page .gender-ratio-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 12px;
        font-size: 12px !important;
        line-height: 1.5 !important;
    }

    .student-statistics-page .gender-ratio-label {
        white-space: normal;
        font-size: 12px !important;
    }

    .student-statistics-page .gender-values {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px 12px;
        width: 100%;
    }

    .student-statistics-page .gender-values > span,
    .student-statistics-page .gender-values strong,
    .student-statistics-page .gender-values small {
        font-size: 12px !important;
        line-height: 1.5 !important;
    }

    .student-statistics-page .gender-progress {
        height: 7px;
    }

    /* Detail table scrolls inside its own card, not the page */
    .student-statistics-page .detail-card {
        min-width: 0;
        padding: 17px 12px 12px;
        border-radius: 12px;
    }

    .student-statistics-page .detail-card h3 {
        margin: 0 0 12px 2px;
        font-size: 16px;
        line-height: 1.45;
    }

    .student-statistics-page .table-responsive {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        border-radius: 8px;
    }

    .student-statistics-page .detail-card table {
        width: max-content;
        min-width: 660px;
        font-size: 13px;
    }

    .student-statistics-page .detail-card th,
    .student-statistics-page .detail-card td {
        padding: 10px 11px;
        font-size: 13px !important;
        line-height: 1.5;
        white-space: normal;
    }

    .student-statistics-page .detail-card td.program {
        min-width: 170px;
        font-size: 13px !important;
        overflow-wrap: anywhere;
    }

    .student-statistics-page .detail-card .female,
    .student-statistics-page .detail-card tfoot span {
        font-size: 11px !important;
        white-space: nowrap;
    }

    .student-statistics-page .no-data {
        padding: 34px 16px;
        border-radius: 12px;
    }

    .student-statistics-page .no-data h3 {
        font-size: 18px;
    }

    .student-statistics-page .no-data p {
        font-size: 13px;
        line-height: 1.7;
    }
}

@media (max-width: 480px) {
    .student-statistics-page {
        padding: 18px 10px 28px !important;
    }

    .student-statistics-page .statistics-header {
        gap: 12px;
        margin-bottom: 16px;
    }

    body .student-statistics-page .statistics-heading-title {
        font-size: clamp(17px, 5vw, 20px) !important;
        gap: 4px 7px;
    }

    body .student-statistics-page .statistics-heading-title > span:first-child {
        white-space: normal !important;
    }

    body .student-statistics-page .statistics-heading-khmer {
        padding-left: 7px;
    }

    .student-statistics-page .charts-grid {
        gap: 12px;
    }

    .student-statistics-page .charts-grid > .chart-card {
        height: 330px !important;
        padding: 15px 12px 12px !important;
    }

    .student-statistics-page .charts-grid > .chart-card .chart-wrapper {
        height: 265px !important;
    }

    .student-statistics-page .charts-grid > .distribution-card .pie-wrapper {
        max-width: 235px !important;
        height: 220px !important;
    }

    .student-statistics-page .summary-grid .clean-summary-card .summary-card-header .summary-card-title {
        font-size: 14px !important;
    }

    .student-statistics-page .summary-grid .clean-summary-card h2.summary-total-number {
        font-size: 34px !important;
    }
}

@media (max-width: 360px) {
    .student-statistics-page {
        padding-right: 8px !important;
        padding-left: 8px !important;
    }

    body .student-statistics-page .statistics-heading-title {
        font-size: 17px !important;
    }

    .student-statistics-page .charts-grid > .chart-card {
        padding-right: 10px !important;
        padding-left: 10px !important;
    }

    .student-statistics-page .gender-values {
        gap: 7px 10px;
    }
}
