/* --- Глобальные переменные и сброс стилей --- */
:root {
    --bg-primary: #0d0d12;
    --bg-secondary: #1a1a24;
    --bg-glass: rgba(28, 28, 40, 0.6);
    --bg-surface: #171724;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --accent: #6c5ce7;
    --gradient: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    --star-gradient: linear-gradient(135deg, #ffd700 0%, #ffac33 100%);
    --border: rgba(255, 255, 255, 0.1);
    --error-color: #ff7675;
    --success-color: #55efc4;
    --wheel-border-color: rgba(255,255,255,0.14);
    --sidebar-width: 240px;
    --header-height: 60px;
    --mobile-nav-height: 60px;
    --safe-area-inset-top: env(safe-area-inset-top);
    --safe-area-inset-bottom: env(safe-area-inset-bottom);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
html, body, #app-container, .main-wrapper { min-height: 100vh; }
body {
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
    background: radial-gradient(1200px 800px at -10% -20%, #1a1a2a 0%, transparent 60%),
                radial-gradient(1000px 700px at 110% 10%, #1e1533 0%, transparent 60%),
                radial-gradient(800px 600px at 50% 120%, #0f2230 0%, transparent 60%),
                linear-gradient(180deg, #0e0e14 0%, #0d0d12 100%);
    position: relative;
}

body::before {
    content: "";
    position: fixed; inset: 0; pointer-events: none;
    background: radial-gradient(1000px 600px at var(--gx, 20%) var(--gy, 10%), rgba(108,92,231,0.06), transparent 60%),
                radial-gradient(900px 600px at calc(var(--gx, 20%) + 40%) calc(var(--gy, 10%) + 30%), rgba(80,210,194,0.05), transparent 60%);
    animation: bgShift 16s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0% { --gx: 20%; --gy: 10%; }
  100% { --gx: 70%; --gy: 30%; }
}

/* --- Эффект стекла --- */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
}

/* --- Плоская поверхность (без блюра) --- */
.surface {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.surface:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.4);
}

/* --- НОВАЯ СТРУКТУРА ЛЕЙАУТА --- */
#app-container { display: flex; }

/* Сайдбар (только десктоп) */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    border-top: none; border-bottom: none; border-left: none;
    background: var(--bg-secondary);
}
.sidebar-header {
    padding: 0 1.2rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.logo {
    font-size: 1.3rem; font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-decoration: none;
}
.sidebar-nav { padding: 1rem; flex-grow: 1; overflow-y: auto; }
.nav-link {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.75rem 1rem; margin-bottom: 0.5rem;
    border-radius: 8px; color: var(--text-secondary);
    text-decoration: none; font-weight: 500;
    transition: all 0.2s ease;
}
.nav-link:hover { background-color: rgba(255,255,255,0.05); color: var(--text-primary); }
.nav-link.active { color: white; background: var(--gradient); box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3); }
.nav-link i { font-size: 1.1em; width: 20px; text-align: center; }

/* Основной контент и шапка */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}
.main-header {
    position: sticky; top: 0;
    height: var(--header-height);
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 900;
    border: none;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}
.header-left, .header-right { display: flex; align-items: center; gap: 1rem; }
.sidebar-toggle { display: none; /* Только для мобильных */ }
.logo-desktop { display: none; /* Только для десктопа, в шапке */ }
.page-title { margin-left: 0.8rem; font-weight: 700; color: #fff; opacity: 0.92; }

.content-wrapper {
    padding: clamp(1rem, 5vw, 2.5rem);
    flex-grow: 1;
}
.container { max-width: none; width: 100%; margin: 0; padding: 0 1.5rem; }
/* Narrow containers for desktop on specific pages */
@media (min-width: 1024px) {
  .container.narrow { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
}

/* Нижний навбар (только мобильные) */
.mobile-nav { display: none; }
.sidebar-backdrop { display: none; }

/* --- АДАПТИВНОСТЬ --- */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-wrapper { padding-left: 0; }
    .main-header { justify-content: flex-end; } /* Кнопка кошелька справа */
    .header-left { display: none; } /* Скрываем левую часть шапки */
    .mobile-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0;
        height: calc(var(--mobile-nav-height) + var(--safe-area-inset-bottom));
        padding-bottom: var(--safe-area-inset-bottom);
        justify-content: space-around; align-items: center; z-index: 950;
        border: none; border-top: 1px solid var(--border);
        background: var(--bg-secondary);
    }
    .mobile-nav-item {
        display: flex; flex-direction: column; align-items: center;
        gap: 0.2rem; color: var(--text-secondary); text-decoration: none;
        font-size: 0.7rem; font-weight: 500;
        padding: 0.5rem; flex-grow: 1; transition: color 0.2s;
    }
    .mobile-nav-item.active { color: var(--text-primary); }
    .mobile-nav-item.active i { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
    .content-wrapper { padding: 1.5rem 1rem;padding-bottom: 80px; }
}

@media (min-width: 769px) {
    .main-wrapper {
        margin-left: var(--sidebar-width);
    }
    .header-left .logo-desktop {
        display: block;
    }
}


/* --- Стили для страниц и компонентов (без изменений) --- */
.section-title {
    text-align: center; font-size: clamp(1.6rem, 4vw, 2rem);
    margin-bottom: 2rem; font-weight: 700;
}
.cta-button {
    background: var(--gradient); color: white;
    padding: 0.8rem 1.5rem; border-radius: 50px; text-decoration: none;
    font-weight: 600; transition: all 0.3s; font-size: 1rem;
    cursor: pointer; border: none; display: inline-flex;
    align-items: center; gap: 0.5rem;
}
.cta-button:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(108, 92, 231, 0.4); }

.hero-section { text-align: center; padding: 4rem 0; }
.hero-content h1 {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    background: linear-gradient(to right, #ffffff 0%, #c4c0ff 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    line-height: 1.2; margin-bottom: 1rem;
}
.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.2rem); color: var(--text-secondary);
    max-width: 600px; margin: 0 auto 2rem auto;
}

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.feature-card { padding: 2rem; border-radius: 16px; text-align: center; }
.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-secondary); font-size: 0.95rem; }

.calculator-container { width: 100%; max-width: none; margin: 0; border-radius: 0; padding: clamp(1rem, 2vw, 1.5rem) 0; display: flex; flex-direction: column; gap: 1.5rem; }
.stars-and-price-display { display: flex; justify-content: space-between; align-items: center; }
.stars-count-wrapper { display: flex; align-items: center; gap: 0.5rem; }
.stars-icon { width: 2.5rem; height: auto; filter: drop-shadow(0 0 10px #ffc107); fill: url(#star-gradient); }
.stars-amount-input {
    font-size: clamp(2.5rem, 6vw, 3.5rem); font-weight: 700; background: transparent;
    border: none; outline: none; color: transparent; -webkit-text-fill-color: transparent;
    background-image: var(--star-gradient); -webkit-background-clip: text; background-clip: text;
    width: 5.5ch; text-align: center; border-radius: 8px;
    transition: box-shadow 0.2s;
}
.stars-amount-input:focus {
    box-shadow: 0 0 0 3px var(--accent);
}
.stars-amount-input::-webkit-inner-spin-button, .stars-amount-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stars-amount-input[type=number] { -moz-appearance: textfield; }

.price-display { text-align: right; }
.price-usd { font-size: 1.8rem; font-weight: 500; color: var(--text-primary); }
.price-ton { color: var(--text-secondary); display: flex; align-items: center; gap: 0.3rem; justify-content: flex-end; }
.ton-icon { width: 1.2em; height: 1.2em; background: #0098ea; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.8em; font-weight: bold; color: white; }

.slider-container { padding: 0.5rem 0; }
.custom-slider { width: 100%; height: 8px; background: rgba(0,0,0,0.3); border-radius: 8px; position: relative; cursor: pointer; }
.slider-fill { position: absolute; height: 100%; background: var(--gradient); border-radius: 8px; }
.slider-thumb {
    position: absolute; width: 22px; height: 22px; background: white; border-radius: 50%;
    top: 50%; transform: translate(-50%, -50%); cursor: grab;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); border: 3px solid var(--accent);
}
.slider-thumb:active { cursor: grabbing; }
.slider-marks { display: flex; justify-content: space-between; margin-top: 0.5rem; font-size: 0.8rem; color: var(--text-secondary); }
.slider-mark { cursor: pointer; }

.quick-select { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.quick-select-btn {
    background: transparent; border: 1px solid var(--border); color: var(--text-secondary);
    padding: 0.5rem 1rem; border-radius: 8px; font-size: 0.9rem;
    cursor: pointer; transition: all 0.2s;
}
.quick-select-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.quick-select-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

#recipient-section { display: flex; flex-direction: column; gap: 1rem; }
.input-label { font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); margin-bottom: -0.5rem; }
.user-info-display {
    display: flex; align-items: center; gap: 1rem; padding: 0.6rem 1rem;
    background: rgba(85, 239, 196, 0.1); border: 1px solid var(--success-color); border-radius: 10px;
}
.user-avatar-wrapper {
    width: 44px;
    height: 44px;
    max-width: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}
#user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.user-name { font-weight: 500; flex-grow: 1; }
.change-user-text { font-size: 0.9rem; color: var(--accent); cursor: pointer; font-weight: 500; }

.username-input-wrapper { display: flex; align-items: center; gap: 0.5rem; background: rgba(0,0,0,0.2); border: 1px solid var(--border); border-radius: 10px; padding: 0.3rem; transition: border-color 0.3s; }
.username-input-wrapper.focused { border-color: var(--accent); }
.username-input-wrapper.error { border-color: var(--error-color); }
#username-input { flex: 1; padding: 0.6rem; background: transparent; border: none; color: var(--text-primary); font-size: 1rem; outline: none; }
.check-username-btn {
    width: 40px; height: 40px; background: var(--accent); border: none;
    border-radius: 8px; color: white; font-size: 1rem; cursor: pointer; transition: all 0.2s;
}
.check-username-btn:disabled { background: var(--border); color: var(--text-secondary); cursor: not-allowed; }
.check-username-btn .fa-spinner { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.buy-button {
    width: 100%; padding: 1rem; border-radius: 12px; font-size: 1.1rem;
    font-weight: 600;
}
.buy-button:disabled {
    background: rgba(255,255,255,0.1); color: var(--text-secondary);
    cursor: not-allowed; box-shadow: none; transform: none;
}
.hidden { display: none !important; }

.referral-card { width: 100%; max-width: none; margin: 0; border-radius: 0; padding: 1.5rem 0; text-align: left; }
.referral-description { color: var(--text-secondary); margin: -1rem auto 2rem; max-width: 450px; }
#connect-prompt { padding: 2rem 0; color: var(--text-secondary); }
.referral-input-wrapper { display: flex; gap: 0.5rem; }
#referral-link {
    flex: 1; padding: 0.8rem; background: rgba(0,0,0,0.3); border: 1px solid var(--border);
    border-radius: 10px; color: var(--text-primary); font-family: monospace; font-size: 0.9rem;
}
.copy-btn {
    padding: 0.8rem 1.2rem; background: var(--accent); border: none; border-radius: 10px;
    color: white; cursor: pointer; font-weight: 500; position: relative; min-width: 140px;
    display: inline-flex; justify-content: center; align-items: center; gap: 0.5rem;
}
.copied-text { color: var(--success-color); }

/* Referral: better small-screen layout */
@media (max-width: 520px) {
  .referral-input-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }
  #referral-link {
    width: 100%;
    min-width: 0;
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: nowrap;
  }
  .copy-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 360px) {
  #referral-link { font-size: 0.8rem; }
  .copy-btn { padding: 0.75rem 1rem; }
}

/* --- НОВЫЕ СТИЛИ ДЛЯ КОЛЕСА ФОРТУНЫ --- */
.wheel-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}
.wheel-modal-overlay {
    position: absolute;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
}
.wheel-modal-content {
    position: relative;
    z-index: 2001;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.wheel-close-btn {
    position: absolute;
    top: 10px; right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
}
.wheel-subtitle {
    margin-top: -1.5rem;
    color: var(--text-secondary);
}
.wheel-container {
    position: relative;
    width: clamp(260px, 60vw, 420px); height: clamp(260px, 60vw, 420px);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
.wheel-frame { position: relative; width: 100%; height: 100%; border-radius: 50%; border: 6px solid var(--wheel-border-color); overflow: hidden; }
.wheel-pointer {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    /* Outer (border) triangle */
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 26px solid var(--wheel-border-color);
    z-index: 10;
    filter: none;
}
.wheel-pointer::after {
    content: "";
    position: absolute;
    left: -12px;
    top: -24px; /* 26 (outer) - 22 (inner) */
    width: 0; height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 22px solid #ffffff;
}
.wheel {
    width: 100%; height: 100%;
    border-radius: 50%;
    border: none;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    list-style: none;
}
.wheel::after { display: none; }
.wheel-center-hub {
    position: absolute;
    width: 100px; height: 100px;
    background: #151522;
    border-radius: 50%;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-weight: 600;
    font-size: 1.2rem;
    border: none;
    box-shadow: none;
}
.wheel-center-hub span { opacity: .9; letter-spacing: .3px; }

.wheel-icon-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2;
}
.wheel-icon {
    position: absolute;
    top: 50%; left: 50%;
    width: 60px; height: 60px;
    margin-top: -30px; margin-left: -30px;
    transform-origin: center center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wheel-icon span { /* Стили для эмодзи */
    font-size: 1.8rem; /* Иконка меньше */
    display: block;
    transform: translateY(-115px); /* Будет переопределено JS */
    will-change: transform;
    backface-visibility: hidden;
}
.wheel-icon img { /* Стили для фото */
    width: 38px;
    height: 38px;
    object-fit: contain;
    display: block;
    transform: translateY(-115px); /* Будет переопределено JS */
    will-change: transform;
    backface-visibility: hidden;
}

/* Highlight wedge at pointer */
.wheel-highlight { display: none; }
.wheel.spin-glow { box-shadow: none; }

.wheel-result {
    text-align: center;
}
.wheel-result h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--success-color);
}
#spin-btn:disabled {
    cursor: not-allowed;
    background: var(--border);
}

/* --- Modal (generic) --- */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 3000; }
.modal.hidden { display: none; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(3px); opacity: 0; transition: opacity 200ms ease; }
.modal-box { position: relative; z-index: 1; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 16px; padding: 1.2rem 1rem; width: min(520px, 94vw); opacity: 0; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.5); animation: popIn 220ms cubic-bezier(.2,.8,.2,1) forwards; }
.modal.closing .modal-box { animation: popOut 180ms ease forwards; }
.modal-box h3 { margin: 0 0 0.25rem; }
.modal-box p { margin: 0 0 0.8rem; color: var(--text-secondary); }
.modal-close { position: absolute; right: 10px; top: 6px; background: transparent; border: none; color: var(--text-secondary); font-size: 1.8rem; cursor: pointer; }
.modal.show .modal-overlay { opacity: 1; }
@keyframes popIn { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes popOut { from { transform: translateY(0) scale(1); opacity: 1; } to { transform: translateY(8px) scale(.98); opacity: 0; } }

/* --- Статусы покупок (бейджи) --- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    white-space: nowrap;
}
.status-badge i { font-size: 12px; }
.status-confirmed { background: rgba(85, 239, 196, 0.15); color: #b8f7e5; }
.status-pending   { background: rgba(255, 206, 84, 0.18); color: #ffe8a3; }
.status-sent      { background: rgba(108, 92, 231, 0.18); color: #c7c1ff; }
.status-created   { background: rgba(160, 160, 176, 0.18); color: #e2e4ea; }
.status-failed    { background: rgba(255, 118, 117, 0.18); color: #ffd0cf; }

/* --- Подсветка строк покупок по статусу --- */
tr.purchase-row { transition: background-color 0.2s ease, box-shadow 0.2s ease; }
tr.purchase-row:hover { box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset; }
tr.purchase-row.status-confirmed { background: rgba(85, 239, 196, 0.06); }
tr.purchase-row.status-pending   { background: rgba(255, 206, 84, 0.06); }
tr.purchase-row.status-sent      { background: rgba(108, 92, 231, 0.06); }
tr.purchase-row.status-created   { background: rgba(160, 160, 176, 0.05); }
tr.purchase-row.status-failed    { background: rgba(255, 118, 117, 0.06); }

/* --- Toast --- */
.toast {
    position: fixed;
    right: 16px;
    bottom: calc(var(--mobile-nav-height) + 20px);
    max-width: 320px;
    background: rgba(28, 28, 40, 0.9);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    z-index: 3000;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 8px 30px rgba(0,0,0,0.35);
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (min-width: 769px) {
    .toast { bottom: 20px; }
}

/* --- Улучшенные таблицы --- */
.table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.table thead th { font-weight: 600; color: var(--text-secondary); font-size: 0.85rem; padding: 0.35rem 0.6rem; }
.table tbody tr { background: rgba(255,255,255,0.03); border-radius: 10px; }
.table tbody td { padding: 0.7rem 0.6rem; border-top: 1px solid rgba(255,255,255,0.06); border-bottom: 1px solid rgba(255,255,255,0.06); }
.table tbody tr:first-child td { border-top: 1px solid rgba(255,255,255,0.06); }
.table tbody tr td:first-child { border-left: 1px solid rgba(255,255,255,0.06); border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.table tbody tr td:last-child  { border-right: 1px solid rgba(255,255,255,0.06); border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
.table-compact thead th { padding: 0.3rem 0.5rem; }
.table-compact tbody td { padding: 0.55rem 0.5rem; }

/* --- Аватары и ячейка получателя --- */
.recipient-cell { display: flex; align-items: center; gap: 10px; }
.recipient-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(0,0,0,0.25); display: inline-block; overflow: hidden; }
.recipient-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.recipient-cell a { color: inherit; text-decoration: none; }
.recipient-cell a:hover { text-decoration: underline; }

/* --- /me: список покупок как карточки --- */
.me-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.purchase-item { border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,0.03); overflow: hidden; transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease; }
.purchase-item:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,0.25); border-color: rgba(255,255,255,0.14); }
.purchase-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px; cursor: pointer; }
.purchase-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.purchase-right { display: flex; align-items: center; gap: 10px; }
.status-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,0.08) inset; }
.status-confirmed-dot { background: #22c55e; }
.status-pending-dot { background: #f59e0b; }
.status-sent-dot { background: #6a82fb; }
.status-created-dot { background: #6b7280; }
.status-failed-dot { background: #ef4444; }
.purchase-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.purchase-amount { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.purchase-toggle { color: var(--text-secondary); transition: transform .2s ease; }
.purchase-item.open .purchase-toggle { transform: rotate(180deg); }
.purchase-details { padding: 0 12px; max-height: 0; overflow: hidden; transition: max-height .25s ease, padding-top .2s ease, padding-bottom .2s ease; }
.purchase-item.open .purchase-details { padding-top: 6px; padding-bottom: 10px; max-height: 500px; }
.purchase-detail-row { display: flex; gap: 8px; margin: 6px 0; color: var(--text-secondary); font-size: .95rem; }
.purchase-detail-label { min-width: 110px; color: #9aa; }

/* --- Chips --- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; font-size: 0.85rem; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); }
.chip .icon { font-size: 0.9em; }
.chip-primary { background: rgba(108, 92, 231, 0.15); border-color: rgba(108, 92, 231, 0.35); color: #c7c1ff; }

/* --- Кнопки улучшены --- */
.buy-button, .cta-button { box-shadow: 0 8px 24px rgba(108,92,231,0.25); }
.buy-button:hover, .cta-button:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(108,92,231,0.35); }



/* --- Анимации --- */
.fade-in { animation: fadeIn 300ms ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* --- Скелетоны --- */
.skeleton { position: relative; overflow: hidden; background: rgba(255,255,255,0.08); border-radius: 6px; }
.skeleton.shimmer:before {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton-line { height: 10px; width: 100%; }
.skeleton-line.sm { height: 8px; }
.skeleton-line.lg { height: 12px; }
.skeleton-avatar { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,0.08); }

/* --- Адаптив: таблица в карточки --- */
@media (max-width: 640px) {
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tbody tr { padding: 0.5rem 0.6rem; margin-bottom: 8px; border-radius: 10px; background: rgba(255,255,255,0.03); }
  .table.responsive tbody td { border: none; padding: 0.35rem 0; display: flex; align-items: center; gap: 12px; }
  .table.responsive tbody td::before { content: attr(data-label); color: var(--text-secondary); min-width: 36%; font-size: 0.85rem; }
  .table.responsive tbody td[data-label="ID заказа"] { font-family: monospace; font-size: 12px; color: var(--text-secondary); }
}
