* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
}


/* ============================================================
   HEADER
   ============================================================ */

.topbar {
    background: #ffffff;
    border-bottom: 1px solid #dddddd;

    padding: 20px 5%;

    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;
}

.brand h1 {
    margin: 0;

    font-size: 28px;
}

.brand p {
    margin: 5px 0 0;

    color: #666666;
}


/* ============================================================
   MAIN CONTAINER
   ============================================================ */

.container {
    max-width: 1050px;

    margin: 30px auto;

    padding: 0 20px;
}


/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: #ffffff;

    border-radius: 12px;

    padding: 24px;

    margin-bottom: 20px;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.06);
}

.card h2 {
    margin-top: 0;

    margin-bottom: 18px;
}


/* ============================================================
   LABELS
   ============================================================ */

.label {
    display: block;

    font-size: 13px;

    color: #777777;

    margin-bottom: 5px;
}


/* ============================================================
   INFORMATION GRID
   ============================================================ */

.info-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));

    gap: 18px;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.primary-btn,
.secondary-btn {
    border: none;

    border-radius: 8px;

    padding: 11px 18px;

    font-size: 14px;

    cursor: pointer;
}

/* ------------------------------------------------------------
   WALLET BUTTON GROUP
   ------------------------------------------------------------ */

.wallet-connect-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.primary-btn {
    background: #e67e22;

    color: #ffffff;
}

.secondary-btn {
    background: #eeeeee;

    color: #333333;
}

/* ------------------------------------------------------------
   WALLET BUTTON COLORS
   ------------------------------------------------------------ */

#rabbyWalletBtn {
    background: #3b82f6;
    color: #ffffff;
}

#disconnectWalletBtn {
    background: #dc3545;
    color: #ffffff;
}

#rabbyWalletBtn:hover,
#disconnectWalletBtn:hover {
    opacity: 0.9;
}

.primary-btn:hover,
.secondary-btn:hover {
    opacity: 0.9;
}

button:disabled {
    opacity: 0.5;

    cursor: not-allowed;
}


/* ============================================================
   ACTION ROW
   ============================================================ */

.action-row {
    display: flex;

    flex-wrap: wrap;

    gap: 12px;

    margin-top: 20px;
}


/* ============================================================
   TEXT INPUT
   ============================================================ */

input[type="text"] {
    width: 100%;

    padding: 12px;

    border: 1px solid #cccccc;

    border-radius: 8px;

    font-size: 14px;

    margin-top: 8px;
}

input[type="text"]:focus {
    outline: none;

    border-color: #888888;
}


/* ============================================================
   SECTION DESCRIPTION
   ============================================================ */

.section-description {
    color: #666666;

    line-height: 1.5;
}


/* ============================================================
   PRODUCTS
   ============================================================ */

.products-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(250px, 1fr));

    gap: 16px;

    margin-top: 20px;
}

.product-placeholder {
    grid-column: 1 / -1;

    padding: 25px;

    border: 1px dashed #cccccc;

    border-radius: 10px;

    text-align: center;

    color: #777777;
}


/* ============================================================
   EARNINGS
   ============================================================ */

.earnings-grid {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 16px;
}

.earning-box {
    padding: 18px;

    border-radius: 10px;

    border: 1px solid transparent;

    background: #fafafa;
}

.earning-box strong {
    display: block;

    margin-top: 8px;

    font-size: 21px;
}


/* ------------------------------------------------------------
   TOTAL EARNINGS - BLUE
   ------------------------------------------------------------ */

.earnings-grid .earning-box:nth-child(1) {
    background: #eef7ff;

    border-color: #cfe7ff;
}

.earnings-grid .earning-box:nth-child(1) strong {
    color: #1459a6;
}


/* ------------------------------------------------------------
   PAID - GREEN
   ------------------------------------------------------------ */

.earnings-grid .earning-box:nth-child(2) {
    background: #eefaf2;

    border-color: #d2efdc;
}

.earnings-grid .earning-box:nth-child(2) strong {
    color: #087a3d;
}


/* ------------------------------------------------------------
   AVAILABLE - ORANGE
   ------------------------------------------------------------ */

.earnings-grid .earning-box:nth-child(3) {
    background: #fff8e8;

    border-color: #f5dfae;
}

.earnings-grid .earning-box:nth-child(3) strong {
    color: #a86700;
}


/* ------------------------------------------------------------
   RESERVED - RED
   ------------------------------------------------------------ */

.earnings-grid .earning-box:nth-child(4) {
    background: #fff0f2;

    border-color: #f3d0d5;
}

.earnings-grid .earning-box:nth-child(4) strong {
    color: #b5161f;
}


/* ------------------------------------------------------------
   RESPONSIVE EARNINGS
   ------------------------------------------------------------ */

@media (max-width: 900px) {

    .earnings-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

}


/* ============================================================
   WITHDRAWAL ELIGIBILITY
   ============================================================ */

.eligibility-box {
    margin-top: 18px;

    padding: 16px;

    border-radius: 10px;

    background: #f8f8f8;
}


/* ============================================================
   WITHDRAWALS
   ============================================================ */

.withdrawals-list {
    display: flex;

    flex-direction: column;

    gap: 10px;
}

.withdrawal-placeholder {
    padding: 20px;

    border: 1px dashed #cccccc;

    border-radius: 10px;

    color: #777777;

    text-align: center;
}

/* ============================================================
   ADMIN WITHDRAWAL MANAGEMENT TABLE
   ============================================================ */

.withdrawal-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
    border: 1px solid #eeeeee;
    border-radius: 12px;
}

.withdrawal-table {
    width: 100%;
    min-width: 850px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    background: #ffffff;
}

/* ------------------------------------------------------------
   TABLE HEADER
   ------------------------------------------------------------ */

.withdrawal-table thead th {
    padding: 14px 16px;
    background: #fff1e6;
    color: #d35400;
    font-weight: 700;
    text-align: left;
    border-bottom: 1px solid #f0d8c5;
    white-space: nowrap;
}

/* ------------------------------------------------------------
   TABLE CELLS
   ------------------------------------------------------------ */

.withdrawal-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #eeeeee;
    vertical-align: middle;
    white-space: nowrap;
}

/* ------------------------------------------------------------
   ALTERNATING ROWS
   ------------------------------------------------------------ */

.withdrawal-table tbody tr:nth-child(even) {
    background: #fafafa;
}

/* ------------------------------------------------------------
   HOVER EFFECT
   ------------------------------------------------------------ */

.withdrawal-table tbody tr:hover {
    background: #fff8f2;
}

/* ------------------------------------------------------------
   LAST ROW
   ------------------------------------------------------------ */

.withdrawal-table tbody tr:last-child td {
    border-bottom: none;
}

/* ------------------------------------------------------------
   ACTION COLUMN
   ------------------------------------------------------------ */

.withdrawal-table th:last-child,
.withdrawal-table td:last-child {
    min-width: 190px;
}

/* ------------------------------------------------------------
   AFFILIATE WITHDRAWAL TABLE
   ------------------------------------------------------------ */

.affiliate-withdrawal-table {
    min-width: 700px;
}

.affiliate-withdrawal-table th:last-child,
.affiliate-withdrawal-table td:last-child {
    min-width: 130px;
}

.affiliate-withdrawal-table .affiliate-withdraw-btn {
    display: inline-block;
}

/* ------------------------------------------------------------
   APPROVE / REJECT BUTTONS
   ------------------------------------------------------------ */

.withdrawal-table .admin-approve-btn,
.withdrawal-table .admin-reject-btn {
    display: inline-block;
    margin-right: 6px;
    margin-bottom: 4px;
}

/* ------------------------------------------------------------
   ADMIN WITHDRAWAL ACTION BUTTONS
   ------------------------------------------------------------ */

.withdrawal-table .admin-approve-btn {
    background: #087a3d;
    color: #ffffff;
}

.withdrawal-table .admin-reject-btn {
    background: #b5161f;
    color: #ffffff;
}

.withdrawal-table .admin-approve-btn:hover,
.withdrawal-table .admin-reject-btn:hover {
    opacity: 0.85;
}

/* ------------------------------------------------------------
   AFFILIATE WITHDRAW BUTTON
   ------------------------------------------------------------ */

.affiliate-withdrawal-table .affiliate-withdraw-btn {
    background: #e67e22;
    color: #ffffff;
}

.affiliate-withdrawal-table .affiliate-withdraw-btn:hover {
    opacity: 0.85;
}

/* ------------------------------------------------------------
   FILTER AREA
   ------------------------------------------------------------ */

#adminWithdrawalManagement .action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
    margin-top: 18px;
    margin-bottom: 10px;
}

#adminWithdrawalManagement .action-row > div {
    min-width: 140px;
}

#adminWithdrawalManagement select {
    height: 42px;
    padding: 8px 10px;
    border: 1px solid #cccccc;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
}

#adminWithdrawalManagement input[type="text"] {
    width: 250px;
    height: 42px;
    margin-top: 0;
}

#adminWithdrawalManagement .action-row > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#adminWithdrawalManagement .action-row .label {
    font-size: 14px;
    font-weight: 600;
}

#adminWithdrawalManagement select,
#adminWithdrawalManagement input {
    box-sizing: border-box;
}

/* ------------------------------------------------------------
   WITHDRAWAL STATUS
   ------------------------------------------------------------ */

.withdrawal-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* Pending */

.withdrawal-status.status-1 {
    background: #fff4e5;
    color: #a86700;
}

/* Approved */

.withdrawal-status.status-2 {
    background: #eef7ff;
    color: #1459a6;
}

/* Paid */

.withdrawal-status.status-3 {
    background: #eefaf2;
    color: #087a3d;
}

/* Rejected */

.withdrawal-status.status-4 {
    background: #fff0f2;
    color: #b5161f;
}

/* ============================================================
   ADMIN REPORT CENTER
   ============================================================ */

#adminReportCenter {
    margin-top: 30px;
}


/* ------------------------------------------------------------
   Report Filters
   ------------------------------------------------------------ */

#adminReportCenter .admin-report-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-end;
    margin-top: 20px;
}


#adminReportCenter .admin-report-filters > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}


#adminReportCenter .admin-report-filters .label {
    font-size: 14px;
    font-weight: 600;
}


/* ------------------------------------------------------------
   Select boxes
   ------------------------------------------------------------ */

#adminReportCenter select {
    box-sizing: border-box;
    width: 100%;
    min-width: 180px;
    height: 42px;
    padding: 8px 10px;
    border: 1px solid #cccccc;
    border-radius: 8px;
    background: #ffffff;
    font-size: 14px;
}


/* ------------------------------------------------------------
   Text / date / number inputs
   ------------------------------------------------------------ */

#adminReportCenter input[type="text"],
#adminReportCenter input[type="date"],
#adminReportCenter input[type="number"] {
    box-sizing: border-box;
    width: 250px;
    height: 42px;
    padding: 8px 10px;
    border: 1px solid #cccccc;
    border-radius: 8px;
    background: #ffffff;
    font-size: 14px;
}


#adminReportCenter input:focus,
#adminReportCenter select:focus {
    outline: none;
    border-color: #e67e22;
}


/* ------------------------------------------------------------
   Report action buttons
   ------------------------------------------------------------ */

#adminReportCenter .action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 22px;
    margin-bottom: 20px;
}


/* ------------------------------------------------------------
   Report Summary
   ------------------------------------------------------------ */

#adminReportCenter .admin-report-summary {
    width: 100%;
    margin-top: 10px;
}


#adminReportCenter .report-placeholder {
    margin: 0;
    padding: 18px;
    border: 1px solid #eeeeee;
    border-radius: 10px;
    background: #fafafa;
    color: #666666;
}


/* ------------------------------------------------------------
   Report Results
   ------------------------------------------------------------ */

#adminReportCenter .admin-report-results {
    width: 100%;
    margin-top: 20px;
}


/* ------------------------------------------------------------
   Report Table
   ------------------------------------------------------------ */

#adminReportCenter .admin-report-table {
    min-width: 900px;
}


#adminReportCenter .admin-report-table thead th {
    white-space: nowrap;
}


#adminReportCenter .admin-report-table tbody td {
    white-space: nowrap;
}


/* ------------------------------------------------------------
   Disabled Download Button
   ------------------------------------------------------------ */

#adminReportCenter #downloadAdminReportBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* ------------------------------------------------------------
   Responsive layout
   ------------------------------------------------------------ */

@media (max-width: 768px) {

    #adminReportCenter .admin-report-filters {
        flex-direction: column;
        align-items: stretch;
    }


    #adminReportCenter .admin-report-filters > div {
        width: 100%;
        min-width: 0;
    }


    #adminReportCenter input[type="text"],
    #adminReportCenter input[type="date"],
    #adminReportCenter input[type="number"],
    #adminReportCenter select {
        width: 100%;
        min-width: 0;
    }


    #adminReportCenter .action-row {
        flex-direction: column;
        align-items: stretch;
    }

}

/* ============================================================
   ACTIVITY
   ============================================================ */

.message {
    padding: 13px;

    border-radius: 8px;

    background: #f1f3f5;

    color: #555555;
}

.status-ok {
    font-weight: bold;
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 650px) {

    .topbar {
        flex-direction: column;

        align-items: stretch;
    }

    .topbar button {
        width: 100%;
    }

    .container {
        padding: 0 12px;

        margin-top: 18px;
    }

    .card {
        padding: 18px;
    }

}

/* ============================================================
   8-LEVEL EARNINGS BREAKDOWN
   ============================================================ */

.level-earnings-section {
    margin-top: 28px;
}

.level-earnings-section h3 {
    margin: 0 0 18px;

    font-size: 20px;

    color: #222222;
}


/* ------------------------------------------------------------
   TABLE WRAPPER
   ------------------------------------------------------------ */

.table-wrapper {
    width: 100%;

    overflow-x: auto;

    border: 1px solid #eeeeee;

    border-radius: 12px;
}


/* ------------------------------------------------------------
   LEVEL EARNINGS TABLE
   ------------------------------------------------------------ */

.level-earnings-table {
    width: 100%;

    border-collapse: separate;

    border-spacing: 0;

    font-size: 14px;

    background: #ffffff;
}


/* ------------------------------------------------------------
   TABLE HEADER
   ------------------------------------------------------------ */

.level-earnings-table thead th {
    padding: 14px 18px;

    background: #fff1e6;

    color: #d35400;

    font-weight: 700;

    text-align: center;

    border-bottom: 1px solid #f0d8c5;

    white-space: nowrap;
}


/* ------------------------------------------------------------
   TABLE CELLS
   ------------------------------------------------------------ */

.level-earnings-table tbody td {
    padding: 13px 18px;

    text-align: center;

    border-bottom: 1px solid #eeeeee;

    white-space: nowrap;
}


/* ------------------------------------------------------------
   LEVEL COLUMN
   ------------------------------------------------------------ */

.level-earnings-table tbody td:first-child {
    font-weight: 600;

    text-align: left;
}


/* ------------------------------------------------------------
   ALTERNATING ROWS
   ------------------------------------------------------------ */

.level-earnings-table tbody tr:nth-child(even) {
    background: #fafafa;
}


/* ------------------------------------------------------------
   HOVER EFFECT
   ------------------------------------------------------------ */

.level-earnings-table tbody tr:hover {
    background: #fff8f2;
}


/* ------------------------------------------------------------
   LAST ROW
   ------------------------------------------------------------ */

.level-earnings-table tbody tr:last-child td {
    border-bottom: none;
}


/* ------------------------------------------------------------
   EARNINGS COLUMN
   ------------------------------------------------------------ */

.level-earnings-table tbody td:last-child {
    font-weight: 600;
}


/* ============================================================
   WITHDRAWAL ELIGIBILITY
   ============================================================ */

.eligibility-box {
    border: 1px solid #e3edf7;

    background: #f5f9fd;

    padding: 18px;
}

.eligibility-box .label {
    font-weight: 600;

    color: #557085;
}


/* ============================================================
   MOBILE TABLE
   ============================================================ */

@media (max-width: 650px) {

    .level-earnings-section h3 {
        font-size: 18px;
    }

    .level-earnings-table {
        min-width: 600px;
    }

    .level-earnings-table thead th,
    .level-earnings-table tbody td {
        padding: 12px 14px;
    }

}

/* ============================================================
   ADMIN DASHBOARD
   ============================================================ */

#adminDashboard .info-grid {
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 16px;
}

#adminDashboard .info-grid > div {
    min-width: 0;
    padding: 16px;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    background: #fafafa;
}

#adminDashboard .info-grid p {
    margin-bottom: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.5;
}

#adminDashboard .info-grid > div:last-child {
    grid-column: 1;
}
/* Admin Purchase Status */

#adminPurchaseStatus {
    font-weight: 600;
}

#adminDashboard .info-grid > div:last-child p {
    color: #087a3d;
}