:root {
    --bg: #0a0a0f;
    --card-bg: rgba(22, 22, 30, 0.95);
    --card-border: rgba(255, 255, 255, 0.08);
    --accent: #4f8cff;
    --accent-2: #6b5cff;
    --text: #eaeaf0;
    --text-dim: #8a8a9a;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 16px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', -apple-system, sans-serif; }
body { 
    background: var(--bg); color: var(--text); padding: 16px; min-height: 100vh;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(79,140,255,.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(107,92,255,.08) 0%, transparent 50%);
    background-attachment: fixed;
    animation: bgPulse 15s ease-in-out infinite;
}
@keyframes bgPulse {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
}

/* Плавающая шапка */
.floating-header {
    position: sticky; top: 16px; z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
    background: var(--card-bg); backdrop-filter: blur(20px);
    border: 1px solid var(--card-border); border-radius: var(--radius);
    padding: 12px 16px; box-shadow: var(--shadow); margin-bottom: 16px;
    animation: slideDown .5s cubic-bezier(.4,0,.2,1);
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; cursor: pointer; transition: all .3s; text-decoration: none; color: inherit; }
.logo i { color: var(--accent); transition: all .3s; }
.logo:hover { transform: scale(1.05); }
.logo:hover i { text-shadow: 0 0 20px rgba(79,140,255,.8); animation: spin 1s ease; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.balance-pill {
    display: flex; align-items: center; gap: 6px;
    background: rgba(79, 140, 255, 0.15);
    padding: 6px 12px; border-radius: 20px;
    font-weight: 600; font-size: 14px; color: var(--accent);
    transition: all .3s; cursor: default;
}
.balance-pill:hover { background: rgba(79,140,255,.25); box-shadow: 0 0 20px rgba(79,140,255,.5); transform: scale(1.05); }

/* Кнопки */
button, .admin-btn, .profile-btn, .submenu-item, .search-btn, .search-menu-btn, .filter-btn, .logout-btn, .profile-action, .btn-primary, .btn-danger, .btn-success, .btn-ghost {
    transition: all .3s cubic-bezier(.4,0,.2,1);
    position: relative; overflow: hidden;
}

/* Ripple-эффект */
button::before, .admin-btn::before, .profile-btn::before, .search-btn::before, .search-menu-btn::before, .submenu-item::before {
    content: ''; position: absolute; top: 50%; left: 50%;
    width: 0; height: 0; border-radius: 50%;
    background: rgba(255,255,255,.3);
    transform: translate(-50%, -50%);
    transition: width .5s, height .5s;
    pointer-events: none;
}
button:active::before, .admin-btn:active::before, .profile-btn:active::before, .search-btn:active::before, .search-menu-btn:active::before, .submenu-item:active::before {
    width: 300px; height: 300px; transition: 0s;
}

.admin-btn {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff; text-decoration: none;
    padding: 8px 14px; border-radius: 10px;
    font-size: 12px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 6px;
    box-shadow: 0 4px 12px rgba(245,158,11,.3);
    line-height: 1; border: none; cursor: pointer;
}
.admin-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 0 25px rgba(245,158,11,.8), 0 0 50px rgba(245,158,11,.4), 0 8px 20px rgba(245,158,11,.5);
}
.admin-btn:active { transform: translateY(0) scale(.98); }

.profile-btn {
    color: var(--accent); font-size: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(79,140,255,.1);
    border: none; cursor: pointer;
}
.profile-btn:hover {
    background: rgba(79,140,255,.3);
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 0 25px rgba(79,140,255,.7), 0 0 50px rgba(79,140,255,.3);
}
.profile-btn:active { transform: scale(.95) rotate(0); }

/* Поиск */
.search-menu-wrapper { position: relative; margin-bottom: 16px; animation: slideUp .5s cubic-bezier(.4,0,.2,1) .1s backwards; }
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.search-menu-btn {
    width: 100%; padding: 16px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    background-size: 200% 200%;
    border: none; border-radius: 16px;
    color: white; font-weight: 700; font-size: 16px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 8px 24px rgba(79,140,255,.35);
    animation: gradientShift 3s ease infinite;
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.search-menu-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(79,140,255,.8), 0 0 60px rgba(79,140,255,.4), 0 12px 32px rgba(79,140,255,.5);
}
.search-menu-btn:active { transform: translateY(0) scale(.98); }
.search-menu-btn .arrow { transition: transform .3s; }
.search-menu-btn.open .arrow { transform: rotate(180deg); }

.search-submenu { max-height: 0; overflow: hidden; transition: max-height .5s cubic-bezier(.4,0,.2,1); margin-top: 8px; }
.search-submenu.open { max-height: 500px; }
.submenu-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: 12px; padding: 14px 18px; margin-bottom: 8px;
    cursor: pointer; color: var(--text-dim); font-weight: 500;
    opacity: 0; transform: translateX(-20px);
    animation: submenuIn .4s forwards;
}
@keyframes submenuIn { to { opacity: 1; transform: translateX(0); } }
.search-submenu.open .submenu-item:nth-child(1) { animation-delay: .05s; }
.search-submenu.open .submenu-item:nth-child(2) { animation-delay: .1s; }
.search-submenu.open .submenu-item:nth-child(3) { animation-delay: .15s; }
.search-submenu.open .submenu-item:nth-child(4) { animation-delay: .2s; }
.search-submenu.open .submenu-item:nth-child(5) { animation-delay: .25s; }
.submenu-item:hover {
    background: rgba(79,140,255,.15); color: var(--text);
    transform: translateX(8px) scale(1.02); border-color: var(--accent);
    box-shadow: 0 0 20px rgba(79,140,255,.5), inset 0 0 20px rgba(79,140,255,.05);
}
.submenu-item i { color: var(--accent); width: 20px; text-align: center; transition: transform .3s; }
.submenu-item:hover i { transform: scale(1.2); }
.submenu-item.active { 
    background: rgba(79,140,255,.25); color: white; border-color: var(--accent);
    box-shadow: 0 0 20px rgba(79,140,255,.5);
}

.floating-card {
    background: var(--card-bg); backdrop-filter: blur(20px);
    border: 1px solid var(--card-border); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px;
    animation: slideUp .5s cubic-bezier(.4,0,.2,1) .2s backwards;
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeInScale .4s cubic-bezier(.4,0,.2,1); }
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(.95); }
    to { opacity: 1; transform: scale(1); }
}
.input-group {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,.05); border: 1px solid var(--card-border);
    border-radius: 12px; padding: 12px 16px; margin-bottom: 12px;
    transition: all .3s;
}
.input-group:focus-within { 
    border-color: var(--accent); 
    box-shadow: 0 0 0 4px rgba(79,140,255,.15), 0 0 20px rgba(79,140,255,.3);
    transform: scale(1.01);
}
.input-group i { color: var(--accent); font-size: 16px; transition: transform .3s; }
.input-group:focus-within i { transform: scale(1.2); }
.input-group input { flex: 1; background: transparent; border: none; color: var(--text); font-size: 15px; outline: none; }
.input-group input::placeholder { color: var(--text-dim); }

.search-btn {
    width: 100%; padding: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    background-size: 200% 200%;
    border: none; border-radius: 12px; color: white;
    font-weight: 700; font-size: 15px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    animation: gradientShift 3s ease infinite;
}
.search-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(79,140,255,.8), 0 0 60px rgba(79,140,255,.4);
}
.search-btn:active { transform: translateY(0) scale(.98); }

/* Результаты */
.floating-result {
    display: none; position: fixed; bottom: 16px; left: 16px; right: 16px;
    background: var(--card-bg); backdrop-filter: blur(20px);
    border: 1px solid var(--card-border); border-radius: var(--radius);
    padding: 16px; box-shadow: var(--shadow);
    max-height: 60vh; overflow-y: auto; z-index: 200;
}
.floating-result.show { display: block; animation: slideUpBig .4s cubic-bezier(.4,0,.2,1); }
@keyframes slideUpBig {
    from { opacity: 0; transform: translateY(100px); }
    to { opacity: 1; transform: translateY(0); }
}
.result-header { display: flex; align-items: center; font-weight: 700; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--card-border); }
.result-header i { color: var(--accent); margin-right: 8px; animation: pulse 2s infinite; }
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Карточка результата */
.result-card { display: flex; flex-direction: column; gap: 12px; padding: 8px; }
.result-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: 12px;
    font-weight: 700; font-size: 14px; margin-bottom: 8px;
    animation: fadeInScale .4s;
}
.result-badge.success {
    background: rgba(34,197,94,.15); color: #22c55e;
    box-shadow: 0 0 25px rgba(34,197,94,.3);
}
.result-badge.success i { animation: pulse 2s infinite; }
.result-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; background: rgba(255,255,255,.03);
    border-radius: 10px; font-size: 14px;
    transition: all .3s; animation: fadeInScale .4s backwards;
}
.result-row:nth-child(2) { animation-delay: .05s; }
.result-row:nth-child(3) { animation-delay: .1s; }
.result-row:nth-child(4) { animation-delay: .15s; }
.result-row:nth-child(5) { animation-delay: .2s; }
.result-row:nth-child(6) { animation-delay: .25s; }
.result-row:nth-child(7) { animation-delay: .3s; }
.result-row:hover { background: rgba(79,140,255,.15); transform: translateX(6px); box-shadow: 0 0 15px rgba(79,140,255,.3); }
.result-row i { color: var(--accent); width: 20px; text-align: center; }
.result-row span { color: var(--text-dim); }
.result-row strong { margin-left: auto; color: var(--text); font-weight: 600; }
.result-error {
    display: flex; align-items: center; gap: 12px;
    padding: 16px; border-radius: 12px;
    background: rgba(239,68,68,.15); color: #ef4444;
    font-weight: 600; animation: shake .5s;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Уведомления */
.toast-container { position: fixed; top: 80px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
    background: var(--card-bg); backdrop-filter: blur(20px);
    border: 1px solid var(--card-border); border-left: 4px solid var(--accent);
    border-radius: 12px; padding: 14px 20px;
    color: var(--text); font-size: 14px; font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    min-width: 280px; max-width: 400px;
    display: flex; align-items: center; gap: 12px;
    animation: toastSlideIn .5s cubic-bezier(.4,0,.2,1);
    transition: opacity .3s ease, transform .3s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
@keyframes toastSlideIn {
    0% { opacity: 0; transform: translateX(120px) scale(.8); }
    70% { transform: translateX(-5px) scale(1.02); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}
.toast.hide { opacity: 0; transform: translateX(120px) scale(.8); }

/* Модалка профиля */
.profile-modal-bg {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.75); backdrop-filter: blur(12px);
    z-index: 3000; align-items: center; justify-content: center; padding: 16px;
}
.profile-modal-bg.show { display: flex; animation: fadeIn .3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.profile-modal {
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: 24px; padding: 24px; width: 100%; max-width: 480px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.7);
    animation: modalScale .4s cubic-bezier(.4,0,.2,1);
}
@keyframes modalScale {
    from { opacity: 0; transform: scale(.85) translateY(30px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.profile-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.profile-header h2 { font-size: 20px; font-weight: 800; }
.profile-close { font-size: 32px; color: var(--text-dim); cursor: pointer; line-height: 1; transition: all .3s; }
.profile-close:hover { color: var(--danger); transform: rotate(90deg) scale(1.2); }
.profile-modal .balance-card {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    background-size: 200% 200%;
    border-radius: 20px; padding: 24px; text-align: center; margin-bottom: 20px;
    box-shadow: 0 8px 30px rgba(79,140,255,.4);
    animation: gradientShift 4s ease infinite;
}
.profile-modal .balance-label { font-size: 13px; opacity: .85; margin-bottom: 6px; }
.profile-modal .balance-value { font-size: 40px; font-weight: 800; margin-bottom: 4px; }
.profile-modal .balance-checks { font-size: 13px; opacity: .9; }
.profile-section {
    background: rgba(255,255,255,.03); border: 1px solid var(--card-border);
    border-radius: 16px; padding: 16px; margin-bottom: 12px;
    transition: all .3s;
}
.profile-section:hover { border-color: var(--accent); box-shadow: 0 0 20px rgba(79,140,255,.2); }
.profile-section h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.profile-section h3 i { color: var(--accent); }
.profile-section code {
    display: block; background: rgba(79,140,255,.1); padding: 12px;
    border-radius: 10px; color: var(--accent); font-size: 11px;
    word-break: break-all; margin-bottom: 10px;
}
.profile-text { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; line-height: 1.5; }
.profile-action {
    width: 100%; padding: 12px; background: var(--accent);
    border: none; border-radius: 10px; color: white;
    font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.profile-action:hover { box-shadow: 0 0 25px rgba(79,140,255,.7); transform: translateY(-2px); }
.profile-action:active { transform: translateY(0) scale(.98); }
.profile-modal .faq-item { background: transparent; border: 1px solid var(--card-border); border-radius: 10px; margin-bottom: 8px; transition: all .3s; }
.profile-modal .faq-item:hover { border-color: var(--accent); }
.profile-modal .faq-q { padding: 12px 16px; font-size: 13px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.profile-modal .faq-a { font-size: 12px; padding: 0 16px; max-height: 0; overflow: hidden; transition: max-height .3s; color: var(--text-dim); line-height: 1.6; }
.profile-modal .faq-item.open .faq-a { padding: 0 16px 12px; max-height: 200px; }
.profile-modal .faq-item.open .faq-q i { transform: rotate(180deg); }
.profile-modal .faq-q i { transition: transform .3s; }
