/* ─────────────  Личный кабинет  ───────────── */
.app {
    display: grid; grid-template-columns: 268px 1fr; gap: 26px;
    max-width: 1560px; margin: 0 auto; padding: 26px; align-items: start;
    position: relative; z-index: 2;
}

/* сайдбар */
.sidebar {
    background: linear-gradient(180deg, #131313, #0e0e0e);
    border: 1px solid var(--line); border-radius: var(--r-xl); padding: 22px 20px;
    position: sticky; top: 26px; display: flex; flex-direction: column;
    min-height: calc(100vh - 52px);
}
.sidebar .logo { padding: 4px 8px 26px; }
.side-nav { display: flex; flex-direction: column; gap: 8px; }
.side-link {
    display: flex; align-items: center; gap: 12px; padding: 13px 17px; border-radius: var(--r);
    background: #161616; border: 1px solid var(--line-soft); color: var(--muted);
    font-size: 14px; cursor: pointer; transition: .16s; text-align: left; width: 100%;
}
.side-link:hover { color: #ddd; border-color: #2e2e2e; }
.side-link.active {
    background: linear-gradient(180deg, rgba(245,166,35,.16), rgba(245,166,35,.05));
    border-color: var(--accent-line); color: var(--accent); font-weight: 600;
}
.side-link .badge { margin-left: auto; }
.side-bottom { margin-top: auto; padding-top: 26px; }
.side-legal { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; padding: 0 4px; }
.side-legal a { color: var(--muted-2); font-size: 11.5px; line-height: 1.4; transition: .15s; }
.side-legal a:hover { color: var(--muted); }

/* топбар */
.topbar {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
    padding: 16px 20px; display: flex; align-items: center; gap: 16px; margin-bottom: 30px;
}
.avatar {
    width: 46px; height: 46px; border-radius: 14px; background: var(--surface-3);
    border: 1px solid var(--line); display: grid; place-items: center;
    color: var(--muted); font-weight: 700; flex: none;
}
.topbar .who { min-width: 0; }
.topbar .who b { display: block; font-size: 15.5px; font-weight: 600; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }
.topbar .who span { color: var(--muted-2); font-size: 12.5px; }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.mob-header { display: none; }

/* контент */
.page-head { margin-bottom: 28px; }
.page-head p { color: var(--muted); margin-top: 8px; }
.section-block { margin-bottom: 22px; }
.tab { display: none; }
.tab.active { display: block; animation: tabIn .22s ease; }
@keyframes tabIn { from { opacity: 0; transform: translateY(6px); } }

/* статус подписки */
.sub-card {
    border-radius: var(--r-xl); border: 1px solid var(--line); padding: 26px 28px;
    display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
    background: linear-gradient(110deg, #1a1310 0%, #131313 55%);
    position: relative; overflow: hidden;
}
.sub-card.ok { background: linear-gradient(110deg, #101a12 0%, #131313 55%); }
.sub-card.warn { background: linear-gradient(110deg, #1d1410 0%, #131313 55%); }
.sub-card.dead { background: linear-gradient(110deg, #1d1010 0%, #131313 55%); }
.sub-card .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.sub-card.ok .dot { background: var(--green); }
.sub-card.dead .dot { background: var(--red); }
.sub-status { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); }
.sub-card h3 { font-size: 27px; margin: 10px 0 8px; }
.sub-card .meta { color: var(--muted-2); font-size: 13px; }
.sub-card .btn { margin-left: auto; }

/* привязанный Telegram в профиле */
.tg-linked {
    display: flex; align-items: center; gap: 13px; padding: 14px 16px;
    background: rgba(74, 222, 128, .08); border: 1px solid rgba(74, 222, 128, .26);
    border-radius: var(--r);
}
.tg-linked .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; }
.tg-linked b { display: block; font-size: 14px; }
.tg-linked span { color: var(--muted-2); font-size: 12.5px; }

/* пробный период */
.trial-card {
    margin-top: 18px; padding: 20px 24px; border-radius: var(--r-xl);
    border: 1px solid rgba(74, 222, 128, .28);
    background: linear-gradient(110deg, rgba(74, 222, 128, .09) 0%, #131313 60%);
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.trial-card .ic {
    width: 44px; height: 44px; border-radius: 13px; flex: none;
    background: rgba(74, 222, 128, .12); border: 1px solid rgba(74, 222, 128, .3);
    color: var(--green); display: grid; place-items: center;
}
.trial-card b { display: block; font-size: 17px; margin-bottom: 4px; }
.trial-card span { color: var(--muted-2); font-size: 13px; }
.trial-card .btn { margin-left: auto; }
@media (max-width: 620px) {
    .trial-card { align-items: flex-start; }
    .trial-card .btn { margin-left: 0; width: 100%; }
}

/* быстрые карточки */
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; }
.quick {
    background: linear-gradient(140deg, #1a1510, #121212 60%);
    border: 1px solid var(--line); border-radius: var(--r-xl); padding: 24px;
    cursor: pointer; transition: .2s; text-align: left;
}
.quick:hover { border-color: var(--accent-line); transform: translateY(-3px); }
.quick .ic {
    width: 42px; height: 42px; border-radius: 12px; background: var(--accent-dim);
    border: 1px solid var(--accent-line); color: var(--accent);
    display: grid; place-items: center; margin-bottom: 22px;
}
.quick b { font-size: 18px; font-weight: 700; display: block; }
.quick span { color: var(--muted-2); font-size: 13px; }

/* блоки данных */
.data-block { margin-top: 22px; }
.data-block > .t { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* рефералка */
.ref-stats { display: flex; gap: 56px; margin-top: 24px; flex-wrap: wrap; }
.ref-stat .k { color: var(--muted-2); font-size: 14px; }
.ref-stat .v { font-size: 30px; font-weight: 800; margin-top: 4px; }

/* покупка */
.buy-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 32px; }
.buy-plan {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
    padding: 26px; cursor: pointer; transition: .2s; position: relative;
}
.buy-plan:hover { border-color: #333; }
.buy-plan.active {
    border-color: var(--accent-line); background: linear-gradient(160deg, rgba(245,166,35,.09), #131313 70%);
}
.buy-plan .num-row { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.buy-plan .num {
    padding: 8px 14px; border-radius: 12px; background: var(--surface-3);
    border: 1px solid var(--line); font-weight: 700; font-size: 15px; color: var(--muted);
}
.buy-plan.active .num { background: var(--accent-dim); border-color: var(--accent-line); color: var(--accent); }
.buy-plan .num-row b { font-size: 20px; }
.buy-plan .price { font-size: 21px; font-weight: 700; }
.buy-plan .desc { color: var(--muted-2); font-size: 13px; margin-top: 8px; }
.pop-tag {
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    background: var(--accent); color: #140d00; font-size: 11.5px; font-weight: 700;
    padding: 6px 16px; border-radius: 999px; box-shadow: 0 0 24px rgba(245,166,35,.5); white-space: nowrap;
}
.buy-detail { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 34px; }
.buy-detail h2 { font-size: clamp(24px, 3.4vw, 36px); margin-bottom: 26px; }
.small-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 14px; }
.incl { display: flex; flex-wrap: wrap; gap: 16px 30px; margin-bottom: 28px; }
.incl div { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #c9c9c9; }
.period-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; margin-bottom: 26px; }
.total-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding-top: 24px; margin-top: 8px; border-top: 1px solid var(--line-soft); margin-bottom: 22px;
}
.total-row .k { color: var(--muted); font-size: 15px; }
.total-row .v { font-size: 27px; font-weight: 800; }
.total-row .old { color: var(--muted-2); text-decoration: line-through; font-size: 16px; margin-right: 10px; font-weight: 500; }
.promo-applied {
    display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-radius: var(--r);
    background: rgba(74,222,128,.09); border: 1px solid rgba(74,222,128,.28); color: var(--green);
    font-size: 13.5px; margin-bottom: 20px;
}
.promo-applied button { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; }

/* пополнение */
.amount-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; margin-bottom: 26px; }
.amount-btn {
    padding: 16px; border-radius: var(--r); background: var(--surface-2);
    border: 1px solid var(--line); color: var(--muted); cursor: pointer;
    font-size: 15px; transition: .16s; font-weight: 500;
}
.amount-btn:hover { border-color: #333; }
.amount-btn.active { background: rgba(245,166,35,.11); border-color: var(--accent-line); color: var(--accent); font-weight: 600; }
.input-suffix { position: relative; }
.input-suffix .sfx { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-suffix .input { padding-right: 44px; }

/* платежи */
.pay-item {
    display: flex; align-items: center; gap: 18px; padding: 18px 20px;
    background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r);
    transition: .16s;
}
.pay-item:hover { border-color: var(--line); }
.pay-item .t { font-size: 14.5px; }
.pay-item .d { color: var(--muted-2); font-size: 12.5px; margin-top: 3px; }
.pay-item .amt { text-align: right; flex: none; }
.pay-item .amt b { font-size: 15px; font-weight: 700; display: block; white-space: nowrap; }

/* подключение */
.instr {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
    margin-bottom: 14px; overflow: hidden;
}
.instr-head {
    width: 100%; padding: 20px 24px; background: none; border: 0; cursor: pointer;
    display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14.5px; text-align: left;
}
.instr.open .instr-head { color: var(--text); }
.instr-head svg:last-child { margin-left: auto; transition: .25s; }
.instr.open .instr-head svg:last-child { transform: rotate(180deg); color: var(--accent); }
.instr-body { display: none; padding: 0 24px 24px; }
.instr.open .instr-body { display: block; }
.app-card {
    background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-lg);
    padding: 22px; margin-bottom: 24px;
}
.app-card b { font-size: 16px; display: block; margin-bottom: 8px; }
.app-card p { color: var(--muted-2); font-size: 13px; margin-bottom: 18px; }
.step { display: flex; gap: 14px; margin-bottom: 20px; }
.step .n {
    width: 26px; height: 26px; border-radius: 8px; background: var(--accent-dim);
    border: 1px solid var(--accent-line); color: var(--accent); font-size: 12px; font-weight: 700;
    display: grid; place-items: center; flex: none;
}
.step b { font-size: 14.5px; display: block; margin-bottom: 4px; }
.step p { color: var(--muted-2); font-size: 12.5px; }

/* профиль */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }

/* способ оплаты */
.pay-method {
    display: flex; align-items: center; gap: 15px; width: 100%; padding: 18px 20px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg);
    cursor: pointer; transition: .16s; margin-bottom: 14px; text-align: left;
}
.pay-method:hover { border-color: var(--accent-line); background: #1c1c1c; }
.pay-method .pm-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: 17px; }
.pay-method b { font-size: 16px; display: block; }
.pay-method span { color: var(--muted-2); font-size: 13px; }

/* адаптив */
@media (max-width: 1080px) {
    .quick-grid, .buy-plans { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; padding: 0 0 40px; gap: 0; }
    .sidebar { display: none; }
    .sidebar.open {
        display: flex; position: fixed; inset: 0; z-index: 200; border-radius: 0;
        min-height: 100vh; overflow-y: auto;
    }
    .topbar { display: none; }
    .mob-header {
        display: flex; align-items: center; gap: 14px; margin: 16px 18px 22px;
        background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
        padding: 14px 18px; position: sticky; top: 12px; z-index: 90;
        backdrop-filter: blur(12px);
    }
    .mob-header .burger { display: grid; margin-left: auto; }
    .content { padding: 0 18px; }
    .sub-card { padding: 22px; }
    .sub-card .btn { margin-left: 0; width: 100%; }
    .buy-detail { padding: 22px; }
    .ref-stats { gap: 40px; }
}
