/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

/* Скрываем полосу прокрутки для всего приложения */
body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body::-webkit-scrollbar {
    display: none;
}

.app-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.app-container::-webkit-scrollbar {
    display: none;
}

/* Убираем смещение рабочей области */
.app-container {
    margin-left: 0;
}


/* Убираем подчеркивания у всех кнопок */
button, .btn, input[type="button"], input[type="submit"] {
    text-decoration: none !important;
}

button:active, button:focus, button:visited,
.btn:active, .btn:focus, .btn:visited,
input[type="button"]:active, input[type="button"]:focus, input[type="button"]:visited,
input[type="submit"]:active, input[type="submit"]:focus, input[type="submit"]:visited {
    text-decoration: none !important;
    outline: none;
}

/* Окно загрузки */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: all 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    margin-bottom: 40px;
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 30px auto;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: rgba(255, 255, 255, 0.6);
    animation-duration: 1.2s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: rgba(255, 255, 255, 0.4);
    animation-duration: 0.9s;
}

.loading-text {
    font-size: 16px;
    font-weight: 500;
    opacity: 0.9;
    margin: 0;
    animation: textPulse 2s ease-in-out infinite;
}


@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes textPulse {
    0%, 100% {
        opacity: 0.9;
    }
    50% {
        opacity: 0.6;
    }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1e293b;
    line-height: 1.6;
    overflow-x: hidden;
}

.app-container {
    max-width: 630px;
    margin: 0 auto;
    min-height: 100vh;
    background: #ffffff;
    box-shadow: none;
    position: relative;
    width: 100%;
}

/* Специальные стили для Telegram приложения на компьютере */
body.telegram-webapp .app-container {
    max-width: 100%;
    min-width: auto;
    width: 100%;
    max-height: 100vh;
    overflow-y: auto;
}

/* Дополнительные стили для Telegram WebApp на больших экранах */
@media (min-width: 768px) {
    body.telegram-webapp .app-container {
        max-width: 630px;
        min-width: auto;
        margin: 0 auto;
        border-radius: 0;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
    }
    
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
}

/* Страницы */
.page {
    display: none;
    padding: 15px 20px 100px 20px;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* Хедер пользователя */
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    min-height: 60px;
    height: 60px;
}

.user-header .user-info {
    display: flex;
    align-items: baseline;
    flex: 1;
    justify-content: flex-start;
}

.user-header .balance-section {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 8px;
    flex: 1;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: white;
    line-height: 1;
    display: flex;
    align-items: center;
    height: 36px;
}

.balance {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    min-height: 36px;
}

.balance:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.balance-amount {
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
}

.balance i {
    font-size: 14px;
    opacity: 0.8;
    font-weight: bold;
}


.refresh-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    align-self: baseline;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.refresh-btn:active {
    transform: translateY(0);
}

.refresh-btn i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.refresh-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Статус бота */
.bot-status-section {
    margin-bottom: 12px;
}

.status-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.status-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.status-indicator.active {
    color: #10b981;
}

.status-indicator.inactive {
    color: #6b7280;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

.status-dot.inactive {
    background: #6b7280;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.bot-controls {
    display: flex;
    gap: 8px;
}

.btn-primary, .btn-secondary, .btn-neutral {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    white-space: nowrap;
    min-height: 48px;
    height: 48px;
}

.btn-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

/* Кнопки управления ботом */
.btn-start, .btn-stop, .btn-neutral {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0;
}

/* Зеленый фон для кнопки Старт */
.btn-start {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

/* Красный фон для кнопки Стоп */
.btn-stop {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.btn-neutral {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(107, 114, 128, 0.3);
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-stop:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-neutral:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 114, 128, 0.4);
}

/* Стили для отключенных кнопок */
.btn-neutral:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-neutral:disabled:hover,
.btn-secondary:disabled:hover {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    transform: none;
    box-shadow: 0 4px 16px rgba(107, 114, 128, 0.3);
}

.btn-secondary {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #64748b;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    min-width: 0;
    min-height: 48px;
    height: 48px;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Балансы */
.balance-section {
    margin-bottom: 12px;
}

.balance-cards {
    display: flex;
    gap: 12px;
}

.balance-card {
    flex: 1;
    background: white;
    border-radius: 16px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
}

.balance-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
}

.balance-value {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

/* Динамический цвет прибыли */
.profit-display.positive {
    color: #10b981;
}

.profit-display.negative {
    color: #ef4444;
}

/* Секция сделок */
.trades-section {
    margin-bottom: 12px;
}

/* Табы для сделок */
.trades-tabs {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
}

.tab-buttons {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
}

.tab-btn {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn.active {
    color: #667eea;
    background: white;
}

.tab-btn #trades-count {
    font-size: 12px;
    opacity: 0.8;
    margin-left: 4px;
}

/* Убрано подчеркивание активного таба */

.tab-content {
    display: none;
    padding: 0;
}

.tab-content.active {
    display: block;
}

.trades-list {
    background: white;
    border-radius: 0 0 16px 16px;
    overflow: hidden;
}

.trade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.trade-item:last-child {
    border-bottom: none;
}

.trade-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    flex: 1;
}

.trade-main-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
}

.trade-prices {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-left: 16px;
    flex-shrink: 0;
}

.price-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 60px;
}

.price-label {
    display: none;
}

.price-value {
    font-size: 11px;
    color: #1e293b;
    font-weight: 600;
    white-space: nowrap;
}

/* Цветовое выделение цен в зависимости от PnL */
.price-value.positive {
    color: #10b981;
    font-weight: 700;
}

.price-value.negative {
    color: #ef4444;
    font-weight: 700;
}

.trade-pair {
    font-weight: 600;
    color: #1e293b;
}

.trade-type {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.trade-type.buy {
    background: #dcfce7;
    color: #16a34a;
}

.trade-type.sell {
    background: #fef2f2;
    color: #dc2626;
}

.trade-size {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.trade-time {
    font-size: 9px;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

.trade-amount, .trade-pnl {
    font-weight: 600;
}

.trade-amount.positive, .trade-pnl.positive {
    color: #10b981;
}

.trade-amount.negative, .trade-pnl.negative {
    color: #ef4444;
}

/* Загрузка */
.loading-placeholder {
    text-align: center;
    padding: 24px 16px;
    color: #94a3b8;
    font-style: italic;
}

/* Пустая страница */
.empty-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border: 2px solid #e2e8f0;
}

.empty-icon i {
    font-size: 32px;
    color: #94a3b8;
}

/* Стили для страницы статистики */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    padding: 16px;
    background: white;
    margin-bottom: 8px;
}

.stat-card {
    text-align: center;
    padding: 16px 8px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.stat-value.positive {
    color: #10b981;
}

.stat-value.negative {
    color: #ef4444;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.daily-stats-container {
    background: white;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.section-header {
    padding: 4px 16px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.daily-stats-table {
    overflow-x: auto;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 80px 60px 80px;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-body {
    flex: 1;
    overflow-y: auto;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 80px 60px 80px;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: #f8fafc;
}

.col-date {
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
}

.col-symbol {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    text-align: center;
}

.col-trades {
    font-size: 13px;
    color: #1e293b;
    text-align: center;
}

.col-pnl {
    font-size: 13px;
    font-weight: 600;
    text-align: right;
}

.col-pnl.positive {
    color: #10b981;
}

.col-pnl.negative {
    color: #ef4444;
}

/* Стили для секции краткой сводки */
.stats-summary-section {
    margin-top: 1px;
    margin-bottom: 12px;
}

.empty-page h3 {
    font-size: 20px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.empty-page p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Страница сделок */
.date-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 16px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0; /* Позволяет элементам сжиматься */
}

.date-input {
    flex: 1;
    padding: 8px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: #f8fafc;
    min-width: 0; /* Позволяет input сжиматься */
}

.date-inputs span {
    color: #64748b;
    font-size: 14px;
    flex-shrink: 0;
}

.btn-filter {
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-filter:hover {
    transform: translateY(-1px);
}

/* Таблица сделок */
.trades-table-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 16px;
}

.trades-table {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
    margin-bottom: 16px;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 0.6fr 0.8fr 0.8fr 0.6fr;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 0.6fr 0.8fr 0.8fr 0.6fr;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    align-items: center;
}

.table-row:last-child {
    border-bottom: none;
}

.col-pair {
    font-weight: 600;
    color: #1e293b;
}

.col-profit.positive {
    color: #10b981;
    font-weight: 600;
}

.col-time {
    color: #64748b;
    font-size: 12px;
}

/* Гистограмма доходности */
.profit-chart-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
}

.profit-chart-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 16px;
}

.chart-container {
    height: 200px;
    position: relative;
    display: flex;
    align-items: end;
    gap: 8px;
    padding: 20px 0;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px 4px 0 0;
    min-height: 20px;
    position: relative;
    transition: all 0.3s ease;
}

.chart-bar.positive {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.chart-bar.negative {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.chart-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #64748b;
    white-space: nowrap;
}

.chart-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

/* Краткая сводка */
.summary-section {
    margin-bottom: 16px;
    width: 100%;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
}

.summary-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

.summary-item {
    flex: 1;
    text-align: center;
}

.summary-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 500;
}

.summary-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.summary-value.positive {
    color: #10b981;
}

.summary-value.negative {
    color: #ef4444;
}

/* Сводка по дням */
.daily-summary-section {
    margin-bottom: 16px;
}

.daily-summary-table {
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
}

.header-cell {
    padding: 8px 12px;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    text-align: center;
}

.header-cell:first-child {
    text-align: left;
}

.table-body {
    max-height: 300px;
    overflow-y: auto;
}

.daily-summary-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    padding: 8px 12px;
    align-items: center;
    transition: background-color 0.2s;
}

.daily-summary-item:hover {
    background-color: transparent;
}

.daily-summary-item:last-child {
    border-bottom: none;
}

.daily-summary-date {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

.daily-summary-stats {
    display: contents;
}

.daily-stat {
    text-align: center;
}

.daily-stat-label {
    display: none;
}

.daily-stat-value {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
}

.daily-stat-value.positive {
    color: #10b981;
}

.daily-stat-value.negative {
    color: #ef4444;
}

/* Подсказка для формы */
.form-hint {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
    font-style: italic;
}

/* Отображение курса SOL */
.sol-rate-display {
    margin-top: 0;
    padding: 0;
    background: transparent !important;
    border-radius: 0;
    border: none !important;
}

.sol-rate-display .rate-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.sol-rate-display .rate-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.sol-rate-display .rate-value {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
}

.sol-rate-display .rate-total {
    font-size: 18px !important;
    color: #1e293b !important;
    font-weight: 600 !important;
}

.sol-rate-display .rate-total span {
    font-weight: 600;
    color: #1e293b;
}

/* Информация об уведомлении в Telegram */
.telegram-notification-info {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    border-radius: 12px;
    padding: 16px;
    margin-top: 20px;
    text-align: center;
}

.telegram-notification-info p {
    color: #0369a1;
    margin: 0;
    font-size: 14px;
}

.telegram-notification-info i {
    margin-right: 8px;
}

/* Стили для галочек */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    padding: 8px 0;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    background: white;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label:hover .checkmark {
    border-color: #667eea;
}

/* Страница уведомлений */
.notification-filters {
    margin-bottom: 14px;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    background: white;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
}

.filter-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: #64748b;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification-item {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
    display: flex;
    transition: all 0.3s ease;
}

.notification-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.notification-item.hidden {
    display: none;
}

/* Иконки уведомлений скрыты */
.notification-icon {
    display: none;
}

/* Стили для разных типов уведомлений */
.trading-notification {
    border-left: 4px solid #10b981;
}

.system-notification {
    border-left: 4px solid #f59e0b;
}

.news-notification {
    border-left: 4px solid #3b82f6;
}

/* Пустая страница уведомлений */
.notifications-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
    padding: 40px 20px;
}

.notifications-empty .empty-icon {
    font-size: 48px;
    color: #94a3b8;
    margin-bottom: 16px;
}

.notifications-empty h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.notifications-empty p {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

.notification-content {
    flex: 1;
}

.notification-content h5 {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.notification-content p {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
    margin-bottom: 8px;
}

.notification-time {
    font-size: 12px;
    color: #94a3b8;
}

/* Стили для страницы статистики */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    padding: 16px;
    background: white;
    margin-bottom: 8px;
}

.stat-card {
    text-align: center;
    padding: 16px 8px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.stat-value.positive {
    color: #10b981;
}

.stat-value.negative {
    color: #ef4444;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.daily-stats-container {
    background: white;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.section-header {
    padding: 4px 16px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.daily-stats-table {
    overflow-x: auto;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 80px 60px 80px;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-body {
    flex: 1;
    overflow-y: auto;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 80px 60px 80px;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: #f8fafc;
}

.col-date {
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
}

.col-symbol {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    text-align: center;
}

.col-trades {
    font-size: 13px;
    color: #1e293b;
    text-align: center;
}

.col-pnl {
    font-size: 13px;
    font-weight: 600;
    text-align: right;
}

.col-pnl.positive {
    color: #10b981;
}

.col-pnl.negative {
    color: #ef4444;
}

/* Стили для секции краткой сводки */
.stats-summary-section {
    margin-top: 1px;
    margin-bottom: 12px;
}

/* Табы настроек */
.settings-tabs {
    margin-bottom: 12px;
}

.tab-buttons {
    display: flex;
    gap: 6px;
    background: white;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
}

.tab-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: #64748b;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tab-btn #trades-count {
    font-size: 11px;
    opacity: 0.9;
    margin-left: 3px;
}

.tab-btn:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Страница профиля */
.api-settings, .trading-settings, .notification-settings {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
}

.api-settings h4, .trading-settings h4, .notification-settings h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

/* Селектор торговых пар */
.trading-pair-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pair-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pair-option.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.pair-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pair-symbol {
    font-weight: 600;
    color: #1e293b;
    font-size: 13px;
}

.pair-status {
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.pair-option.active .pair-status {
    background: #667eea;
    color: white;
}

.pair-option.disabled .pair-status {
    background: #e2e8f0;
    color: #64748b;
}

/* Строка позиции и плеча */
.position-leverage-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.position-size-group,
.leverage-size-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.leverage-size-group .form-hint {
    margin-top: 0;
}

/* Информация о позиции */
.position-info {
    margin-top: 4px;
}

.position-info .form-hint {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}

.position-info .form-hint span {
    color: #1e293b;
    font-weight: 600;
    font-style: normal;
}

/* Дополнительные стили для Telegram приложения */
.trading-settings .form-group .position-settings-row {
    flex-wrap: nowrap !important;
}

.trading-settings .form-group .position-settings-row .position-size-group,
.trading-settings .form-group .position-settings-row .sol-rate-display {
    flex-shrink: 0 !important;
    flex-grow: 1 !important;
}

/* Специальные стили для Telegram WebApp */
body.telegram-webapp .trading-settings .form-group .position-settings-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 20px !important;
    align-items: flex-end !important;
    width: 100% !important;
    min-height: 80px !important;
}

body.telegram-webapp .trading-settings .form-group .position-settings-row .position-size-group {
    flex: 1 !important;
    max-width: 50% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    margin-bottom: 0 !important;
}

body.telegram-webapp .trading-settings .form-group .position-settings-row .sol-rate-display {
    flex: 1 !important;
    max-width: 50% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    margin-bottom: 0 !important;
    min-height: 60px !important;
}

.form-group {
    margin-bottom: 12px;
}

.form-group .position-settings-row {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.amount-input-group {
    position: relative;
}

.amount-input-group .currency {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: #6b7280;
}

/* Настройки плеча */
.leverage-input-group {
    position: relative;
    margin-bottom: 6px;
}

.btn-test-connection, .btn-save-settings {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-test-connection {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-save-settings {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-test-connection:hover, .btn-save-settings:hover {
    transform: translateY(-2px);
}

/* Нижнее меню */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 630px;
    background: white;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-around;
    padding: 8px 0 13px 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    z-index: 1000;
}


/* Исправление для страницы сделок - меню должно быть прокручиваемым */
#trades-page {
    padding-bottom: 120px; /* Увеличиваем отступ снизу для прокрутки */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 12px;
    color: #94a3b8;
    min-width: 60px;
}

.nav-item.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.nav-item i {
    font-size: 20px;
}

.nav-item span {
    font-size: 12px;
    font-weight: 500;
}

.nav-item:hover {
    color: #667eea;
    transform: translateY(-1px);
}

/* Всплывающая плашка снизу */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 630px;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    z-index: 2000;
    will-change: transform;
}


.bottom-sheet.active {
    transform: translateX(-50%) translateY(0);
}

.sheet-content {
    padding: 20px 24px 40px 24px;
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin: 8px auto 20px auto;
}

.sheet-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    text-align: center;
}

.sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.sheet-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Обновленные стили для опций пополнения */
.topup-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.topup-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafbfc;
}

.topup-option:hover {
    border-color: #667eea;
    background: white;
    transform: translateY(-1px);
}

.topup-option i:first-child {
    font-size: 24px;
    color: #667eea;
}

.topup-option span {
    flex: 1;
    font-weight: 600;
    color: #1e293b;
}

.topup-option i:last-child {
    color: #94a3b8;
}

/* Стили для страницы статистики */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    padding: 16px;
    background: white;
    margin-bottom: 8px;
}

.stat-card {
    text-align: center;
    padding: 16px 8px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.stat-value.positive {
    color: #10b981;
}

.stat-value.negative {
    color: #ef4444;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.daily-stats-container {
    background: white;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.section-header {
    padding: 4px 16px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.daily-stats-table {
    overflow-x: auto;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 80px 60px 80px;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-body {
    flex: 1;
    overflow-y: auto;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 80px 60px 80px;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: #f8fafc;
}

.col-date {
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
}

.col-symbol {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    text-align: center;
}

.col-trades {
    font-size: 13px;
    color: #1e293b;
    text-align: center;
}

.col-pnl {
    font-size: 13px;
    font-weight: 600;
    text-align: right;
}

.col-pnl.positive {
    color: #10b981;
}

.col-pnl.negative {
    color: #ef4444;
}

/* Стили для секции краткой сводки */
.stats-summary-section {
    margin-top: 1px;
    margin-bottom: 12px;
}

/* Анимации */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page.active {
    animation: slideInUp 0.3s ease;
}

/* Адаптивность для маленьких экранов */
@media (max-width: 630px) {
    .bottom-nav {
        left: 0;
        right: 0;
        transform: none;
        width: 100%;
    }
    
    .bottom-sheet {
        left: 0;
        right: 0;
        width: 100%;
        transform: translateY(100%);
    }
    
    .bottom-sheet.active {
        transform: translateY(0);
    }
}

@media (max-width: 280px) {
    .app-container {
        max-width: 100%;
        box-shadow: none;
        width: 100%;
    }
    
    .page {
        padding: 16px 16px 100px 16px;
    }
    
    #trades-page {
        padding-bottom: 120px;
    }
    
    .user-header {
        padding: 10px 12px;
        margin-bottom: 12px;
        min-height: 56px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .user-header .user-info {
        flex: 1;
        justify-content: flex-start;
    }
    
    .user-header .balance-section {
        flex: 1;
        justify-content: flex-end;
    }
    
    .user-info h3 {
        font-size: 18px;
    }
    
    .balance {
        padding: 6px 10px;
        min-height: 32px;
    }
    
    .balance-cards {
        gap: 8px;
    }
    
    .balance-card {
        padding: 10px;
    }
    
    .bot-controls {
        gap: 8px;
    }
    
    .btn-primary, .btn-secondary, .btn-neutral {
        padding: 8px 10px;
        font-size: 13px;
        min-width: 0;
        min-height: 44px;
        height: 44px;
    }
    
    .btn-secondary {
        white-space: normal;
    }
    
    .api-settings, .trading-settings {
        padding: 20px;
    }
    
    /* Мобильные стили для настроек позиции - только для очень маленьких экранов */
    @media (max-width: 280px) {
        .trading-settings .form-group .position-settings-row {
            flex-direction: column !important;
            gap: 16px;
            align-items: stretch;
            min-height: auto;
        }
        
        .trading-settings .form-group .position-settings-row .position-size-group {
            max-width: 100%;
        }
        
        .trading-settings .form-group .position-settings-row .sol-rate-display {
            max-width: 100%;
            padding: 10px;
            min-height: auto;
        }
    }
    
    .nav-item {
        padding: 8px 8px;
        min-width: 50px;
    }
    
    /* Дополнительные стили для фильтров дат на мобильных */
    .date-filters {
        padding: 12px;
        gap: 6px;
    }
    
    .date-input {
        padding: 6px 4px;
        font-size: 12px;
    }
    
    .btn-filter {
        padding: 6px 8px;
        font-size: 11px;
        gap: 2px;
    }
    
    .btn-filter i {
        font-size: 10px;
    }
    
    /* Мобильные стили для нового формата сделок */
    .trade-info {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        justify-content: space-between;
        width: 100%;
    }
    
    .trade-main-info {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        min-width: 0;
    }
    
    .trade-pair {
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .trade-type {
        font-size: 10px;
        padding: 2px 6px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .trade-size {
        font-size: 13px;
        font-weight: 700;
        color: #1e293b;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .trade-prices {
        display: flex;
        flex-direction: row;
        gap: 8px;
        flex-shrink: 0;
        margin: 0 8px;
    }
    
    .price-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        min-width: 50px;
    }
    
    .price-label {
        display: none;
    }
    
    .price-value {
        font-size: 10px;
        white-space: nowrap;
    }
    
    .trade-pnl {
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* Дополнительные стили для очень маленьких экранов */
@media (max-width: 360px) {
    .trade-info {
        gap: 6px;
    }
    
    .trade-main-info {
        gap: 6px;
    }
    
    .trade-pair {
        font-size: 11px;
    }
    
    .trade-type {
        font-size: 9px;
        padding: 2px 4px;
    }
    
    .trade-size {
        font-size: 12px;
    }
    
    .trade-prices {
        gap: 6px;
        margin: 0 6px;
    }
    
    .price-item {
        min-width: 45px;
    }
    
    .price-value {
        font-size: 9px;
    }
    
    .trade-pnl {
        font-size: 11px;
    }
    
    /* Адаптивность для позиции и плеча на маленьких экранах */
    .position-leverage-row {
        flex-direction: column;
        gap: 12px;
    }
}

/* Плавные переходы */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

/* Улучшенная прокрутка */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Стили для обратной связи */
.connection-status, .save-status {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.connection-status.success, .save-status.success {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    opacity: 1;
    visibility: visible;
}

.connection-status.error, .save-status.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    opacity: 1;
    visibility: visible;
}

/* Стили для полей с ошибкой */
.form-input.error {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input.success {
    border-color: #10b981;
    background: #f0fdf4;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Анимация появления статуса */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.connection-status.show, .save-status.show {
    animation: fadeInUp 0.3s ease;
}

/* Модальное окно для оплаты криптовалютой */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid #f1f5f9;
}

.modal-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #64748b;
}

.modal-body {
    padding: 24px;
}

/* Форма крипто-оплаты */
.crypto-form {
    margin-bottom: 16px;
}

.btn-generate-invoice {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.btn-generate-invoice:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-generate-invoice:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Результат генерации счета */
.invoice-result {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.invoice-info h5 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 16px 0;
    text-align: center;
}

.invoice-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.invoice-amount, .invoice-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.invoice-amount .label, .invoice-status .label {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.invoice-amount .value {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.invoice-status .value {
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
}

.invoice-status .value.pending {
    background: #fef3c7;
    color: #d97706;
}

.invoice-status .value.paid {
    background: #dcfce7;
    color: #16a34a;
}

.invoice-status .value.expired {
    background: #fef2f2;
    color: #dc2626;
}

/* Кнопки действий */
.invoice-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.btn-copy-link, .btn-open-link {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-copy-link {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.btn-copy-link:hover {
    background: #e2e8f0;
    color: #475569;
}

.btn-open-link {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-open-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Поле ссылки */
.invoice-link {
    margin-top: 16px;
}

.invoice-link label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.link-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.link-input-group .form-input {
    padding-right: 50px;
    background: white;
    border: 1px solid #d1d5db;
    font-size: 13px;
    color: #6b7280;
}

.btn-copy {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    padding: 6px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Оверлей для модального окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Анимации для модального окна */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal.active .modal-content {
    animation: modalSlideIn 0.3s ease;
}

/* Адаптивность для мобильных */
@media (max-width: 280px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 16px 20px 12px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .invoice-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-copy-link, .btn-open-link {
        width: 100%;
    }
}

/* Уведомления для крипто-оплаты */
.crypto-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 4000;
    animation: slideInDown 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.crypto-notification.success {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.crypto-notification.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Стили для страницы уведомлений */
.notification-filters {
    padding: 8px 20px 16px 20px;
    background: white;
    border-bottom: 1px solid #f1f5f9;
}

.filter-buttons {
    display: flex;
    gap: 6px;
    background: white;
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
}

.filter-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: #64748b;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.filter-btn:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.notifications-container {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.notifications-list {
    padding: 0;
}

.notification-item {
    display: flex;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
    border-left: 4px solid #e2e8f0;
}

/* Убраны разные цвета уведомлений - все используют стандартный цвет */

.notification-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-message {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.4;
    margin: 0;
    font-weight: 500;
}

.notification-time {
    font-size: 12px;
    color: #94a3b8;
    align-self: flex-end;
    white-space: nowrap;
}

/* Стили для страницы статистики */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    padding: 16px;
    background: white;
    margin-bottom: 8px;
}

.stat-card {
    text-align: center;
    padding: 16px 8px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.stat-value.positive {
    color: #10b981;
}

.stat-value.negative {
    color: #ef4444;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.daily-stats-container {
    background: white;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.section-header {
    padding: 4px 16px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.daily-stats-table {
    overflow-x: auto;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 80px 60px 80px;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-body {
    flex: 1;
    overflow-y: auto;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 80px 60px 80px;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: #f8fafc;
}

.col-date {
    font-size: 13px;
    color: #1e293b;
    font-weight: 500;
}

.col-symbol {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    text-align: center;
}

.col-trades {
    font-size: 13px;
    color: #1e293b;
    text-align: center;
}

.col-pnl {
    font-size: 13px;
    font-weight: 600;
    text-align: right;
}

.col-pnl.positive {
    color: #10b981;
}

.col-pnl.negative {
    color: #ef4444;
}

/* Стили для секции краткой сводки */
.stats-summary-section {
    margin-top: 1px;
    margin-bottom: 12px;
}
