/* =========================================================
   Alternative UI Design for Report Page
   Works with your existing PHP code exactly as it is
   File: assets/css/report.css
   ========================================================= */

:root {
    --primary: #0f4cdd;
    --primary-light: #e8f0ff;
    --primary-dark: #0a2f8f;
    --green: #16a34a;
    --green-light: #e8f8ee;
    --orange: #ea580c;
    --orange-light: #fff1e8;
    --text-dark: #0f172a;
    --text: #1e293b;
    --text-soft: #64748b;
    --border: #e2e8f0;
    --white: #ffffff;
    --surface: #f8fbff;
    --page: #eef5ff;
    --shadow-1: 0 10px 30px rgba(15, 23, 42, 0.06);
    --shadow-2: 0 18px 50px rgba(15, 23, 42, 0.08);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    background:
        linear-gradient(180deg, rgba(15, 76, 221, 0.05), rgba(15, 76, 221, 0) 220px),
        linear-gradient(135deg, #f7fbff 0%, #edf4ff 50%, #f7fbff 100%);
    color: var(--text);
}

/* =========================
   PAGE
   ========================= */

.report-page {
    width: 100%;
    min-height: 100vh;
    padding: 28px;
}

/* =========================
   HEADER
   ========================= */

.report-header {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 22px;
    align-items: stretch;
    margin-bottom: 24px;
}

.report-header > div:first-child {
    position: relative;
    overflow: hidden;
    padding: 34px;
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at top right, rgba(15, 76, 221, 0.14), transparent 28%),
        linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(15, 76, 221, 0.08);
    box-shadow: var(--shadow-2);
}

.report-header > div:first-child::after {
    content: "";
    position: absolute;
    right: -40px;
    bottom: -40px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(15, 76, 221, 0.05);
}

.report-header span {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--primary-light);
}

.report-header h1 {
    margin: 0;
    color: var(--text-dark);
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -0.04em;
}

.report-header p {
    margin: 12px 0 0;
    max-width: 720px;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.7;
    font-weight: 500;
}

.report-total-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 20px;
    border-radius: var(--radius-xl);
    background:
        linear-gradient(145deg, #0f4cdd 0%, #2563eb 50%, #0a2f8f 100%);
    color: var(--white);
    box-shadow: 0 22px 44px rgba(15, 76, 221, 0.26);
}

.report-total-card small {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 800;
    opacity: 0.92;
}

.report-total-card strong {
    display: block;
    font-size: 42px;
    font-weight: 950;
    line-height: 1;
}

/* =========================
   FILTER CARD
   ========================= */

.filter-card {
    margin-bottom: 24px;
    padding: 26px;
    border-radius: var(--radius-xl);
    background: var(--white);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: var(--shadow-1);
}

.filter-title {
    margin-bottom: 18px;
}

.filter-title h2 {
    margin: 0;
    color: var(--text-dark);
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.filter-title p {
    margin: 7px 0 0;
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.6;
}

.filter-form {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 800;
    color: #334155;
}

.form-group select {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fbfdff;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 700;
    outline: none;
    transition: 0.25s ease;
}

.form-group select:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(15, 76, 221, 0.10);
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.btn-filter,
.btn-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding: 0 18px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: 0.25s ease;
    white-space: nowrap;
}

.btn-filter {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    box-shadow: 0 14px 28px rgba(15, 76, 221, 0.22);
}

.btn-filter:hover {
    transform: translateY(-2px);
}

.btn-reset {
    background: #f1f5f9;
    color: #334155;
}

.btn-reset:hover {
    background: #e2e8f0;
}

/* =========================
   REPORT LIST CARD
   ========================= */

.report-list-card {
    padding: 26px;
    border-radius: var(--radius-xl);
    background: var(--white);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: var(--shadow-1);
}

.report-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.report-list-header h2 {
    margin: 0;
    color: var(--text-dark);
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.report-list-header p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 14px;
}

/* =========================
   TABLE WRAP
   ========================= */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

/* =========================
   TABLE STYLE - COMPLETELY DIFFERENT LOOK
   ========================= */

.report-table {
    width: 100%;
    min-width: 740px;
    border-collapse: separate;
    border-spacing: 0 14px;
}

.report-table thead th {
    padding: 0 14px 10px;
    text-align: left;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-soft);
}

.report-table tbody td {
    padding: 18px 14px;
    background: #fdfefe;
    border-top: 1px solid #edf2f7;
    border-bottom: 1px solid #edf2f7;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    vertical-align: middle;
}

.report-table tbody td:first-child {
    border-left: 1px solid #edf2f7;
    border-radius: 20px 0 0 20px;
    width: 70px;
}

.report-table tbody td:last-child {
    border-right: 1px solid #edf2f7;
    border-radius: 0 20px 20px 0;
}

.report-table tbody tr {
    transition: 0.25s ease;
}

.report-table tbody tr:hover td {
    /*background: #f8fbff;*/
}

/* =========================
   ASSESSMENT BOX
   ========================= */

.assessment-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.assessment-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(135deg, #4f8cff, #2d6df6);
    color: var(--white);
    font-size: 22px;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(45, 109, 246, 0.18);
}

.assessment-box strong {
    display: block;
    color: var(--text-dark);
    font-size: 15px;
    font-weight: 900;
    line-height: 1.3;
}

.assessment-box small {
    display: block;
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
}

/* =========================
   STATUS BADGES
   ========================= */

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 108px;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.status-ready {
    background: var(--green-light);
    color: #067647;
    border: 1px solid #b7ebc8;
}

.status-ready::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.status-pending {
    background: var(--orange-light);
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.status-pending::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange);
}

/* =========================
   DOWNLOAD BUTTONS
   ========================= */

.btn-download,
.btn-disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 122px;
    height: 46px;
    padding: 0 18px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.btn-download {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: var(--white);
    box-shadow: 0 12px 22px rgba(22, 163, 74, 0.18);
    transition: 0.25s ease;
}

.btn-download:hover {
    transform: translateY(-2px);
}

.btn-download::before {
    content: "↓";
    font-size: 14px;
    margin-right: 7px;
    line-height: 1;
}

.btn-disabled {
    background: #e2e8f0;
    color: #64748b;
    border: none;
    cursor: not-allowed;
}

/* =========================
   EMPTY BOX
   ========================= */

.empty-box {
    padding: 54px 20px;
    text-align: center;
}

.empty-box h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
    color: var(--text-dark);
}

.empty-box p {
    margin: 8px auto 0;
    max-width: 460px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-soft);
}

/* =========================
   PAGINATION
   ========================= */

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.page-link {
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--white);
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
    transition: 0.25s ease;
}

.page-link:hover,
.page-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    box-shadow: 0 10px 20px rgba(15, 76, 221, 0.16);
}

/* =========================
   TABLET
   ========================= */

@media (max-width: 1100px) {
    .report-page {
        padding: 22px;
    }

    .report-header {
        grid-template-columns: 1fr;
    }

    .filter-form {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-actions {
        grid-column: span 2;
    }
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 768px) {
    .report-page {
        padding: 16px;
    }

    .report-header {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .report-header > div:first-child,
    .report-total-card,
    .filter-card,
    .report-list-card {
        border-radius: 22px;
    }

    .report-header > div:first-child {
        padding: 24px;
    }

    .report-header h1 {
        font-size: 30px;
    }

    .report-header p {
        font-size: 14px;
    }

    .filter-card,
    .report-list-card {
        padding: 18px;
    }

    .filter-form {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        grid-column: auto;
        flex-direction: column;
        width: 100%;
    }

    .btn-filter,
    .btn-reset {
        width: 100%;
    }

    .report-list-header {
        flex-direction: column;
        gap: 8px;
    }

    .report-table {
        min-width: 100%;
        border-spacing: 0;
    }

    .report-table thead {
        display: none;
    }

    .report-table,
    .report-table tbody,
    .report-table tr,
    .report-table td {
        display: block;
        width: 100%;
    }

    .report-table tbody tr {
        margin-bottom: 16px;
        padding: 16px;
        border-radius: 20px;
        background: var(--white);
        border: 1px solid #edf2f7;
        box-shadow: var(--shadow-1);
    }

    .report-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 14px;
        padding: 12px 0;
        border: none;
        border-bottom: 1px solid #eef2f7;
        background: transparent;
        text-align: right;
    }

    .report-table tbody td:first-child,
    .report-table tbody td:last-child {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .report-table tbody td:last-child {
        border-bottom: none;
    }

    .report-table tbody tr:hover td {
        background: transparent;
    }

    .report-table tbody td::before {
        content: attr(data-label);
        color: var(--text-soft);
        font-size: 12px;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        text-align: left;
    }

    .assessment-box {
        justify-content: flex-end;
        text-align: right;
    }

    .assessment-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        font-size: 18px;
    }
}

/* =========================
   SMALL MOBILE
   ========================= */

@media (max-width: 430px) {
    .report-page {
        padding: 12px;
    }

    .report-header > div:first-child {
        padding: 20px;
    }

    .report-header h1 {
        font-size: 26px;
    }

    .filter-title h2,
    .report-list-header h2 {
        font-size: 21px;
    }

    .report-table tbody td {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        gap: 8px;
    }

    .assessment-box {
        justify-content: flex-start;
        text-align: left;
    }

    .btn-download,
    .btn-disabled,
    .status-badge {
        width: 100%;
    }
}