/* ==================== RESET & TOKENS ==================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* запрет выделения текста и перетаскивания */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}
img, svg, a { -webkit-user-drag: none; }
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    user-select: text;
}

:root {
    --green: #FF5400;
    --green-2: #FF7A33;
    --green-soft: #FFF0E8;   /* active nav, kpi icon, balance card */
    --green-soft-2: #FFF0E8; /* next-level badge */
    --green-soft-3: #FFEDE4; /* payment card */
    --ink: #1A1D1A;
    --ink-2: #1A1C1E;
    --sub: #52525B;
    --gray: #6B7280;
    --muted: #9CA3AF;
    --muted-2: #A1A1AA;
    --line: #E4E4E7;
    --page-bg: #F6F5F3;
}

body:has(.layout) {
    font-family: 'Inter', sans-serif;
    background: var(--page-bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
input { font-family: inherit; }

.layout { display: flex; min-height: 100vh; }

/* мягкое появление блоков дашборда со стаггером */
@keyframes dash-rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.top-header,
.kpi-card,
.finance-bar,
.referrals {
    opacity: 0;
    animation: dash-rise .5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.top-header        { animation-delay: .05s; }
.kpi-card:nth-child(1) { animation-delay: .12s; }
.kpi-card:nth-child(2) { animation-delay: .19s; }
.kpi-card:nth-child(3) { animation-delay: .26s; }
.kpi-card:nth-child(4) { animation-delay: .33s; }
.finance-bar       { animation-delay: .42s; }
.referrals         { animation-delay: .52s; }

/* сайдбар: пункты меню слегка проявляются по очереди */
@keyframes nav-in {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}
.sidebar .nav-item {
    opacity: 0;
    animation: nav-in .4s ease forwards;
}
.sidebar .nav-item:nth-child(1) { animation-delay: .10s; }
.sidebar .nav-item:nth-child(2) { animation-delay: .16s; }
.sidebar .nav-item:nth-child(3) { animation-delay: .22s; }
.sidebar .nav-item:nth-child(4) { animation-delay: .28s; }
.sidebar .nav-item:nth-child(5) { animation-delay: .34s; }
.sidebar .nav-item:nth-child(6) { animation-delay: .40s; }
.sidebar .nav-item:nth-child(7) { animation-delay: .46s; }

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #F3F5F7;
    border-radius: 0 20px 20px 0;
    padding: 52px 0 40px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar__logo { padding: 0 24px 48px; }
.sidebar__logo img { height: 29px; width: auto; }

.sidebar .nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.04em;
    color: var(--gray);
    border-radius: 0 24px 24px 0;
    position: relative;
    transition: background-color .2s ease, color .2s ease;
}
.sidebar .nav-item img { width: 20px; height: 20px; }
.sidebar .nav-item:hover { background: #F7F5F3; }
.sidebar .nav-item.is-active {
    background: var(--green-soft);
    color: var(--green);
    border-radius: 0 10px 10px 0;
}
.sidebar .nav-item.is-active::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--green);
}

.sidebar__bottom { margin-top: auto; padding: 24px; }
.support-card {
    background: var(--green-soft);
    border-radius: 24px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.support-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.support-card__icon img { width: 20px; height: 20px; }
.support-card__title { font-size: 14px; font-weight: 600; color: var(--green); }
.support-card__sub { font-size: 12px; color: var(--green); opacity: 0.7; margin-top: 1px; }

/* карточка канала в сайдбаре */
.channel-card {
    background: #fff;
    border: 1.5px solid #ECECEC;
    border-radius: 20px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.channel-card__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--green-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.channel-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.channel-card__info { min-width: 0; }
.channel-card__name {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.channel-card__handle {
    font-size: 12px;
    font-weight: 500;
    color: var(--green);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* ==================== MAIN ==================== */
.main {
    flex: 1;
    min-width: 0;
    padding: 48px 30px 40px;
}

/* top header */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}
.top-header__title { font-size: 24px; font-weight: 700; letter-spacing: -0.04em; color: var(--ink); }
.top-header__sub { font-size: 14px; color: var(--sub); letter-spacing: -0.04em; margin-top: 4px; }

/* authorize banner */
.auth-banner {
    background: var(--green);
    border-radius: 24px;
    padding: 32px 36px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    animation: auth-rise .55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.auth-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}
.auth-banner__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
.auth-banner__left { flex: 1; min-width: 240px; }
.auth-banner__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(255,255,255,0.18);
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    margin-bottom: 12px;
}
.auth-banner__title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 8px;
}
.auth-banner__sub {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    opacity: .82;
    letter-spacing: -0.02em;
    line-height: 1.55;
    max-width: 480px;
}
.auth-banner__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    background: #fff;
    color: var(--ink);
    border-radius: 14px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}
.auth-banner__btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.auth-banner__btn img { width: 20px; height: 20px; }
.auth-banner.is-authorized { display: none; }

/* locked state: каждый элемент отдельно, лёгкий блюр, кликабельно */
.lockable { position: relative; transition: opacity .3s ease; }
.lockable.is-locked {
    opacity: .55;
    filter: grayscale(20%);
    cursor: pointer;
}
.lockable.is-locked::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255,255,255,0.35);
    z-index: 4;
    pointer-events: none;
}
.lockable.is-locked:hover { opacity: .7; }
.lock-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.lock-icon svg { width: 14px; height: 14px; color: var(--green); }
.is-locked .lock-icon { display: inline-flex; }
.top-header__actions { display: flex; align-items: center; gap: 20px; }
.icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: #fff;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.icon-btn img { width: 24px; height: 24px; }
.avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.avatar img { width: 30px; height: 30px; object-fit: contain; }

/* KPI row */
.kpi-row { display: flex; gap: 24px; margin-bottom: 32px; }
.kpi-card {
    flex: 1;
    min-width: 0;
    background: #fff;
    border-radius: 32px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.kpi-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--green-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.kpi-card__icon img { width: 20px; height: 20px; }
.kpi-card__label { font-size: 12px; color: var(--gray); text-transform: uppercase; letter-spacing: 0.02em; }
.kpi-card__value { font-size: 28px; font-weight: 700; color: var(--ink-2); margin: 4px 0; }
.kpi-card__sub { font-size: 12px; color: var(--muted); letter-spacing: -0.04em; }

/* ==================== FINANCE BAR ==================== */
.finance-bar {
    background: #FBFBFA;
    border-radius: 32px;
    padding: 10px 15px;
    display: flex;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 32px;
}

/* link to share */
.finance-link {
    width: 402px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    padding: 10px 0;
}
.finance-link__label { font-size: 12px; color: var(--gray); text-transform: uppercase; }
.finance-link__info { display: flex; gap: 10px; align-items: flex-start; }
.finance-link__info-icon { padding-top: 2px; flex-shrink: 0; }
.finance-link__info-icon img { width: 16px; height: 16px; }
.finance-link__info p { font-size: 13px; color: var(--gray); letter-spacing: -0.04em; line-height: 1.35; }
.finance-link__input {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 44px;
    padding: 0 16px;
    background: #F6F6F6;
    border: 1px solid #F3F4F6;
    border-radius: 12px;
}
.finance-link__url {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: #1F2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.finance-link__copy { background: none; border: none; cursor: pointer; flex-shrink: 0; }
.finance-link__copy img { width: 20px; height: 20px; }

/* percent badges */
.finance-stats { width: 330px; flex-shrink: 0; display: flex; gap: 12px; align-items: stretch; }
.percent-badge {
    flex: 1;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.percent-badge--filled {
    background: linear-gradient(to right, var(--green), var(--green-2));
    color: #fff;
}
.percent-badge--filled .percent-badge__label { opacity: 0.8; }
.percent-badge--outline {
    background: var(--green-soft-2);
    border: 0.5px solid var(--green);
    color: var(--green);
}
.percent-badge__num { font-size: 32px; font-weight: 600; }
.percent-badge__label { font-size: 13px; font-weight: 500; letter-spacing: -0.04em; }

/* current balance card */
.balance-card {
    width: 313px;
    flex-shrink: 0;
    background: var(--green-soft);
    border-radius: 24px;
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    justify-content: center;
}
.balance-card__label { font-size: 12px; color: var(--ink-2); opacity: 0.7; text-transform: uppercase; }
.balance-card__amount { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.balance-card__num { font-size: 32px; font-weight: 700; color: var(--green); }
.balance-card__trend { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.balance-card__trend img { width: 20px; height: 20px; }
.balance-card__btn {
    width: 100%;
    height: 36px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: -0.04em;
    cursor: pointer;
    transition: background-color .2s ease;
}
.balance-card__btn:hover { background: #CC4300; }

/* payment systems card */
.pay-card {
    width: 457px;
    flex-shrink: 0;
    background: var(--green-soft-3);
    border-radius: 24px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: center;
}
.pay-card__title { font-size: 14px; font-weight: 600; color: var(--green); letter-spacing: -0.04em; }
.pay-card__logos { display: flex; align-items: center; gap: 6px; }
.pay-card__note { font-size: 12px; color: var(--gray); letter-spacing: -0.04em; }

/* ==================== REFERRALS ==================== */
.referrals {
    background: #fff;
    border-radius: 32px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.referrals__title { font-size: 18px; font-weight: 700; color: var(--ink); }
.referrals__search {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #F5F5F5;
    border-radius: 16px;
    padding: 12px 20px;
    margin: 20px 0;
}
.referrals__search img { width: 20px; height: 20px; }
.referrals__search input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.04em;
    color: var(--ink);
}
.referrals__search input::placeholder { color: #9CA3AF; }

/* table */
.table__head,
.table__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
}
.table__head {
    background: #F5F5F5;
    border-radius: 12px;
}
.table__head span { font-size: 12px; font-weight: 500; color: var(--muted-2); letter-spacing: -0.04em; }
.table__row { padding: 14px 16px; border-top: 1px solid var(--line); }

/* columns */
.col-client { flex: 1; min-width: 0; }
.col-deposit { width: 180px; flex-shrink: 0; }
.col-percent { width: 100px; flex-shrink: 0; }
.col-income { width: 140px; flex-shrink: 0; }

.client { display: flex; align-items: center; gap: 12px; }
.client__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #FF5400;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.client__avatar img { width: 26px; height: 26px; }
.client__email { font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -0.04em; }
.client__date { font-size: 12px; font-weight: 500; color: var(--muted-2); letter-spacing: -0.04em; margin-top: 2px; }

.cell-strong { font-size: 13px; font-weight: 500; color: var(--ink); letter-spacing: -0.04em; }
.cell-green { font-size: 13px; font-weight: 500; color: var(--green); letter-spacing: -0.04em; }

/* ==================== NOTIFICATION (error toast) ==================== */
.notification {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 402px;
    max-width: calc(100vw - 48px);
    padding: 24px;
    border-radius: 16px;
    background:
        linear-gradient(0deg, rgba(0, 0, 0, 0.114) 0%, rgba(255, 50, 50, 0.2) 100%),
        #010201;
    -webkit-backdrop-filter: blur(7.5px);
    backdrop-filter: blur(7.5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    /* по умолчанию скрыто — появляется по клику на «Withdraw funds» */
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity .35s ease, transform .35s cubic-bezier(0.22, 1, 0.36, 1);
}
.notification.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.notification__head {
    display: flex;
    align-items: center;
    gap: 5px;
}
.notification__icon { width: 25px; height: 25px; }
.notification__title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.04em;
    color: #fff;
}
/* крестик — на уровне заголовка, справа */
.notification__close {
    margin-left: auto;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color .2s ease, background-color .2s ease;
}
.notification__close svg { width: 12px; height: 12px; display: block; }
.notification__close:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.notification__text {
    font-size: 12px;
    letter-spacing: -0.04em;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.9);
}

/* ==================== RESPONSIVE ==================== */

/* --- 2K и большие мониторы: центрируем контент, не растягиваем на всю ширину --- */
@media (min-width: 2000px) {
    .main { max-width: 1800px; margin-inline: auto; padding: 56px 48px 48px; }
}

/* --- Финансовая панель переносится --- */
@media (max-width: 1400px) {
    .finance-bar { flex-wrap: wrap; }
    .finance-link, .finance-stats, .balance-card, .pay-card { width: auto; flex: 1 1 320px; }
}

/* --- KPI в 2 колонки --- */
@media (max-width: 1000px) {
    .kpi-row { flex-wrap: wrap; }
    .kpi-card { flex: 1 1 45%; }
}

/* --- Планшеты/телефоны: скрываем сайдбар --- */
@media (max-width: 820px) {
    .sidebar { display: none; }
    .main { padding: 28px 20px; }
    .kpi-card { flex: 1 1 100%; }
    .finance-link, .finance-stats, .balance-card, .pay-card { flex: 1 1 100%; }
    .pay-card__logos { flex-wrap: wrap; }
    .table__head { display: none; }
    .table__row { flex-wrap: wrap; align-items: flex-start; gap: 6px 12px; }
    .table__row .col-deposit,
    .table__row .col-percent,
    .table__row .col-income { width: auto; }
}

/* --- Телефоны --- */
@media (max-width: 560px) {
    .main { padding: 20px 14px; }
    .top-header { flex-wrap: wrap; gap: 14px; }
    .top-header__title { font-size: 20px; }
    .top-header__sub { font-size: 13px; }
    .kpi-card { padding: 24px; }
    .kpi-card__value { font-size: 24px; }
    .referrals { padding: 18px; }
    .finance-bar { padding: 12px; }
    .notification { right: 14px; left: 14px; bottom: 14px; width: auto; }
}

.kpi-row > .lockable { flex: 1; min-width: 0; }
.kpi-row > .lockable .kpi-card { height: 100%; }
.finance-bar > .lockable { display: flex; }
.finance-stats > .lockable { flex: 1; display: flex; min-width: 0; }
.finance-stats > .lockable .percent-badge { width: 100%; }
.finance-link__url { -webkit-user-select: text; user-select: text; }
.support-card {
    border: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.auth-banner__btn {
    border: none;
    cursor: pointer;
}
