/* =====================================================
   PYRITE MONITOR - НОВАЯ ВЕРСИЯ (100% КОПИЯ СТАРЫХ СТИЛЕЙ)
   Версия: 4.8 - ПРОФЕССИОНАЛЬНЫЕ СТИЛИ ДЛЯ ВСЕХ МОДАЛЬНЫХ ОКОН С CSS ПЕРЕМЕННЫМИ
   ===================================================== */
   /* ЦВЕТА */
   :root {
    --primary-bg: #1a1a1a;
    --secondary-bg: #2d2d2d;
    --primary-text: #ffffff;
    --accent: #FFD700;
    --card-bg: #2d2d2d;
    --header-bg: #2d2d2d;
    --border: #FFD700;
    --error: #ef4444;
    --success: #4CAF50;
    --warning: #FF9800;
    --info: #f3e921;
    --very-light-gray: #e0e0e0;
    --white: #2d2d2d;
    --off-white: #1a1a1a;
}
/* Сброс стилей и базовые настройки */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Применяем все стили только при активном классе theme-dark */
body.theme-dark {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
    min-height: 100vh;
    color: var(--primary-text);
    line-height: 1.5;
    font-weight: 400;
}

/* Навигация */
body.theme-dark
.nav-header {
    background: rgba(35, 35, 35, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    border: 1px solid var(--border);
    position: relative;
    z-index: 99999;
}

.nav-brand h1 {
    color: var(--primary-text);
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: #cdc731;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: #cdc731;
    color: white;
    transform: translateY(-2px);
}

/* Мобильное меню */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-right: 12px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 3px;
    background-color: #1a1a1a;
    margin: 2px 0;
    transition: 0.3s;
    border-radius: 1px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.nav-brand {
    display: flex;
    align-items: center;
    flex: 1;
}

.nav-description {
    display: flex;
    flex-direction: column;
    margin-left: 16px;
    font-size: 12px;
    opacity: 0.7;
    line-height: 1.2;
    color: #ccc;
}

.nav-favorite {
    background: none;
    border: none;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    margin-left: 16px;
    transition: 0.3s;
}

.nav-favorite:hover {
    transform: scale(1.1);
    color: #e74c3c;
}

@media (max-width: 768px) {
    .nav-header {
        flex-direction: row;
        gap: 15px;
        text-align: left;
        padding: 15px 20px;
    }
    
    .mobile-menu-toggle {
        display: flex;
        width: 44px;
        height: 44px;
        padding: 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        background: none;
        border: none;
    }
    
    .nav-brand h1 {
        font-size: 11px;
    }
    
    .nav-description {
        display: flex;
        font-size: 10px;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 250px;
        background: var(--secondary-bg);
        backdrop-filter: blur(10px);
        flex-direction: column;
        gap: 0;
        padding: 0;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        border-radius: 0 0 15px 15px;
        border: 1px solid rgba(26, 54, 126, 0.125);
        border-top: none;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 9999;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        width: 100%;
        text-align: left;
        padding: 15px 20px;
        border-radius: 0;
        border-bottom: 1px solid rgba(26, 54, 126, 0.1);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .nav-link:hover {
        background: var(--accent);
        color: white;
        transform: none;
    }
}

/* Скрыть гамбургер на десктопе */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}

/* Основной контейнер */
.trading-monitor-page {
    min-height: 100vh;
    padding: 20px;
    background: var(--primary-bg);
}

div {
    box-sizing: border-box;
}

.trading-monitor-container {
    max-width: 100%;
    margin: 0 auto;
    background: transparent;
    position: relative;
    z-index: 1;
}

/* Контролы монитора */
.monitor-controls {
    background: rgba(35, 35, 35, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap;
    border: 1px solid var(--border);
    position: relative;
    z-index: 1000;
    overflow-x: auto;
}

.view-control-group {
    flex: 1 1 auto;
    min-width: 200px;
}

.auto-update-control-group {
    flex: 0 0 auto;
    white-space: nowrap;
}

.share-control-group {
    flex: 0 0 auto;
    white-space: nowrap;
}

.folders-control-group {
    flex: 0 0 auto;
    white-space: nowrap;
}

.year-filter-control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.year-filter-label {
    font-weight: 600;
    color: #ffffff;
    font-size: 14px;
    white-space: nowrap;
}

.year-filter-select {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-text);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.year-filter-select:hover {
    border-color: #cdc731;
}

.year-filter-select:focus {
    outline: none;
    border-color: #cdc731;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-control-group {
    margin-left: auto;
}

.update-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    font-size: 13px;
    color: #ffffff;
    white-space: nowrap;
}

.monitor-controls > div {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Переключатель видов */
.view-label {
    font-weight: 600;
    color: var(--primary-text);
    font-size: 14px;
    white-space: nowrap;
}

.view-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-switcher-tabs {
    display: flex;
    gap: 5px;
}

.view-switcher-dropdown {
    position: relative;
    display: none;
    z-index: 99999;
}

.view-dropdown-toggle {
    background: linear-gradient(180deg, #2a2800 0%, #c4af00 100%);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.view-dropdown-toggle:hover {
    background: linear-gradient(180deg, #2a2800 0%, #c4af00 100%);
}

.view-dropdown-toggle.active {
    background: linear-gradient(180deg, #2a2800 0%, #c4af00 100%);
}

.view-dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.view-dropdown-toggle.active .view-dropdown-arrow {
    transform: rotate(180deg);
}

.view-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-top: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 99999;
}

.view-dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.view-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--primary-text);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    transition: background-color 0.3s ease;
}

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

.view-dropdown-item:hover {
    background-color: rgba(255, 215, 0, 0.1);
}

.view-dropdown-item.active {
    background: linear-gradient(135deg, #cdc731 0%, #8d8d01 100%);
    color: #ffffff;
}

.view-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.view-link {
    display: inline-block;
    padding: 10px 10px;
    background: var(--card-bg);
    color: var(--primary-text);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    cursor: pointer;
}

.view-link:hover {
    background: #3d3d3d;
    transform: translateY(-1px);
}

.view-link.active {
    background: linear-gradient(0deg, #fddd00 0%, #9a8200 100%) !important;
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Автообновление */
.auto-update-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auto-update-label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    white-space: nowrap;
}

.auto-update-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auto-update-btn {
    padding: 8px 16px;
    background: #f8fafc;
    color: #374151;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.auto-update-btn:hover {
    background: #e2e8f0;
}

.auto-update-btn.active {
    background: linear-gradient(0deg, #fddd00 0%, #9a8200 100%) !important;
    color: white;
    border-color: transparent;
}

.manual-update-btn {
    padding: 10px 10px;
    background: linear-gradient(0deg, #fddd00 0%, #9a8200 100%) !important;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
}

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

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

/* Статус обновления */
.update-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(52, 152, 219, 0.2);
    font-size: 13px;
    color: var(--primary-text);
    white-space: nowrap;
}

.update-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6b7280;
}

.update-text {
    font-weight: 500;
}

.countdown-timer {
    font-weight: 700;
    color: #374151;
    animation: pulse-countdown 2s ease-in-out infinite;
}

.countdown-timer.warning {
    color: #f59e0b;
    animation: pulse-countdown 1s ease-in-out infinite;
}

.countdown-timer.urgent {
    color: #ef4444;
    animation: pulse-countdown 0.5s ease-in-out infinite;
}

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

.update-status.active {
    background: rgba(76, 175, 80, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.update-status.active .update-indicator {
    background: var(--success);
    animation: pulse-green 2s ease-in-out infinite;
}

.update-status.updating {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #d97706;
}

.update-status.updating .update-indicator {
    background: #f59e0b;
    animation: pulse-orange 1s ease-in-out infinite;
}

.update-status.success {
    background: rgba(76, 175, 80, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.update-status.success .update-indicator {
    background: var(--success);
    animation: flash-green 0.5s ease-in-out;
}

.update-status.error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #dc2626;
}

.update-status.error .update-indicator {
    background: #ef4444;
    animation: flash-red 0.5s ease-in-out;
}

.update-status.retrying {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #d97706;
}

.update-status.retrying .update-indicator {
    background: #f59e0b;
    animation: pulse-orange 1s ease-in-out infinite;
}

.update-status.inactive {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #6b7280;
}

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

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

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

@keyframes flash-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes flash-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Основной контент */
.main-content-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: relative;
    z-index: 1;
}

/* Контейнер аккаунтов */
.accounts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(462px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

@media (min-width: 1200px) {
    .accounts-container {
        grid-template-columns: repeat(auto-fit, minmax(462px, 1fr));
        max-width: 100%;
        margin: 0;
    }
}

@media (max-width: 1199px) and (min-width: 768px) {
    .accounts-container {
        grid-template-columns: repeat(auto-fit, minmax(462px, 1fr));
    }
}

@media (max-width: 767px) {
    .accounts-container {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .account-card {
        min-width: 100%;
        max-width: 100%;
    }
}

/* Карточки аккаунтов */
.account-card {
    position: relative;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 0.46875rem 2.1875rem rgba(0, 0, 0, 0.2), 
                0 0.9375rem 1.40625rem rgba(0, 0, 0, 0.2), 
                0 0.25rem 0.53125rem rgba(0, 0, 0, 0.3), 
                0 0.125rem 0.1875rem rgba(0, 0, 0, 0.2);
    overflow: hidden;
    width: 100%;
    min-width: 0;
    max-width: none;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: anywhere;
    background-color: var(--card-bg);
    background-clip: border-box;
    z-index: 1;
}

.account-card::before,
.account-card::after {
    box-sizing: border-box;
}

.account-card.negative {
    /* background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); */
    /* border-color: rgba(239, 68, 68, 0.3); */
}

/*
.account-card.negative .account-balance,
.account-card.negative .account-equity,
.account-card.negative .account-profit,
.account-card.negative .profit-period,
.account-card.negative .account-datetime,
.account-card.negative .summary-item span,
.account-card.negative .trade-info,
.account-card.negative .position-profit,
.account-card.negative .metric-label,
.account-card.negative .metric-value {
    color: #ffffff !important;
}
*/

.account-card.negative .position-symbol {
    color: var(--primary-text) !important;
}

.account-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-color: rgba(14, 165, 233, 0.3);
}

.account-card > * {
    margin-bottom: 8px;
}

.account-card > *:last-child {
    margin-bottom: 0;
}

/* Заголовок карточки */
.account-header {
    background: linear-gradient(180deg, #2a2800 0%, #c4af00 100%);
    color: #ffffff;
    padding: 16px 16px;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.account-card.negative .account-header {
    /* background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); */
}

.account-header.income {
    background: linear-gradient(180deg, #2a2800 0%, #c4af00 100%);
}

.account-header.income .header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.account-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.account-header.brief {
    padding: 12px 16px;
}

/* Компактный вид для полного режима (по структуре конкурентов) */
.widget-content-outer {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--header-bg) 100%);
    color: #ffffff;
    padding: 16px;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.widget-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0px;
    width: 100%;
    flex-wrap: nowrap;
    min-width: 0;
}

.widget-content-left {
    flex: 1;
    min-width: 0;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
}

.widget-heading {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.account-name {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.account-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.widget-subheading {
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.metrics-row {
    display: flex;
    gap: 20px;
    flex-wrap: nowrap;
    min-width: 0;
}

.metric-col {
    flex: 1;
    min-width: 0;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
}

.metric-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-amount {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.metric-value.positive,
.metric-amount.positive {
    color: #ffffff !important;
}

.metric-value.negative,
.metric-amount.negative {
    color: #ffffff !important;
}

.widget-content-right {
    text-align: right;
    flex-shrink: 0;
    min-width: 0;
}

.widget-content-right .widget-heading {
    justify-content: flex-end;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.widget-numbers {
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 700;
}

.widget-numbers small {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    display: block;
    margin-bottom: 4px;
}

.profit-value {
    color: #ffffff;
    margin-right: 4px;
    font-size: 16px;
    font-weight: 600;
}

.profit-percent {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 16px;
}

.profit-value.positive,
.profit-percent.positive {
    color: #ffffff !important;
}

.profit-value.negative,
.profit-percent.negative {
    color: #ffffff !important;
}

.profit-history {
    font-size: 12px;
    line-height: 1.4;
}

.history-item {
    margin-bottom: 2px;
    color: rgba(255, 255, 255, 0.8);
}

.history-item small {
    color: rgba(255, 255, 255, 0.6);
    margin-right: 4px;
}

.history-item span {
    font-weight: 600;
    font-size: 14px;
}

.history-item .positive {
    color: #ffffff !important;
}

.history-item .negative {
    color: #ffffff !important;
}

.widget-progress-wrapper {
    margin-top: 12px;
}

.progress-bar {
    display: flex;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-balance,
.progress-equity {
    flex: 1;
    padding: 8px 12px;
    text-align: center;
    font-weight: 800;
    font-size: 18px;
    color: #ffffff;
}

.progress-balance {
    background: rgba(255, 255, 255, 0.15);
}

.progress-equity {
    background: rgba(255, 255, 255, 0.1);
}

.balance-value,
.equity-value {
    color: #ffffff;
    font-weight: 800;
}

.account-info {
    flex: 1;
    position: relative;
    z-index: 1;
    min-width: 0;
}

.account-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.account-balance-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.account-balance {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.account-equity {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    line-height: 1.2;
}

.account-stats {
    text-align: right;
    position: relative;
    z-index: 1;
    min-width: 0;
}

.account-datetime {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    font-weight: 500;
}

.account-profit {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
    color: #ffffff;
    line-height: 1.2;
}

.account-profit.positive {
    color: #ffffff !important;
}

.account-profit.negative {
    color: #ffffff !important;
}

.profit-periods {
    font-size: 14px;
    line-height: 1.6;
}

.profit-period {
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.profit-period .positive {
    color: #ffffff !important;
    font-weight: 700;
}

.profit-period .negative {
    color: #ffffff !important;
    font-weight: 700;
}

/* Сводка аккаунта */
.account-summary {
    background: var(--card-bg);
    padding: 10px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.summary-item span:first-child {
    color: #cccccc;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-item span:last-child {
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
    line-height: 1.2;
}

.summary-item .positive {
    color: #cdc731;
}

.summary-item .negative {
    color: #dc2626;
}

/* Позиции */
.positions-container {
    padding: 8px;
    background: transparent;
}

.account-card.negative .positions-container {
    background: transparent;
}

.positions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 73px);
    gap: 6px;
    justify-content: start;
    padding: 6px 0;
}

.position-card {
        color: #ffffff !important;
        padding: 4px 0px !important;
        border-radius: 6px !important;
        text-align: center !important;
        width: 75px !important;
        height: 95px !important;
        min-width: 75px !important;
        max-width: 75px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        align-items: stretch !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
        position: relative !important;
        overflow: hidden !important;
        border: none !important;
        font-size: 11px !important;
        font-weight: bold !important;
        backdrop-filter: blur(10px) !important;
    }

.position-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.position-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
}

.position-card {
    background: #ffd700 !important;
    border: 1px solid rgba(58, 196, 125, 0.3) !important;
}

.position-card.warning {
    background: #f7b924 !important;
    border: 1px solid rgba(247, 185, 36, 0.35) !important;
}

.position-card.danger {
    background: #dc3545 !important;
    border: 1px solid rgba(220, 53, 69, 0.35) !important;
}

.position-card.profit {
    background: linear-gradient(180deg, #2af598 0%, #009efd 100%) !important;
    border: 1px solid rgba(42, 245, 152, 0.35) !important;
}

.position-symbol {
    font-size: 0.75rem;
    font-weight: 700;
    color: #343a40 !important;
    margin-bottom: 2px;
    text-shadow: none;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.position-price {
    font-size: 0.7rem;
    font-weight: 600;
    color: #ffffff !important;
    margin: -2px 0px 2px -2px !important;
    text-shadow: none;
    background: #343a40 !important;
    padding: 3px 1px;
    border-radius: 0;
    width: calc(100% + 4px) !important;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.position-drawdown {
    font-size: 0.77rem;
    font-weight: 800;
    color: #343a40 !important;
    margin-bottom: 6px;
    text-shadow: none;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.position-buy {
    font-size: 0.73rem;
    font-weight: 700;
    color: #343a40 !important;
    margin-bottom: 1px;
    text-shadow: none;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.position-sell {
    font-size: 0.73rem;
    font-weight: 700;
    color: #343a40 !important;
    margin-top: 1px;
    text-shadow: none;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.no-positions {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    padding: 20px;
    font-style: italic;
}

.account-card.negative .no-positions {
    color: rgba(255, 255, 255, 0.7);
}

/* Состояния */
.loading {
    text-align: center;
    color: #ffffff;
    font-size: 18px;
    padding: 60px 20px;
    background: rgba(45, 45, 45, 0.9);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

.error-message {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.2);
}

/* Адаптивность */
@media (max-width: 480px) {
    .trading-monitor-page {
        padding: 10px;
    }
    
    /* Скрываем десктопные контролы только на очень маленьких экранах */
    .monitor-controls {
        display: none !important;
    }
    
    /* Показываем мобильные кнопки */
    .mobile-controls {
        display: flex !important;
        align-items: center;
        gap: 8px;
        background: var(--secondary-bg);
        backdrop-filter: blur(10px);
        border-radius: 12px;
        padding: 12px 15px;
        margin-bottom: 20px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(26, 54, 126, 0.125);
        flex-wrap: wrap;
    }
    
    .mobile-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        border-radius: 8px;
        background: #f8fafc;
        color: #475569;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
    }
    
    .mobile-btn:hover {
        background: #e2e8f0;
        color: #1e293b;
        transform: translateY(-1px);
    }
    
    .mobile-btn.active {
        background: #3498db;
        color: white;
    }
    
    .mobile-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .mobile-status {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-left: auto;
        padding: 6px 10px;
        background: rgba(52, 152, 219, 0.1);
        border-radius: 6px;
        border: 1px solid rgba(52, 152, 219, 0.2);
    }
    
    .mobile-indicator {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--accent);
        animation: pulse 2s infinite;
    }
    
    .mobile-timer {
        font-size: 12px;
        font-weight: 500;
        color: #1e293b;
    }
    
    .status-control-group {
        margin-left: 0;
        order: -1;
    }
    
    .update-status {
        justify-content: center;
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .view-control-group {
        flex: 1;
        min-width: 200px;
    }
    
    .auto-update-control-group {
        flex: 0 0 auto;
    }
    
    .year-filter-control-group {
        display: none;
    }
    
    .control-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .monitor-controls > div {
        flex-direction: row;
        gap: 8px;
    }
    
    .view-switcher {
        flex-direction: column;
        gap: 8px;
    }
    
    .view-switcher-tabs {
        display: none;
    }
    
    .view-switcher-dropdown {
        display: block;
    }
    
    .view-dropdown-toggle {
        width: auto;
        min-width: 140px;
        justify-content: space-between;
    }
    
    .auto-update-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .manual-update-btn {
        width: 100%;
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .update-status {
        width: 100%;
        justify-content: center;
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .accounts-container {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .account-card {
        border-radius: 6px;
        margin-bottom: 12px;
    }
    
    .account-header {
        flex-direction: row;
        gap: 12px;
        padding: 12px;
        align-items: flex-start;
    }
    
    .account-name {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .account-balance {
        font-size: 18px;
    }
    
    .account-equity {
        font-size: 16px;
    }
    
    .account-stats {
        text-align: right;
        min-width: 120px;
    }
    
    .account-datetime {
        font-size: 10px;
        margin-bottom: 6px;
    }
    
    .account-profit {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .profit-periods {
        font-size: 10px;
    }
    
    .account-summary {
        grid-template-columns: 1fr 1fr !important;
        padding: 8px 12px;
        gap: 6px;
    }
    
    .summary-item {
        font-size: 11px;
    }
    
    .positions-grid {
        grid-template-columns: repeat(auto-fit, minmax(73px, 73px));
        gap: 6px;
        padding: 8px;
    }
    
    .position-card {
        padding: 4px 0px !important;
        font-size: 10px;
    }
    
    .position-symbol {
        font-size: 10px;
    }
    
    .position-price {
        font-size: 9px;
    }
    
    /* Общий баланс для мобильных */
    .total-balance-section {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .balance-row {
        gap: 8px;
        padding: 6px 0;
    }
    
    .balance-title {
        font-size: 14px;
    }
    
    .balance-amount {
        font-size: 20px;
    }
    
    .balance-label {
        font-size: 10px;
    }
    
    .balance-period {
        font-size: 11px;
    }
    
    .balance-value {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .trading-monitor-page {
        padding: 8px;
    }
    
    .accounts-container {
        gap: 8px;
    }
    
    .account-card {
        border-radius: 4px;
    }
    
    .account-header {
        padding: 10px;
        flex-direction: row;
        gap: 10px;
        align-items: flex-start;
    }
    
    .account-info {
        flex: 1;
        min-width: 0;
    }
    
    .account-stats {
        text-align: right;
        min-width: 100px;
    }
    
    .account-summary {
        padding: 6px 10px;
        grid-template-columns: 1fr 1fr !important;
    }
    
    .positions-container {
        padding: 4px;
    }
    
    .positions-grid {
        grid-template-columns: repeat(auto-fit, minmax(73px, 73px));
        gap: 6px;
    }   
    
    .position-card {
        padding: 4px 0px !important;
        font-size: 9px;
    }
    
    .position-symbol {
        font-size: 9px;
    }
    
    .position-price {
        font-size: 8px;
    }
    
    /* Еще более компактный общий баланс */
    .total-balance-section {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .balance-row {
        gap: 6px;
        padding: 4px 0;
    }
    
    .balance-title {
        font-size: 12px;
    }
    
    .balance-amount {
        font-size: 18px;
    }
    
    .balance-label {
        font-size: 9px;
    }
    
    .balance-period {
        font-size: 10px;
    }
    
    .balance-value {
        font-size: 13px;
    }
    
    /* Мобильные стили для режима "Доход" */
    .trading-monitor-container.view-income .account-header.income {
        padding: 10px;
    }
    
    .trading-monitor-container.view-income .header-top {
        gap: 8px;
    }
    
    .trading-monitor-container.view-income .account-name {
        font-size: 14px;
    }
    
    .trading-monitor-container.view-income .account-datetime {
        font-size: 10px;
    }
    
    .trading-monitor-container.view-income .account-performance {
        font-size: 9px;
    }
    
    .trading-monitor-container.view-income .balance-info {
        font-size: 9px;
    }
    
    .trading-monitor-container.view-income .income-stats {
        padding: 10px;
    }
    
    .trading-monitor-container.view-income .income-row {
        gap: 6px;
        padding: 4px 0;
    }
    
    .trading-monitor-container.view-income .income-row.header {
        font-size: 10px;
        padding-bottom: 6px;
        margin-bottom: 4px;
    }
    
    .trading-monitor-container.view-income .income-left {
        font-size: 11px;
    }
    
    .trading-monitor-container.view-income .income-center,
    .trading-monitor-container.view-income .income-right {
        font-size: 11px;
    }
    
    /* Мобильные стили для режима "По месяцам" */
    .trading-monitor-container.view-monthly .account-header.monthly {
        padding: 10px;
    }
    
    .trading-monitor-container.view-monthly .header-top {
        gap: 8px;
    }
    
    .trading-monitor-container.view-monthly .account-name {
        font-size: 14px;
    }
    
    .trading-monitor-container.view-monthly .account-datetime {
        font-size: 10px;
    }
    
    .trading-monitor-container.view-monthly .account-performance {
        font-size: 9px;
    }
    
    .trading-monitor-container.view-monthly .balance-info {
        font-size: 9px;
    }
    
    .trading-monitor-container.view-monthly .monthly-stats {
        padding: 10px;
    }
    
    .trading-monitor-container.view-monthly .monthly-row {
        gap: 6px;
        padding: 4px 0;
    }
    
    .trading-monitor-container.view-monthly .monthly-row.header {
        font-size: 10px;
        padding-bottom: 6px;
        margin-bottom: 4px;
    }
    
    .trading-monitor-container.view-monthly .monthly-left {
        font-size: 11px;
    }
    
    .trading-monitor-container.view-monthly .monthly-center,
    .trading-monitor-container.view-monthly .monthly-right {
        font-size: 11px;
    }
}

/* === КРАТКИЙ ВИД - КОМПАКТНЫЕ КАРТОЧКИ === */
.trading-monitor-container.view-brief .account-card {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
}

.trading-monitor-container.view-brief .account-header {
    background: linear-gradient(180deg, #2a2800 0%, #c4af00 100%);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.trading-monitor-container.view-brief .account-info {
    flex: 1;
    min-width: 0;
}

.trading-monitor-container.view-brief .account-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trading-monitor-container.view-brief .account-balance {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.trading-monitor-container.view-brief .account-stats {
    text-align: right;
    flex-shrink: 0;
}

.trading-monitor-container.view-brief .account-datetime {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 6px;
    font-weight: 500;
}

.trading-monitor-container.view-brief .account-profit {
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0;
}

/* Компактная сводка для краткого вида */
.trading-monitor-container.view-brief .account-summary {
    background: #f8fafc;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    flex-wrap: wrap;
}

.trading-monitor-container.view-brief .brief-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.trading-monitor-container.view-brief .brief-metric-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    line-height: 1;
}

.trading-monitor-container.view-brief .brief-metric-value {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.trading-monitor-container.view-brief .brief-metric-value.positive {
    color: #938e00;
}

.trading-monitor-container.view-brief .brief-metric-value.negative {
    color: #dc2626;
}

/* Скрываем ненужные элементы в кратком виде */
.trading-monitor-container.view-brief .positions-container {
    display: none;
}

.trading-monitor-container.view-brief .account-equity,
.trading-monitor-container.view-brief .profit-periods {
    display: none;
}

/* === ВИД ДОХОДОВ === */
/* === СТИЛИ ДЛЯ РЕЖИМА "ДОХОД" === */
.trading-monitor-container.view-income .account-card {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 0.46875rem 2.1875rem rgba(0, 0, 0, 0.2), 
                0 0.9375rem 1.40625rem rgba(0, 0, 0, 0.2), 
                0 0.25rem 0.53125rem rgba(0, 0, 0, 0.3), 
                0 0.125rem 0.1875rem rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.trading-monitor-container.view-income .account-header.income {
    background: linear-gradient(180deg, #2a2800 0%, #c4af00 100%);
    padding: 16px;
    color: #ffffff;
    border-radius: 8px 8px 0 0;
}

.trading-monitor-container.view-income .header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    gap: 20px;
}

.trading-monitor-container.view-income .account-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
}

.trading-monitor-container.view-income .account-datetime {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.trading-monitor-container.view-income .account-performance {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.trading-monitor-container.view-income .account-performance div {
    margin-bottom: 2px;
}

.trading-monitor-container.view-income .account-stats.income {
    text-align: right;
    flex-shrink: 0;
}

.trading-monitor-container.view-income .balance-info {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.trading-monitor-container.view-income .balance-info div {
    margin-bottom: 2px;
}

/* Статистика доходов */
.trading-monitor-container.view-income .income-stats {
    background: var(--card-bg);
    padding: 16px;
    border-radius: 0 0 8px 8px;
}

.trading-monitor-container.view-income .income-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    align-items: center;
}

.trading-monitor-container.view-income .income-row:last-child {
    border-bottom: none;
}

.trading-monitor-container.view-income .income-row.header {
    font-weight: 600;
    color: #cccccc;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 6px;
}

.trading-monitor-container.view-income .income-left {
    font-weight: 500;
    color: #ffffff;
    font-size: 13px;
}

.trading-monitor-container.view-income .income-center,
.trading-monitor-container.view-income .income-right {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-text);
}

.trading-monitor-container.view-income .income-center.positive,
.trading-monitor-container.view-income .income-right.positive {
    color: #7a771a;
}

.trading-monitor-container.view-income .income-center.negative,
.trading-monitor-container.view-income .income-right.negative {
    color: #dc2626;
}

/* Скрываем ненужные элементы в виде доходов */
.trading-monitor-container.view-income .positions-container {
    display: none;
}

.trading-monitor-container.view-income .account-summary {
    display: none;
}

/* Скрываем мобильные кнопки на десктопе и показываем десктопные контролы */
@media (min-width: 481px) {
    .mobile-controls {
        display: none;
    }
    
    .monitor-controls {
        display: flex !important;
        flex-wrap: wrap;
    }
}

/* === СТИЛИ ДЛЯ РЕЖИМА "ПО МЕСЯЦАМ" === */
.trading-monitor-container.view-monthly .account-card {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 0.46875rem 2.1875rem rgba(0, 0, 0, 0.2), 
                0 0.9375rem 1.40625rem rgba(0, 0, 0, 0.2), 
                0 0.25rem 0.53125rem rgba(0, 0, 0, 0.3), 
                0 0.125rem 0.1875rem rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.trading-monitor-container.view-monthly .account-header.monthly {
    background: linear-gradient(180deg, #2a2800 0%, #c4af00 100%);
    padding: 16px;
    color: #ffffff;
    border-radius: 8px 8px 0 0;
}

.trading-monitor-container.view-monthly .header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    gap: 20px;
}

.trading-monitor-container.view-monthly .account-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #ffffff;
}

.trading-monitor-container.view-monthly .account-datetime {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.trading-monitor-container.view-monthly .account-performance {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.trading-monitor-container.view-monthly .account-performance div {
    margin-bottom: 2px;
}

.trading-monitor-container.view-monthly .account-stats.monthly {
    text-align: right;
    flex-shrink: 0;
}

.trading-monitor-container.view-monthly .balance-info {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.trading-monitor-container.view-monthly .balance-info div {
    margin-bottom: 2px;
}

/* Статистика по месяцам */
.trading-monitor-container.view-monthly .monthly-stats {
    background: var(--card-bg);
    padding: 16px;
    border-radius: 0 0 8px 8px;
}

.trading-monitor-container.view-monthly .monthly-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    align-items: center;
}

.trading-monitor-container.view-monthly .monthly-row:last-child {
    border-bottom: none;
}

.trading-monitor-container.view-monthly .monthly-row.header {
    font-weight: 600;
    color: #cccccc;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 6px;
}

.trading-monitor-container.view-monthly .monthly-left {
    font-weight: 500;
    color: #ffffff;
    font-size: 13px;
}

.trading-monitor-container.view-monthly .monthly-center,
.trading-monitor-container.view-monthly .monthly-right {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-text);
}

.trading-monitor-container.view-monthly .monthly-center.positive,
.trading-monitor-container.view-monthly .monthly-right.positive {
    color: #7a771a;
}

.trading-monitor-container.view-monthly .monthly-center.negative,
.trading-monitor-container.view-monthly .monthly-right.negative {
    color: #dc2626;
}

/* Скрываем ненужные элементы в виде по месяцам */
.trading-monitor-container.view-monthly .positions-container {
    display: none;
}

.trading-monitor-container.view-monthly .account-summary {
    display: none;
}

/* === ОБЩИЙ БАЛАНС === */
.total-balance-section {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 0.46875rem 2.1875rem rgba(4, 9, 20, 0.03), 
                0 0.9375rem 1.40625rem rgba(4, 9, 20, 0.03), 
                0 0.25rem 0.53125rem rgba(4, 9, 20, 0.05), 
                0 0.125rem 0.1875rem rgba(4, 9, 20, 0.03);
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid rgba(26, 54, 126, 0.125);
}

/* Стили для карточки "Общий Баланс" в виде "Доход" */
.trading-monitor-container.view-income .accounts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 10px;
    align-items: stretch;
    justify-content: center;
    justify-items: stretch;
    align-content: stretch;
}

.total-balance-table {
    width: 100%;
}

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

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

.balance-header-row {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 6px;
}

.balance-labels-row {
    font-weight: 600;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 6px;
}

.balance-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    grid-column: 1 / 4;
}

.balance-amount {
    font-size: 24px;
    font-weight: 800;
    color: #cdc731;
    text-align: center;
    grid-column: 1 / 4;
}

.balance-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-period {
    font-weight: 500;
    color: #374151;
    font-size: 13px;
}

.balance-value {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

.balance-value.positive {
    color: #7a771a;
}

.balance-value.negative {
    color: #dc2626;
} 

/* === Компактный блок для баланса, пополнений, снятий === */
.main-blue-bg {
    background: linear-gradient(180deg, #2a2800 0%, #c4af00 100%);
    color: #fff;
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 0;
}

.compact-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 18px;
    align-items: center;
    font-size: 1.1em;
}

.account-label {
    font-weight: 500;
    opacity: 0.85;
}

.account-value {
    font-weight: 600;
    text-align: right;
}

@media (max-width: 600px) {
    .main-blue-bg {
        padding: 12px 10px;
        border-radius: 10px;
        font-size: 0.98em;
    }
    .compact-grid {
        gap: 4px 8px;
        font-size: 1em;
    }
}

/* === МОБИЛЬНЫЕ КНОПКИ С ИКОНКАМИ === */
.mobile-controls {
    display: none; /* По умолчанию скрыты */
}

@media (max-width: 480px) {
    .mobile-controls {
        display: flex;
        align-items: center;
        gap: 8px;
        background: var(--secondary-bg);
        backdrop-filter: blur(10px);
        border-radius: 12px;
        padding: 12px 15px;
        margin-bottom: 20px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(26, 54, 126, 0.125);
        flex-wrap: wrap;
    }
    
    .mobile-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        border-radius: 8px;
        background: #f8fafc;
        color: #475569;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
    }
    
    .mobile-btn:hover {
        background: #e2e8f0;
        color: #1e293b;
        transform: translateY(-1px);
    }
    
    .mobile-btn.active {
        background: #cdc731;
        color: white;
    }
    
    .mobile-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .mobile-status {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-left: auto;
        padding: 6px 10px;
        background: rgba(52, 152, 219, 0.1);
        border-radius: 6px;
        border: 1px solid rgba(52, 152, 219, 0.2);
    }
    
    .mobile-indicator {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #cdc731;
        animation: pulse 2s infinite;
    }
    
    .mobile-timer {
        font-size: 12px;
        font-weight: 500;
        color: #1e293b;
    }
}

/* =====================================================
   СТИЛИ ДЛЯ ФУНКЦИИ ПОДЕЛИТЬСЯ
   ===================================================== */

/* Кнопки поделиться в контролах */
.share-control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-label {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    white-space: nowrap;
}

.share-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.folders-label {
    font-weight: 600;
    color: #ffffff;
    font-size: 14px;
    white-space: nowrap;
}

.folders-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-btn, .manage-shares-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 10px;
    background: linear-gradient(0deg, #fddd00 0%, #9a8200 100%) !important;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    white-space: nowrap;
}

.share-btn:hover, .manage-shares-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.manage-shares-btn {
    background: linear-gradient(0deg, #fddd00 0%, #9a8200 100%) !important;
    box-shadow: 0 2px 4px rgba(107, 114, 128, 0.2);
}

.manage-shares-btn:hover {
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
}

.share-icon, .manage-icon {
    font-size: 14px;
}

/* Модальные окна для функции поделиться */
#shareModalOverlay, #manageSharesModalOverlay, #shareResultModalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

/* Общий класс для всех модальных окон */
#shareModalOverlay .modal-overlay,
#manageSharesModalOverlay .modal-overlay,
#shareResultModalOverlay .modal-overlay,
#shareAccountModalOverlay,
#shareActionMenuOverlay,
#addToFolderModalOverlay,
#shareFolderModalOverlay,
#createFolderModalOverlay,
#editFolderModalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalAppear 0.2s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.share-modal {
    width: 600px;
}

.manage-shares-modal {
    width: 800px;
}

.share-result-modal {
    width: 500px;
}

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

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

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px 24px 24px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #e5e7eb;
}

.modal-footer .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    white-space: nowrap;
}

/* Элементы формы в модальных окнах поделиться */
.share-modal .form-group, .manage-shares-modal .form-group, .share-result-modal .form-group {
    margin-bottom: 20px;
}

.share-modal .form-group label, .manage-shares-modal .form-group label, .share-result-modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.share-modal .form-control, .manage-shares-modal .form-control, .share-result-modal .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.share-modal .form-control:focus, .manage-shares-modal .form-control:focus, .share-result-modal .form-control:focus {
    outline: none;
    border-color: #cdc731;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.share-modal textarea.form-control, .manage-shares-modal textarea.form-control, .share-result-modal textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Чекбоксы в модальных окнах поделиться */
.share-modal .checkbox-group, .manage-shares-modal .checkbox-group, .share-result-modal .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.share-modal .checkbox-label, .manage-shares-modal .checkbox-label, .share-result-modal .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.share-modal .checkbox-label input[type="checkbox"], .manage-shares-modal .checkbox-label input[type="checkbox"], .share-result-modal .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #cdc731;
    cursor: pointer;
}

/* Кнопки модальных окон */
.share-modal .btn, .manage-shares-modal .btn, .share-result-modal .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.share-modal .btn-primary, .manage-shares-modal .btn-primary, .share-result-modal .btn-primary {
    background: linear-gradient(0deg, #fddd00 0%, #9a8200 100%) !important;
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.share-modal .btn-primary:hover, .manage-shares-modal .btn-primary:hover, .share-result-modal .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.share-modal .btn-secondary, .manage-shares-modal .btn-secondary, .share-result-modal .btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.share-modal .btn-secondary:hover, .manage-shares-modal .btn-secondary:hover, .share-result-modal .btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.share-modal .btn-sm, .manage-shares-modal .btn-sm, .share-result-modal .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Результат создания ссылки */
.share-url-container {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.share-url-input {
    flex: 1;
    font-family: monospace;
    font-size: 13px;
    background: #f8fafc;
}

.copy-btn {
    padding: 12px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

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

.share-note {
    font-size: 13px;
    color: #6b7280;
    margin: 16px 0 0 0;
}

/* Список публичных ссылок */
.shares-list {
    max-height: 500px;
    overflow-y: auto;
}

.share-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    background: white;
    transition: all 0.2s ease;
}

.share-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.share-item.inactive {
    opacity: 0.6;
    background: #f9fafb;
}

.share-item.expired {
    opacity: 0.5;
    background: #fef2f2;
    border-color: #fecaca;
}

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

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

.share-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.share-actions .btn {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f8fafc;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.share-actions .btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.share-actions .btn.pause-btn {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.share-actions .btn.pause-btn:hover {
    background: #fde68a;
    border-color: #d97706;
}

.share-actions .btn.delete-btn {
    background: #fee2e2;
    border-color: #f87171;
    color: #dc2626;
}

.share-actions .btn.delete-btn:hover {
    background: #fecaca;
    border-color: #ef4444;
}

.share-info {
    margin-bottom: 12px;
}

.share-info p {
    margin: 4px 0;
    font-size: 14px;
    color: #6b7280;
}

.share-info strong {
    color: #374151;
}

.status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.status-badge.expired {
    background: #fee2e2;
    color: #dc2626;
}

.share-url {
    margin-top: 12px;
}

.share-url input {
    font-family: monospace;
    font-size: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

/* Состояния загрузки и ошибок в модальных окнах */
.shares-list .loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.shares-list .error {
    background: #fee2e2;
    color: #dc2626;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.shares-list .no-shares {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-style: italic;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .share-control-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .share-controls {
        width: 100%;
        justify-content: stretch;
    }
    
    .share-btn, .manage-shares-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
    }
    
    .share-modal .modal-content, .manage-shares-modal .modal-content, .share-result-modal .modal-content {
        width: 95vw;
        margin: 10px;
    }
    
    .share-modal, .manage-shares-modal, .share-result-modal {
        width: 100%;
    }
    
    .share-modal .modal-header, .manage-shares-modal .modal-header, .share-result-modal .modal-header {
        padding: 16px;
    }
    
    .share-modal .modal-body, .manage-shares-modal .modal-body, .share-result-modal .modal-body {
        padding: 16px;
    }
    
    .share-modal .modal-footer, .manage-shares-modal .modal-footer, .share-result-modal .modal-footer {
        padding: 12px 16px 16px 16px;
        flex-direction: column;
    }
    
    .share-modal .btn, .manage-shares-modal .btn, .share-result-modal .btn {
        width: 100%;
    }
    
    .share-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .share-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* Стили для фильтра года в карточке */
.account-year-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.account-year-filter label {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
}

.account-year-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.account-year-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* === ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ МОБИЛЬНОЙ КНОПКИ ВИДА === */
.mobile-btn.view-btn {
    position: relative;
}

.mobile-btn.view-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #cdc731;
    transition: width 0.2s ease;
}

.mobile-btn.view-btn.active::after {
    width: 80%;
}

/* Улучшенные стили для активного состояния мобильных кнопок */
.mobile-btn.active {
    background: #cdc731 !important;
    color: white !important;
    transform: scale(1.05) !important;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3) !important;
}

/* =====================================================
   СТИЛИ ДЛЯ ВИДА "СВОДКА"
   ===================================================== */

.summary-container {
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    max-width: fit-content;
}

.summary-controls {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
    position: relative;
    z-index: 999999;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-direction: row;
    align-content: stretch;
    align-items: center;
}

.column-toggle {
    position: relative;
    display: inline-block;
    z-index: 999999;
}

.column-toggle-btn {
    background: #cdc731;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.column-toggle-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.column-toggle-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 8px 0;
    min-width: 200px;
    z-index: 999999;
    display: none;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.column-toggle-menu.active {
    display: block;
}

.column-toggle-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 14px;
    color: var(--primary-text);
}

.column-toggle-item:hover {
    background: #3d3d3d;
}

.column-toggle-item input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

.column-toggle-actions {
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.column-toggle-ok-btn,
.column-toggle-cancel-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.column-toggle-ok-btn {
    background: #cdc731;
    color: white;
}

.column-toggle-ok-btn:hover {
    background: #cdc731;
}

.column-toggle-cancel-btn {
    background: #95a5a6;
    color: white;
}

.column-toggle-cancel-btn:hover {
    background: #7f8c8d;
}

.summary-table-wrapper {
    overflow-x: auto;
    max-width: 100%;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    border-radius: 0 0 15px 15px;
    overflow: hidden;
}

/* Мобильные кнопки управления таблицей */
.mobile-table-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mobile-zoom-btn,
.mobile-scroll-btn {
    background: #cdc731;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.mobile-zoom-btn:hover,
.mobile-scroll-btn:hover {
    background: #cdc731;
    transform: translateY(-1px);
}

.mobile-zoom-btn.active,
.mobile-scroll-btn.active {
    background: #cdc731;
}

/* Мобильные режимы отображения */
.summary-table-wrapper.mobile-zoomed {
    transform: scale(0.8);
    transform-origin: top left;
    max-width: 125%;
    overflow: auto;
}

.summary-table-wrapper.mobile-scroll-mode {
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.summary-table-wrapper.mobile-scroll-mode .summary-table {
    min-width: 800px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--card-bg);
    color: var(--primary-text);
    border-radius: 0 0 15px 15px;
}

.summary-header {
    background: #1e293b;
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #334155;
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: pointer;
}

.summary-header:hover {
    background: #334155;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.header-label {
    flex: 1;
}

.sort-arrow {
    font-size: 12px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.sort-arrow.asc {
    opacity: 1;
    color: #cdc731;
}

.sort-arrow.desc {
    opacity: 1;
    color: #cdc731;
}

.summary-header.hidden {
    display: none;
}

.summary-cell {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    white-space: nowrap;
    transition: all 0.3s ease;
    color: var(--primary-text);
}

.summary-cell.hidden {
    display: none;
}

.summary-total-row {
    background: #3d3d3d;
    font-weight: 600;
}

.summary-total-row .summary-cell {
    border-bottom: 2px solid var(--border);
}

.summary-account-row:hover {
    background: #3d3d3d;
}

.summary-account-row:nth-child(even) {
    background: #2a2a2a;
}

.summary-account-row:nth-child(even):hover {
    background: #3d3d3d;
}

.summary-cell .positive {
    color: #947c00;
    font-weight: 600;
}

.summary-cell .negative {
    color: #dc2626;
    font-weight: 600;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .summary-container {
        margin: 10px;
        border-radius: 10px;
    }
    
    .summary-controls {
        padding: 15px;
    }
    
    .column-toggle-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .summary-table {
        font-size: 12px;
    }
    
    .summary-header,
    .summary-cell {
        padding: 8px 10px;
    }
    
    .column-toggle-menu {
        min-width: 180px;
        font-size: 13px;
    }
    
    /* Показываем мобильные кнопки только на мобильных */
    .mobile-table-controls {
        display: flex;
    }
}

@media (min-width: 769px) {
    /* Скрываем мобильные кнопки на десктопе */
    .mobile-table-controls {
        display: none;
    }
}

@media (max-width: 480px) {
    .summary-container {
        margin: 5px;
        border-radius: 8px;
    }
    
    .summary-controls {
        padding: 10px;
    }
    
    .column-toggle-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .summary-table {
        font-size: 11px;
    }
    
    .summary-header,
    .summary-cell {
        padding: 6px 8px;
    }
    
    .column-toggle-menu {
        min-width: 160px;
        font-size: 12px;
    }
}

/* =====================================================
   ПЕРЕКЛЮЧАТЕЛЬ ТЕМЫ В НАВИГАЦИИ
   ===================================================== */

.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.theme-toggle-btn:hover {
    background: rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.theme-toggle-btn .theme-icon {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.theme-toggle-btn:hover .theme-icon {
    transform: rotate(180deg);
}

/* Темная тема для кнопки */
body.theme-dark .theme-toggle-btn {
    color: var(--very-light-gray);
}

body.theme-dark .theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

/* Скрываем старый плавающий переключатель */
.theme-switcher {
    display: none !important;
} 

/* =====================================================
   СТИЛИ ДЛЯ ИНСТРУКЦИИ "ПОКА НЕТ СЧЕТОВ" (ТЕМНАЯ ТЕМА)
   ===================================================== */

.no-accounts {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    max-width: 600px;
    margin: 2rem auto;
}

.no-accounts-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

.no-accounts-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-text);
    margin-bottom: 1rem;
}

.no-accounts-text {
    font-size: 1.1rem;
    color: var(--primary-text);
    opacity: 0.8;
    line-height: 1.5;
}

.no-accounts-steps {
    text-align: left;
    max-width: 480px;
    margin: 0 auto 1.5rem auto;
    padding: 0;
    list-style: none;
    counter-reset: step-counter;
}

.no-accounts-steps li {
    position: relative;
    padding: 1rem 0 1rem 3rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    counter-increment: step-counter;
}

.no-accounts-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent);
    color: #1a1a1a;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.no-accounts-steps li ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
    list-style: disc;
}

.no-accounts-steps li ul li {
    background: none;
    border-left: none;
    padding: 0.25rem 0;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.no-accounts-steps li ul li::before {
    display: none;
}

/* Стили для кнопки копирования UserID */
.no-accounts-steps input[type="text"] {
    font-size: 1em;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--primary-text);
    width: 180px;
    font-family: 'Courier New', monospace;
}

.no-accounts-steps button {
    padding: 8px 16px;
    font-size: 0.9em;
    cursor: pointer;
    background: var(--accent);
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.no-accounts-steps button:hover {
    background: #ffe066;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Стили для ссылок на скачивание */
.no-accounts-steps a {
    font-weight: bold;
    color: var(--success);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.no-accounts-steps a:hover {
    color: #66bb6a;
    text-decoration: none;
}

.no-accounts-steps ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
    list-style: disc;
}

.no-accounts-steps ul li {
    background: none;
    border-left: none;
    padding: 0.25rem 0;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.no-accounts-steps ul li::before {
    display: none;
}

/* Адаптивность */
@media (max-width: 768px) {
    .no-accounts {
        padding: 2rem 1rem;
        margin: 1rem;
    }
    
    .no-accounts-icon {
        font-size: 3rem;
    }
    
    .no-accounts-title {
        font-size: 1.5rem;
    }
    
    .no-accounts-text {
        font-size: 1rem;
    }
    
    .no-accounts-steps {
        max-width: 100%;
    }
    
    .no-accounts-steps li {
        padding: 0.75rem 0 0.75rem 2.5rem;
        margin-bottom: 0.75rem;
    }
    
    .no-accounts-steps li::before {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
        left: -12px;
    }
    
    .no-accounts-steps input[type="text"] {
        width: 140px;
        font-size: 0.9em;
        padding: 6px 10px;
    }
    
    .no-accounts-steps button {
        padding: 6px 12px;
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .no-accounts {
        padding: 1.5rem 0.75rem;
    }
    
    .no-accounts-icon {
        font-size: 2.5rem;
    }
    
    .no-accounts-title {
        font-size: 1.3rem;
    }
    
    .no-accounts-steps li {
        padding: 0.5rem 0 0.5rem 2rem;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }
    
    .no-accounts-steps li::before {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
        left: -10px;
    }
    
    .no-accounts-steps input[type="text"] {
        width: 120px;
        font-size: 0.8em;
        padding: 4px 8px;
    }
    
    .no-accounts-steps button {
        padding: 4px 8px;
        font-size: 0.75em;
    }
}

/* =====================================================
   СТИЛИ ДЛЯ НОВЫХ МОДАЛЬНЫХ ОКОН И ЭЛЕМЕНТОВ (ТЕМНАЯ ТЕМА)
   ===================================================== */

/* Стили для кнопок действий в модальном окне */
body.theme-dark .share-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

body.theme-dark .share-action-buttons .btn {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

body.theme-dark .share-action-buttons .btn-primary {
    background: var(--accent);
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

body.theme-dark .share-action-buttons .btn-primary:hover {
    background: #E6C200;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

body.theme-dark .share-action-buttons .btn-secondary {
    background: var(--secondary-bg);
    color: var(--primary-text);
    border: 1px solid var(--accent);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.1);
}

body.theme-dark .share-action-buttons .btn-secondary:hover {
    background: #3d3d3d;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

body.theme-dark .share-action-buttons .btn-success {
    background: #4CAF50;
    color: #fff;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

body.theme-dark .share-action-buttons .btn-success:hover {
    background: #45a049;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* Стили для информации о существующей ссылке */
body.theme-dark .existing-link-info {
    margin-top: 16px;
    padding: 12px;
    background: var(--off-white);
    border-radius: 6px;
    border: 1px solid var(--border);
}

body.theme-dark .existing-link-info small {
    color: var(--primary-text);
    font-weight: 500;
}

body.theme-dark .existing-link-info #existingLinkUrl {
    margin-top: 8px;
    padding: 8px;
    background: var(--card-bg);
    border-radius: 4px;
    border: 1px solid var(--border);
    font-family: monospace;
    font-size: 12px;
    color: var(--accent);
    word-break: break-all;
}

/* Стили для списка папок в модальном окне */
body.theme-dark .folders-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    background: var(--off-white);
}

body.theme-dark .folder-selection-item {
    margin-bottom: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    transition: all 0.2s ease;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.theme-dark .folder-selection-item:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.15);
    background: #333;
}

body.theme-dark .folder-selection-main {
    display: flex;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

body.theme-dark .folder-selection-main:hover {
    background: var(--primary-bg);
}

body.theme-dark .folder-selection-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    border: 2px solid var(--primary-text);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.theme-dark .folder-selection-info {
    flex: 1;
}

body.theme-dark .folder-selection-name {
    font-weight: 600;
    color: var(--primary-text);
    margin-bottom: 4px;
    font-size: 14px;
}

body.theme-dark .folder-selection-description {
    font-size: 12px;
    color: #ccc;
    margin-bottom: 4px;
    line-height: 1.4;
}

body.theme-dark .folder-selection-count {
    font-size: 11px;
    color: #999;
    font-weight: 500;
}

body.theme-dark .folder-selection-action {
    padding: 12px 16px;
    background: var(--secondary-bg);
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--primary-text);
    text-align: center;
    font-weight: 500;
}

body.theme-dark .no-folders-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--primary-text);
    font-style: italic;
    background: var(--card-bg);
    border-radius: 8px;
    border: 2px dashed var(--border);
}

body.theme-dark .create-new-folder-section {
    margin-top: 16px;
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

body.theme-dark .create-new-folder-section .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--primary-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

body.theme-dark .create-new-folder-section .btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--primary-bg);
}

/* Стили для уведомлений внутри модальных окон */
body.theme-dark .modal-notifications {
    margin: 0 24px;
    min-height: 0;
    max-height: 100px;
    overflow-y: auto;
}

body.theme-dark .modal-notifications .notification {
    position: relative;
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 6px;
    animation: slideInDown 0.3s ease-out;
    font-size: 13px;
}

body.theme-dark .modal-notifications .notification-success {
    background: #2d4a2d;
    color: #90ee90;
    border-left: 4px solid #4CAF50;
    border: 1px solid #4CAF50;
}

body.theme-dark .modal-notifications .notification-error {
    background: #4a2d2d;
    color: #ff9999;  
    border-left: 4px solid #ef4444;
    border: 1px solid #ef4444;
}

body.theme-dark .modal-notifications .notification-info {
    background: #2d3a4a;
    color: #87ceeb;
    border-left: 4px solid #2196F3;
    border: 1px solid #2196F3;
}

body.theme-dark .modal-notifications .notification-warning {
    background: #4a3d2d;
    color: #ffd666;
    border-left: 4px solid #FF9800;
    border: 1px solid #FF9800;
}

/* Размеры для специфических модальных окон */
body.theme-dark .share-action-modal {
    width: 450px;
}

body.theme-dark .add-folder-modal {
    width: 500px;
}

body.theme-dark .edit-folder-modal {
    width: 650px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 600px) {
    body.theme-dark .share-action-buttons {
        gap: 8px;
    }
    
    body.theme-dark .share-action-buttons .btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    body.theme-dark .folders-list {
        max-height: 250px;
        padding: 8px;
    }
    
    body.theme-dark .folder-selection-main {
        padding: 12px;
    }
    
    body.theme-dark .folder-selection-color {
        width: 16px;
        height: 16px;
    }
    
    body.theme-dark .folder-selection-action {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    body.theme-dark .modal-content {
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    body.theme-dark .share-action-modal,
    body.theme-dark .add-folder-modal,
    body.theme-dark .edit-folder-modal {
        width: 100%;
        max-width: 400px;
    }
}

/* =====================================================
   СТИЛИ ДЛЯ СТРАНИЦЫ FOLDERS.HTML - ТЕМНАЯ ТЕМА
   ===================================================== */

/* Основной контейнер страницы папок */
body.theme-dark .trading-monitor-container {
    background: var(--primary-bg);
    color: var(--primary-text);
}

body.theme-dark .folders-page {
    background: var(--primary-bg);
    color: var(--primary-text);
}

body.theme-dark .folders-page .folders-header {
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.theme-dark .folders-page .folders-header h2 {
    color: var(--primary-text);
}

body.theme-dark .folders-content {
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Стили папок */
body.theme-dark .folder-item {
    border-bottom: 1px solid var(--border);
    background: var(--secondary-bg);
    margin: 15px;
}

body.theme-dark .folder-item:hover {
    background: var(--primary-bg);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.1);
}

body.theme-dark .folder-name {
    color: var(--primary-text);
}

body.theme-dark .folder-description {
    color: var(--muted-text);
}

body.theme-dark .folder-stats {
    color: var(--muted-text);
}

/* Кнопки в папках */
body.theme-dark .folder-actions .btn {
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--primary-text);
    transition: all 0.2s ease;
}

body.theme-dark .folder-actions .btn:hover {
    background: var(--hover-bg);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2);
    transform: translateY(-1px);
}

body.theme-dark .folder-actions .btn-primary {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

body.theme-dark .folder-actions .btn-primary:hover {
    background: #E6C200;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

body.theme-dark .folder-actions .btn-secondary {
    background: var(--secondary-bg);
    color: var(--primary-text);
    border-color: var(--border);
}

body.theme-dark .folder-actions .btn-secondary:hover {
    background: #444;
    border-color: var(--accent);
}

body.theme-dark .folder-actions .btn-danger {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

body.theme-dark .folder-actions .btn-danger:hover {
    background: #c82333;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

body.theme-dark .no-folders {
    background: var(--secondary-bg);
    color: var(--muted-text);
}

body.theme-dark .no-folders-content h3 {
    color: var(--primary-text);
}

body.theme-dark .btn {
    background: var(--secondary-bg);
    color: var(--primary-text);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

body.theme-dark .btn:hover {
    background: var(--hover-bg);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.1);
}

body.theme-dark .btn-primary {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

body.theme-dark .btn-primary:hover {
    background: #E6C200;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

body.theme-dark .btn-secondary {
    background: var(--secondary-bg);
    color: var(--primary-text);
    border-color: var(--border);
}

body.theme-dark .btn-secondary:hover {
    background: #444;
    border-color: var(--accent);
}

/* =====================================================
   ДОПОЛНИТЕЛЬНЫЕ СТИЛИ МОДАЛЬНЫХ ОКОН - ТЕМНАЯ ТЕМА
   ===================================================== */

/* Основные модальные окна */
body.theme-dark .modal-content {
    background: var(--secondary-bg) !important;
    color: var(--primary-text) !important;
    border: 2px solid var(--accent) !important;
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.3) !important;
}

body.theme-dark .modal-header {
    background: var(--primary-bg) !important;
    color: var(--primary-text) !important;
    border-bottom: 1px solid var(--accent) !important;
}

body.theme-dark .modal-header h3 {
    color: var(--primary-text) !important;
}

body.theme-dark .modal-close {
    color: var(--primary-text) !important;
    background: none !important;
    border: 1px solid var(--accent) !important;
}

body.theme-dark .modal-close:hover {
    background: var(--accent) !important;
    color: #000 !important;
}

body.theme-dark .modal-body {
    background: var(--secondary-bg) !important;
    color: var(--primary-text) !important;
}

/* Дополнительные стили для share action модального окна */
body.theme-dark .share-action-buttons .btn {
    background: var(--card-bg) !important;
    color: var(--primary-text) !important;
    border: 1px solid var(--border) !important;
    transition: all 0.2s ease !important;
}

body.theme-dark .share-action-buttons .btn:hover {
    background: var(--hover-bg) !important;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2) !important;
    transform: translateY(-1px) !important;
}

body.theme-dark .share-action-buttons .btn-primary {
    background: var(--accent) !important;
    color: #000 !important;
    border-color: var(--accent) !important;
}

body.theme-dark .share-action-buttons .btn-primary:hover {
    background: #E6C200 !important;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4) !important;
}

body.theme-dark .share-action-buttons .btn-success {
    background: #4CAF50 !important;
    color: #fff !important;
    border-color: #4CAF50 !important;
}

body.theme-dark .share-action-buttons .btn-success:hover {
    background: #45a049 !important;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4) !important;
}

/* Информация о существующей ссылке */
body.theme-dark .existing-link-info {
    background: var(--primary-bg) !important;
    border: 1px solid var(--accent) !important;
    color: var(--primary-text) !important;
}

body.theme-dark .existing-link-info small {
    color: var(--muted-text) !important;
}

body.theme-dark .existing-link-info #existingLinkUrl {
    background: var(--card-bg) !important;
    color: var(--accent) !important;
    border: 1px solid var(--accent) !important;
    font-family: 'Courier New', monospace !important;
}

/* Уведомления в модальных окнах */
body.theme-dark .modal-notifications {
    background: var(--secondary-bg) !important;
}

body.theme-dark .modal-notifications .notification {
    background: var(--card-bg) !important;
    color: var(--primary-text) !important;
    border: 1px solid var(--border) !important;
}

/* Дополнительные модальные окна */
body.theme-dark #shareAccountModalOverlay .modal-content,
body.theme-dark #addToFolderModalOverlay .modal-content {
    background: var(--secondary-bg) !important;
    color: var(--primary-text) !important;
    border: 2px solid var(--accent) !important;
} /* Конец body.theme-dark */

body.theme-dark #shareActionAccountInfo {
    color: var(--primary-text) !important;
}
