/* Подключение шрифта Manrope */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Manrope', sans-serif;
    background-color: #f2f6f6;
    color: #131415;
    line-height: 1.5;
}

/* Контейнер */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 50px;
}

.header {
    padding: 28px 0;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    height: 22px;
    width: auto;
}

.header-title {
    font-size: 16px;
    font-weight: 600;
    color: #090a0b;
    position: relative;
    padding-left: 29px;
}

.header-title::before {
    content: '';
    transform: rotate(90deg);
    width: 29px;
    height: 1px;
    display: block;
    background-color: #000;
    position: absolute;
    left: -10px;
    top: 50%;
}

.header-logout {
    margin-left: auto;
    font-size: 14px;
    font-weight: 600;
    color: #5f6469;
    text-decoration: none;
}

.header-logout:hover {
    color: #131415;
}

.header-back {
    font-size: 14px;
    font-weight: 600;
    color: #5f6469;
    text-decoration: none;
}

.header-back:hover {
    color: #131415;
}

/* Основной layout с flex */
.page-wrapper {
    display: flex;
    gap: 50px;
    margin-top: 40px;
    align-items: flex-start;
}

/* Боковая панель */
.sidebar {
    flex: 0 0 299px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.user-card {
    background: white;
    border-radius: 16px;
    padding: 28px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #131415;
}

.user-id {
    background: #ceff2c;
    border-radius: 32px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #131415;
}

.nav-menu {
    background: white;
    border-radius: 24px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    height: 60px;
    padding: 20px 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    color: #252526;
}

.nav-item:hover {
    background-color: #f2f6f6;
}

.nav-item.active {
    background-color: #f2f6f6;
}

.nav-item-text {
    font-size: 16px;
    font-weight: 600;
    color: inherit;
}

/* Основной контент */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #131415;
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 14px;
    color: #5f6469;
    margin-bottom: 16px;
}

/* Grid layout для главной страницы */
.content-grid {
    display: grid;
    grid-template-columns: 321px 1fr;
    gap: 20px;
    align-items: start;
}

.content-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.content-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Карточка процента партнера */
.partner-percent-card {
    background: #4c4e51;
    border-radius: 16px;
    padding: 28px 32px;
    height: 251px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.partner-percent-value {
    font-size: 96px;
    font-weight: 600;
    color: white;
    line-height: 1;
}

.partner-percent-bonus {
    display: flex;
    align-items: center;
    gap: 8px;
}

.partner-percent-bonus-value {
    font-size: 32px;
    font-weight: 600;
    color: white;
    line-height: 1;
}

.partner-percent-bonus-text {
    font-size: 16px;
    color: #b8b8b8;
    line-height: 1.128;
}

.partner-percent-bonus-text p {
    margin: 0;
}

/* Статистика партнера */
.stats-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-period {
    font-size: 14px;
    font-weight: 500;
    color: #5f6469;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.stats-period::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 1px solid #5f6469;
    border-bottom: 1px solid #5f6469;
    transform: rotate(45deg);
}

.stats-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 0 0 calc(50% - 8px);
}

.stat-card:first-of-type {
    flex: 1 1 100%;
}

.stat-label {
    font-size: 16px;
    font-weight: 600;
    color: #131415;
}

.stat-value {
    font-size: 36px;
    font-weight: 600;
    color: #131415;
    line-height: 1;
}

.stats-button {
    background: #ceff2c;
    border-radius: 67px;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #131415;
    text-decoration: none;
    transition: opacity 0.2s;
}

.stats-button:hover {
    opacity: 0.9;
}

.stats-button-icon {
    width: 40px;
    height: 40px;
}

/* Карточка приглашения */
.invite-card {
    background: white;
    border-radius: 16px;
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.invite-title {
    font-size: 18px;
    line-height: 24px;
    color: #131415;
}

.invite-title-bold {
    font-weight: 700;
}

.invite-link-container {
    background: #f2f6f6;
    border-radius: 67px;
    padding: 2px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.invite-link {
    font-size: 14px;
    font-weight: 600;
    color: #9f9f9f;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-icon {
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Карточка обучения */
.learn-card {
    background: white;
    border-radius: 16px;
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.learn-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 24px;
    color: #131415;
}

.learn-description {
    font-size: 14px;
    font-weight: 600;
    line-height: normal;
    color: #727477;
}

.learn-button {
    border: 1px solid black;
    border-radius: 67px;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: white;
    font-size: 14px;
    font-weight: 600;
    color: #131415;
    text-decoration: none;
    transition: background-color 0.2s;
}

.learn-button:hover {
    background-color: #f2f6f6;
}

.learn-button-icon {
    width: 40px;
    height: 40px;
}

/* Карточка помощи */
.help-card {
    background: white;
    border-radius: 16px;
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.help-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 24px;
    color: #131415;
}

.help-description {
    font-size: 14px;
    font-weight: 600;
    line-height: normal;
    color: #727477;
}

.help-button {
    border: 1px solid black;
    border-radius: 67px;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: white;
    font-size: 14px;
    font-weight: 600;
    color: #131415;
    text-decoration: none;
    transition: background-color 0.2s;
}

.help-button:hover {
    background-color: #f2f6f6;
}

.help-button-icon {
    width: 40px;
    height: 40px;
}

/* Партнерские ссылки */
.partner-links-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.partner-links-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.partner-link-item {
    background: white;
    border-radius: 16px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.partner-link-name {
    font-size: 14px;
    font-weight: 600;
    color: #5d5e5f;
    flex-shrink: 0;
}

.partner-link-container {
    background: #f2f6f6;
    border-radius: 32px;
    padding: 2px 12px;
    flex: 1;
    max-width: 289px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.partner-link-url {
    font-size: 12px;
    font-weight: 600;
    color: #131415;
    opacity: 0.5;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Страница вознаграждений */
.rewards-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.filter-item {
    background: white;
    border-radius: 41px;
    padding: 2px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.filter-label {
    font-size: 14px;
    font-weight: 500;
    color: #5f6469;
}

.filter-value {
    font-size: 14px;
    font-weight: 500;
    color: #afb6bc;
}

.filter-arrow {
    width: 8px;
    height: 8px;
    border-right: 1px solid #5f6469;
    border-bottom: 1px solid #5f6469;
    transform: rotate(45deg);
}

.reset-filters {
    font-size: 10px;
    font-weight: 500;
    color: #64696e;
    text-decoration: underline;
    cursor: pointer;
    margin-left: auto;
}

.reset-filters:hover {
    color: #131415;
}

.filters-form .filter-input,
.filters-form .filter-select {
    font-size: 14px;
    padding: 4px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
}

.filters-form .filter-input {
    max-width: 120px;
}

.filter-submit {
    font-size: 14px;
    font-weight: 600;
    padding: 6px 16px;
    background: #ceff2c;
    border: none;
    border-radius: 32px;
    cursor: pointer;
}

.payout-create {
    margin-bottom: 20px;
}

.payout-create .section-subtitle {
    margin-bottom: 12px;
}

.rewards-table-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rewards-table-wrapper.network-table .rewards-table-header,
.rewards-table-wrapper.network-table .reward-row {
    grid-template-columns: 1fr 100px 100px 80px 140px;
}

.rewards-table-wrapper.payouts-table .rewards-table-header,
.rewards-table-wrapper.payouts-table .reward-row {
    grid-template-columns: 120px 140px 180px 160px;
}

.rewards-table-header {
    display: grid;
    grid-template-columns: 200px 180px 100px 100px 160px 91px;
    gap: 16px;
    padding: 0 18px;
}

@media (max-width: 1200px) {
    .rewards-table-header {
        grid-template-columns: 150px 150px 80px 80px 120px 80px;
    }
}

@media (max-width: 768px) {
    .rewards-table-header {
        display: none;
    }
}

.table-header-item {
    font-size: 10px;
    font-weight: 600;
    color: #131415;
    opacity: 0.5;
}

.rewards-table {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reward-row {
    background: white;
    border-radius: 16px;
    padding: 18px;
    display: grid;
    grid-template-columns: 200px 180px 100px 100px 160px 91px;
    gap: 16px;
    align-items: center;
    min-height: 60px;
}

@media (max-width: 1200px) {
    .reward-row {
        grid-template-columns: 150px 150px 80px 80px 120px 80px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .reward-row {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }

    .reward-row>* {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .reward-row::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 600;
        color: #9ea1a1;
        opacity: 0.7;
    }
}

.reward-left {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.reward-badges {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.reward-badge {
    background: #f2f6f6;
    border-radius: 32px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #131415;
    opacity: 0.5;
    white-space: nowrap;
}

.reward-badge.source-referral {
    background: #dbefff;
}

.reward-badge.source-personal {
    background: #ccfecb;
}

.reward-badge.source-founder {
    background: #e8d5ff;
}

.stat-sublabel {
    font-size: 12px;
    font-weight: 500;
    color: #5f6469;
}

.reward-product {
    font-size: 14px;
    font-weight: 600;
    color: #131415;
}

.reward-middle {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #9ea1a1;
}

.reward-revenue {
    font-size: 14px;
    font-weight: 600;
    color: #9ea1a1;
}

.reward-percent {
    font-size: 14px;
    font-weight: 600;
    color: #9ea1a1;
}

.reward-right {
    display: flex;
    gap: 16px;
    align-items: center;
}

.reward-amount {
    font-size: 20px;
    font-weight: 600;
    color: #131415;
}

.reward-status {
    border-radius: 32px;
    padding: 2px 12px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    text-align: center;
}

.reward-status.hold {
    background: #9a9a9a;
}

.reward-status.amo-new {
    background: #b0b0b0;
}

.reward-status.paid {
    background: #50d54e;
}

.reward-status.return {
    background: #ff5759;
}

.reward-status.in-application {
    background: #ffc642;
}

.reward-status.to-pay {
    background: #63bcff;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .container {
        padding: 0 20px;
    }

    .page-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .sidebar {
        flex: 0 0 auto;
        width: 100%;
    }

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

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

    .rewards-table-header,
    .reward-row {
        grid-template-columns: 150px 150px 80px 80px 120px 80px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .header {
        padding: 16px 0;
    }

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

    .partner-link-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .partner-link-container {
        max-width: 100%;
        width: 100%;
    }

    .rewards-table-header,
    .reward-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .reward-left,
    .reward-middle,
    .reward-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .filters-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .reset-filters {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .partner-percent-value {
        font-size: 64px;
    }

    .stat-value {
        font-size: 28px;
    }

    .invite-card,
    .learn-card,
    .help-card {
        padding: 20px;
    }
}