/* Affiliate dashboard (/affiliate). */
.affiliate_dashboard {

    /* header.css scopes its rules as #header #title-container (two IDs) —
       match that weight or the padding loses the specificity war. */
    #header #title-container {
        padding-bottom: 32px;

        @media screen and (min-width: 876px) {
            padding-bottom: 48px;
        }
    }

    .affiliate-dashboard {
        display: flex;
        flex-direction: column;
        gap: 24px;
        color: #0A011A;

        h2 {
            margin: 0;
            font-size: 22px;
            line-height: 30px;
            font-weight: 700;
            text-align: start;
        }

        p {
            margin: 0;
            text-align: start;
        }

        code {
            padding: 2px 6px;
            border-radius: 6px;
            background: #F3EFFA;
            font-size: 13px;
            overflow-wrap: anywhere;
        }
    }

    .affiliate-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;

        a,
        .current {
            padding: 10px 18px;
            border-radius: 48px;
            font-size: 14px;
            font-weight: 500;
            text-decoration: none;
        }

        a {
            color: #0A011A;
            background: #F3F3F3;

            &:hover,
            &:focus-visible {
                background: #E9E0F7;
            }
        }

        .current {
            color: white;
            background: #250C56;
        }
    }

    .tiles {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;

        @media screen and (min-width: 876px) {
            grid-template-columns: repeat(4, 1fr);
            gap: 16px;
        }
    }

    .tile {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 20px;
        border-radius: 24px;
        background: #F7F4FC;

        .label {
            font-size: 13px;
            font-weight: 500;
            color: #5B5466;
        }

        .value {
            font-size: 26px;
            line-height: 34px;
            font-weight: 700;
            font-variant-numeric: tabular-nums;
        }

        .hint {
            font-size: 12px;
            color: #5B5466;
        }
    }

    .period-tiles .tile {
        background: white;
        border: 1px solid #ECE7F3;
    }

    .payout-line {
        display: flex;

        a.btn {
            padding: 16px 24px;
        }
    }

    .panel {
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 24px;
        border-radius: 24px;
        border: 1px solid #ECE7F3;
        background: white;

        header {
            display: flex;
            flex-wrap: wrap;
            align-items: baseline;
            justify-content: space-between;
            gap: 8px 16px;

            a {
                font-size: 14px;
                font-weight: 500;
                color: #7B2FD6;
            }
        }
    }

    .period {
        display: flex;
        flex-wrap: wrap;
        align-items: end;
        gap: 12px;

        label {
            display: flex;
            flex-direction: column;
            gap: 6px;
            font-size: 13px;
            font-weight: 500;
            color: #5B5466;
        }

        input[type="date"] {
            padding: 12px 14px;
            border: 1px solid #DCD4E8;
            color: #0A011A;
        }

        button {
            padding: 13px 24px;
            border: none;
            border-radius: 13px;
            color: white;
            background: #250C56;
            font-family: inherit;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
        }
    }

    .note,
    .empty {
        font-size: 14px;
        line-height: 22px;
        color: #5B5466;
    }

    .scroll {
        overflow-x: auto;
    }

    table {
        width: 100%;
        border-collapse: collapse;
        font-size: 14px;
        font-variant-numeric: tabular-nums;

        th,
        td {
            padding: 10px 12px;
            text-align: start;
            white-space: nowrap;
            border-bottom: 1px solid #F0ECF5;
        }

        th {
            font-size: 12px;
            font-weight: 600;
            color: #5B5466;
        }

        td:first-child {
            max-width: 320px;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .number {
            text-align: end;
        }

        tr.quiet td {
            color: #A39CAE;
        }

        tbody tr:last-child td {
            border-bottom: none;
        }
    }

    .status {
        padding: 4px 10px;
        border-radius: 48px;
        font-size: 12px;
        font-weight: 500;

        &.pending {
            color: #8A5A00;
            background: #FFF4DB;
        }

        &.review {
            color: #8A3A00;
            background: #FFE8D6;
        }

        &.approved {
            color: #14683A;
            background: #E1F6EA;
        }

        &.paid {
            color: #4A1F9A;
            background: #EDE4FB;
        }

        &.reversed {
            color: #9A1F3C;
            background: #FBE4EA;
        }
    }
}
