:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --border: #222222;
    --card-bg: #0f0f0f;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --border-light: #333333;
}

.light-theme {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --border: #e0e0e0;
    --card-bg: #fafafa;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #2563eb;
    --border-light: #dddddd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    font-weight: 400;
}

/* Header */
header {
    background-color: var(--card-bg);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 1rem;
}

.logo {
    font-size: 1.2rem;
    font-weight: 600;
    white-space: nowrap;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    position: relative; /* ← Добавьте это */
}

.theme-toggle {
    font-size: 1.1rem;
    padding: 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.05);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    background: var(--bg-secondary);
    transition: all 0.2s ease;
}

.user-info:hover {
    background: var(--accent);
}

.user-avatar {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-role {
    font-size: 0.7rem;
    color: white;
    background: var(--accent);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    white-space: nowrap;
    display: inline-block;
    width: fit-content;
    margin-top: 0.1rem;
}

/* Для светлой темы */
.light-theme .user-info:hover {
    background: var(--accent);
}

.light-theme .user-info:hover .user-name,
.light-theme .user-info:hover .user-role {
    color: white;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    right: 0; /* ← Измените с 2rem на 0 */
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 200px;
    z-index: 1001;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0.7rem;
    background: none;
    border: none;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: left;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--bg-secondary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main content */
main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.bots-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.bots-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.add-bot-btn {
    background-color: var(--accent);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
}

.add-bot-btn:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-1px);
}

.bots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Адаптивность для планшетов */
@media (max-width: 1200px) {
    .bots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .bots-grid {
        grid-template-columns: 1fr;
    }
}

.bot-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    /* Убедитесь, что нет width или max-width */
}

.bot-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.bot-card[style*="opacity: 0.8"] {
    background: var(--card-bg-secondary) !important;
}

.bot-card[style*="opacity: 0.8"]:hover {
    opacity: 0.9 !important;
    transform: none !important;
    cursor: not-allowed !important;
}

.view-only {
    background: var(--border) !important;
    padding: 0.3rem 0.8rem !important;
    border-radius: 12px !important;
    font-size: 0.75rem !important;
}

.bot-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.bot-emoji {
    font-size: 2rem;
}

.bot-title h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.bot-token {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.bot-name {
    font-size: 1.1rem;
    font-weight: 600;
    flex-grow: 1;
}

.bot-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat {
    background: var(--card-bg-secondary);
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
}

.stat-item {
    padding: 0.8rem;
    border-radius: 8px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
}

.stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat-usd .stat-value {
    color: var(--success);
}

.stat-eur .stat-value {
    color: var(--info);
}

.stat-sales .stat-value {
    color: var(--warning);
}

.stat-users .stat-value {
    color: var(--accent);
}

.bot-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.manage-btn {
    background: var(--accent);
    color: white;
}

.manage-btn:hover {
    background: var(--accent-hover);
}

.edit-btn {
    background: var(--card-bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.edit-btn:hover {
    background: var(--border);
}

.delete-btn {
    background: #ef4444;
    color: white;
}

.delete-btn:hover {
    background: #dc2626;
}

.bot-action-btn {
    padding: 0.7rem 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: left;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.bot-action-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-1px);
}

.exit-btn:hover {
    background: var(--danger) !important;
    border-color: var(--danger) !important;
}

.bot-btn {
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.bot-btn:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.bot-btn.manage {
    flex: 1;
    background-color: var(--accent);
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.bot-btn.manage:hover {
    opacity: 0.9;
}

.bot-btn.edit:hover {
    color: var(--info);
}

.bot-btn.delete:hover {
    color: var(--danger);
}

.bot-btn[href] {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bot-btn.edit {
    color: var(--info);
    background: none;
}

.bot-btn.edit:hover {
    background-color: var(--info);
    color: white;
}

.bot-btn.manage {
    color: white;
    background-color: var(--accent);
    text-decoration: none;
}

.bot-btn.manage:hover {
    opacity: 0.9;
    color: white;
}

/* Компактная форма добавления бота */
.compact-form {
    max-width: 560px;
    padding: 2rem;
    margin: 1rem auto;
}

.compact-form .form-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.error-message {
    color: var(--danger);
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    font-size: 0.95rem;
}

.compact-emoji-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.4rem;
    margin: 1rem 0;
    padding: 0.8rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.compact-emoji-grid .emoji-option {
    font-size: 1.4rem;
    padding: 0.4rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1/1;
    cursor: pointer;
}

.compact-emoji-grid .emoji-option:hover {
    transform: scale(1.1);
    background-color: var(--accent);
}

.compact-emoji-grid .emoji-option.selected {
    transform: scale(1.1);
    background-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    gap: 1rem;
}

.cancel-btn {
    padding: 0.7rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cancel-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent);
}

.submit-btn {
    padding: 0.7rem 1.5rem;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.submit-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state h2 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 350px;
    animation: slideIn 0.3s ease;
    transition: all 0.3s ease;
}

.notification.hiding {
    animation: slideOut 0.3s ease;
    opacity: 0;
    transform: translateX(100%);
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--danger);
}

.notification.warning {
    border-left: 4px solid var(--warning);
}

.notification.info {
    border-left: 4px solid var(--info);
}

.notification-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    font-size: 0.9rem;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.confirmation-modal {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

.confirmation-message {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.confirmation-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
}

.confirmation-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    border: none;
}

.confirmation-btn.cancel {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.confirmation-btn.confirm {
    background: var(--danger);
    color: white;
}

.confirmation-btn.confirm.success {
    background: var(--success);
}


.modal h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal .form-group {
    margin-bottom: 1.2rem;
}

.modal .form-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.8rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.emoji-grid .emoji-option {
    font-size: 1.6rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: center;
}

.emoji-grid .emoji-option:hover {
    background-color: var(--accent);
    transform: scale(1.1);
}

.emoji-grid .emoji-option.selected {
    background-color: var(--accent);
    transform: scale(1.1);
}

.manage-container {
    display: flex;
    min-height: calc(100vh - 100px);
    margin: 0 -2rem;
}

.manage-sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    border-radius: 0 16px 16px 0; /* ← Скругляем правые углы */
}

.bot-header-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.bot-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.bot-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0;
    background: transparent !important; /* ← Прозрачный фон */
    border: none !important; /* ← Убираем обводку */
    border-radius: 0;
    cursor: default;
}

.bot-info:hover {
    background: transparent !important;
    border: none !important;
    transform: none !important;
}

.bot-info .bot-emoji {
    font-size: 2rem;
}

.bot-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    cursor: default;
}

.bot-header-sidebar .bot-emoji {
    font-size: 2.5rem;
}

.bot-header-sidebar h3 {
    font-size: 1.2rem;
    font-weight: 600;
    flex-grow: 1;
}

.back-to-bots {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.back-to-bots:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    transform: translateY(-1px);
}

.manage-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item {
    padding: 0.8rem 1rem;
    border-radius: 12px; /* Увеличим скругление */
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.menu-item:hover {
    background-color: var(--bg-primary);
    border-color: var(--border-light);
    transform: translateX(5px);
}

.menu-item.active {
    background-color: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.manage-content {
    flex: 1;
    padding: 2rem;
    background: var(--bg-primary);
    min-width: 0;
    border-radius: 16px 0 0 16px; /* ← Скругляем левые углы */
    margin-left: -1px; /* ← Убираем двойную границу */
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.bot-token-container {
    margin-bottom: 1rem;
}

.token-preview {
    background: var(--card-bg-secondary);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.token-preview:hover {
    background: var(--border);
    color: var(--text-primary);
}

.full-token {
    background: var(--card-bg-secondary);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    border: 1px solid var(--accent);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    margin-bottom: 2rem;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    background: var(--card-bg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-daily {
    text-align: center;
    margin-bottom: 0.8rem;
    padding: 0.6rem;
    background: var(--accent);
    border-radius: 10px;
    color: white;
}

.daily-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.daily-label {
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 500;
}

.stat-main {
    text-align: center;
    margin-top: auto;
}

.stat-total {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card:hover .stat-daily {
    background: var(--accent-hover);
}

.stat-card:nth-child(1) .stat-daily {
    background: linear-gradient(135deg, #10b981 0%, #0d966c 100%);
}

.stat-card:nth-child(2) .stat-daily {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.stat-card:nth-child(3) .stat-daily {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-card:nth-child(4) .stat-daily {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.stat-card:hover:nth-child(1) .stat-daily {
    background: linear-gradient(135deg, #0d966c 0%, #10b981 100%);
}

.stat-card:hover:nth-child(2) .stat-daily {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

.stat-card:hover:nth-child(3) .stat-daily {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

.stat-card:hover:nth-child(4) .stat-daily {
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
}

.pie-chart-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 1.5rem 0;
}

.pie-chart {
    width: 180px;
    height: 180px;
    position: relative;
    border-radius: 50%;
    background: conic-gradient(
        var(--color) 0deg var(--next-angle),
        transparent var(--next-angle) 360deg
    );
}

.pie-segment {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 50% 100%);
    transform: rotate(var(--angle));
    background: var(--color);
}

.pie-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
}

.pie-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pie-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pie-legend {
    flex: 1;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: inline-block;
    margin-right: 0.5rem;
}

.legend-name {
    flex: 1;
    font-weight: 500;
}

.legend-value {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.equal-columns-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.equal-column {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.equal-column .section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.purchases-list,
.users-list {
    overflow-y: auto;
    max-height: 280px;
    padding-right: 3px;
    margin-right: -3px;
}

.purchases-list::-webkit-scrollbar,
.users-list::-webkit-scrollbar {
    width: 8px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.purchases-list::-webkit-scrollbar-track,
.users-list::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
    margin: 2px;
}

.purchases-list::-webkit-scrollbar-thumb,
.users-list::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
    border: 2px solid var(--bg-primary);
}

.purchases-list::-webkit-scrollbar-thumb:hover,
.users-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

.purchases-list,
.users-list {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-primary);
}

.purchases-list,
.users-list,
.purchases-list::-webkit-scrollbar,
.users-list::-webkit-scrollbar,
.purchases-list::-webkit-scrollbar-thumb,
.users-list::-webkit-scrollbar-thumb {
    transition: none !important;
    animation: none !important;
}

.purchases-list,
.users-list,
.purchases-list:hover,
.users-list:hover,
.purchases-list:focus,
.users-list:focus,
.purchases-list:active,
.users-list:active {
    overflow-y: auto !important;
}

.purchases-list::-webkit-scrollbar,
.users-list::-webkit-scrollbar,
.purchases-list:hover::-webkit-scrollbar,
.users-list:hover::-webkit-scrollbar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.light-theme .purchases-list::-webkit-scrollbar-track,
.light-theme .users-list::-webkit-scrollbar-track {
    background: var(--card-bg);
}

.light-theme .purchases-list::-webkit-scrollbar-thumb,
.light-theme .users-list::-webkit-scrollbar-thumb {
    border: 2px solid var(--card-bg);
}

.equal-columns-container {
    gap: 1.5rem;
}

.equal-column .section {
    margin-right: 0;
}

.purchase-item,
.user-item {
    margin-right: 0;
    margin-bottom: 0.5rem;
}

.purchase-item:last-child,
.user-item:last-child {
    margin-bottom: 0;
}

@-moz-document url-prefix() {
    .purchases-list,
    .users-list {
        padding-right: 8px;
        margin-right: -8px;
    }
}

.purchases-list {
    overflow-y: scroll !important;
}

.users-list {
    overflow-y: scroll !important;
}

.purchases-list::-webkit-scrollbar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.users-list::-webkit-scrollbar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.purchases-list,
.users-list {
    flex: 1;
    max-height: 320px;
}

.purchase-item,
.user-item {
    padding: 0.8rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.purchase-item:last-child,
.user-item:last-child {
    margin-bottom: 0;
}

.purchase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.purchase-header .user {
    font-weight: 500;
}

.purchase-header .amount {
    color: var(--success);
    font-weight: 600;
}

.purchase-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.join-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* СТИЛИ ДЛЯ ПОСЛЕДНИХ ПОКУПОК И ПОЛЬЗОВАТЕЛЕЙ */
.stats-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.stats-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.stats-section h3 {
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--accent);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Стили для строк покупок и пользователей */
.purchase-row, .user-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    padding: 0.8rem 0;
    position: relative;
    align-items: start;
}

/* Красивые разделительные линии */
.purchase-row:not(:last-child)::after,
.user-row:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent) 30%, 
        var(--accent) 70%, 
        transparent 100%);
    opacity: 0.3;
}

/* Убираем стандартные границы */
.purchase-row, .user-row {
    border-bottom: none;
}

/* ЛЕВАЯ КОЛОНКА */
.purchase-info, .user-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.product-name, .user-nickname {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.1rem;
}

.purchase-handle, .user-handle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ПРАВАЯ КОЛОНКА */
.purchase-details, .user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    text-align: right;
}

.purchase-amount, .user-currency {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.1rem;
}

.purchase-amount {
    color: var(--success);
}

.user-currency {
    color: var(--text-primary);
}

.purchase-time, .user-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Ховер эффекты */
.purchase-row:hover, .user-row:hover {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(139, 92, 246, 0.08) 15%, 
        rgba(139, 92, 246, 0.08) 85%, 
        transparent 100%);
    border-radius: 8px;
    margin: 0 -0.8rem;
    padding: 0.8rem;
}

/* Анимация */
.purchase-row, .user-row {
    transition: all 0.2s ease;
}

/* Контейнеры */
.purchases-container, .users-container {
    padding: 0.5rem 0.5rem;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .stats-sections {
        grid-template-columns: 1fr;
    }
    
    .manage-container {
        flex-direction: column;
    }
    
    .manage-sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .manage-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .equal-columns-container {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Адаптивность для хедера */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 0.8rem;
    }
    
    .logo {
        order: 1;
        flex: 1;
    }
    
    .user-menu {
        order: 2;
        flex: 1;
        justify-content: flex-end;
    }
    
    .user-name {
        max-width: 80px;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        min-height: 100px;
    }
    
    .daily-value {
        font-size: 1.2rem;
    }
    
    .stat-total {
        font-size: 1.4rem;
    }
    
    .purchase-row, .user-row {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        text-align: center;
    }
    
    .purchase-details, .user-details {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .user-info {
        padding: 0.5rem;
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
        padding: 0.5rem;
    }
}

@media (max-width: 360px) {
    .compact-emoji-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .compact-emoji-grid .emoji-option {
        font-size: 1rem;
        min-height: 22px;
    }
}

/* ДОБАВЬТЕ ЭТИ СТИЛИ В КОНЕЦ ФАЙЛА */

.user-details {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.1rem !important;
}

.user-name {
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    color: var(--text-primary) !important;
    line-height: 1.2 !important;
}

.user-role {
    font-size: 0.7rem !important;
    color: white !important;
    background: var(--accent) !important;
    padding: 0.15rem 0.4rem !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    display: inline-block !important;
    width: fit-content !important;
    margin-top: 0.1rem !important;
}

/* Убедимся, что user-info правильно выравнивает элементы */
.user-info {
    display: flex !important;
    align-items: center !important;
    gap: 0.8rem !important;
}

.user-avatar {
    font-size: 1.4rem !important;
    flex-shrink: 0 !important;
}

.user-info {
    display: flex !important;
    align-items: center !important;
    gap: 0.8rem !important;
    flex-direction: row !important; /* ← ЭТО ВАЖНО */
}

.user-details {
    display: flex !important;
    align-items: center !important;
    gap: 0.8rem !important;
    flex-direction: row !important; /* ← Теперь в строку */
}

.user-avatar {
    font-size: 1.4rem !important;
    flex-shrink: 0 !important;
    order: 1 !important; /* Эмодзи первый */
}

.user-details {
    order: 2 !important; /* Детали вторые */
}

.user-name {
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
}

.user-role {
    font-size: 0.7rem !important;
    color: white !important;
    background: var(--accent) !important;
    padding: 0.15rem 0.4rem !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr)) !important;
    gap: 0.4rem !important;
    padding: 1rem;
    justify-content: center;
}

.emoji-option {
    font-size: 1.8rem !important;
    padding: 0.6rem !important;
    border-radius: 10px !important;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.emoji-option:hover {
    background-color: var(--accent) !important;
    transform: scale(1.1) !important;
}

.emoji-option.selected {
    background-color: var(--accent) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Убираем скролл полностью */
.emoji-grid {
    overflow: visible !important;
    max-height: none !important;
}

/* Простое исправление */
html {
    overflow-y: scroll;
}

body {
    padding-right: 0 !important;
}

.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Исправляем кнопки бота на главной */
.bot-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: nowrap; /* ← Важно: запрещаем перенос */
}

.bot-btn {
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-shrink: 0; /* ← Не даем сжиматься */
}

.bot-btn.manage {
    flex: 1;
    background-color: var(--accent);
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-width: fit-content; /* ← Минимальная ширина по содержимому */
}

@media (max-width: 480px) {
    .bot-actions {
        flex-wrap: wrap;
    }
    
    .bot-btn.manage {
        order: -1;
        width: 100%;
        flex: none;
    }
    
    .bot-btn.edit,
    .bot-btn.delete {
        flex: 1;
        width: auto;
        min-width: 60px;
    }
}

/* Исправляем кнопки действий бота */
.bot-actions {
    display: flex;
    flex-direction: row; /* Изменяем на row вместо column */
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: space-between;
    align-items: center;
}

.bot-btn {
    padding: 0.6rem 0.8rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    text-decoration: none;
    min-width: 40px;
    height: 36px;
    flex-shrink: 0;
}

/* Кнопка управления */
.bot-btn.manage {
    background-color: var(--accent);
    color: white;
    min-width: 100px;
    flex: 1;
}

.bot-btn.manage:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}


/* Кнопки редактирования и удаления */
.bot-btn.edit {
    background: var(--bg-secondary);
    color: var(--info);
    border: 1px solid var(--border-light);
    width: 40px;
}

.bot-btn.edit:hover {
    background-color: var(--info);
    color: white;
    border-color: var(--info);
}

.bot-btn.delete {
    background: var(--bg-secondary);
    color: var(--danger);
    border: 1px solid var(--border-light);
    width: 40px;
}

.bot-btn.delete:hover {
    background-color: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* Иконки внутри кнопок */
.bot-btn svg,
.bot-btn .btn-icon {
    width: 16px;
    height: 16px;
}

/* Стили для кнопки Telegram */
.telegram-btn {
    background-color: var(--accent);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.telegram-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

/* Центрирование логотипа */
.center-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .center-logo {
        position: static;
        transform: none;
        order: 1;
        flex: 1;
        text-align: center;
    }
    
    .telegram-btn {
        order: 0;
        margin-right: auto;
    }
    
    .user-menu {
        order: 2;
    }
}

.bot-info-display {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.bot-status {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.bot-status.active {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.bot-status.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.activate-btn {
    background: linear-gradient(135deg, #10b981, #059669) !important;
}

.deactivate-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.product-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    background: var(--card-bg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.price-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .price-fields {
        grid-template-columns: 1fr;
    }
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-group input:focus::placeholder,
.form-group textarea:focus::placeholder {
    opacity: 0.5;
}

.confirm-btn {
    background: #10b981 !important;
    color: white !important;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.confirm-btn:hover {
    background: #059669 !important;
}

.confirm-btn:disabled {
    background: #9ca3af !important;
    cursor: not-allowed;
}

/* Стили для текстовых областей */
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Стили для описания товара с переносами */
.product-description {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.4;
    white-space: pre-line;
    word-wrap: break-word;
}

/* Добавим в CSS */
:root {
    --card-bg-secondary: rgba(255, 255, 255, 0.05);
    /* Для светлой темы можно добавить:
    @media (prefers-color-scheme: light) {
        --card-bg-secondary: rgba(0, 0, 0, 0.05);
    }
    */
}

/* Стилизация скроллбара */
.description-scroll::-webkit-scrollbar {
    width: 6px;
}

.description-scroll::-webkit-scrollbar-track {
    background: var(--border);
    border-radius: 3px;
}

.description-scroll::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 3px;
}

.description-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
}


.users-table {
    font-size: 0.85rem;
}

.users-table th,
.users-table td {
    padding: 0.5rem !important;
    vertical-align: middle;
}

.user-row:hover {
    background: var(--card-bg-secondary) !important;
}

.user-row.selected {
    background: var(--accent-light) !important;
}

.delete-user-btn {
    transition: all 0.2s ease;
    min-width: 60px;
}

.delete-user-btn:hover {
    background: #dc2626 !important;
    transform: scale(1.05);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .users-table-container {
        font-size: 0.8rem;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.4rem 0.3rem !important;
    }
    
    .delete-user-btn {
        padding: 0.2rem 0.4rem !important;
        font-size: 0.7rem !important;
    }
}

.pulse-border {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 12px;
    animation: pulseBorder 2s ease-out;
    pointer-events: none;
    z-index: 1;
}

.pulse-border-small {
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 8px;
    animation: pulseBorderSmall 2s ease-out;
    pointer-events: none;
    z-index: 1;
}

/* Цвета для разных счетчиков */
.pulse-usd { border: 2px solid rgba(16, 185, 129, 0.5); } 
.pulse-eur { border: 2px solid rgba(59, 130, 246, 0.5); } 
.pulse-sales { border: 2px solid rgba(245, 158, 11, 0.5); } 
.pulse-users { border: 2px solid rgba(139, 92, 246, 0.5); } 

@keyframes pulseBorder {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.02); }
    100% { opacity: 0; transform: scale(1.05); }
}

@keyframes pulseBorderSmall {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.05); }
    100% { opacity: 0; transform: scale(1.1); }
}

/* Стили для чужих ботов */
.other-bot {
    opacity: 0.85;
    background: var(--card-bg-secondary);
    border: 1px solid var(--border-secondary);
}

.other-bot:hover {
    opacity: 0.9;
    transform: none;
}

.bot-owner {
    background: var(--border);
    padding: 0.5rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.bot-owner span {
    color: var(--text-secondary);
}

.view-only {
    background: var(--border);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

.notification-top {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    font-weight: 500;
    z-index: 9999;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    transform: translateX(0);
}

.notification-top.success {
    border-left: 4px solid #10b981;
    background: rgba(16, 185, 129, 0.05);
    color: #10b981;
}

.notification-top.error {
    border-left: 4px solid #ef4444;
    background: rgba(239, 68, 68, 0.05);
    color: #ef4444;
}

/* Анимация появления */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-top {
    animation: slideInRight 0.3s ease;
}

.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 1rem;
}

.emoji-option {
    font-size: 1.5rem;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.emoji-option:hover {
    background: var(--card-bg-secondary);
    transform: scale(1.1);
}

.emoji-option.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(1.1);
}

.emoji-grid {
    display: grid;
    margin: 0.5rem 0;
}

/* Стили для модального окна подтверждения */
.confirmation-modal {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.confirmation-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.confirmation-title {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.confirmation-message {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 2rem;
    white-space: pre-line;
}

.confirmation-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Анимации */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* СТИЛИ ДЛЯ МОДАЛЬНЫХ ОКОН - ИСПРАВЛЕННЫЕ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin: 20px; /* Добавляем отступы */
}

/* Для эмодзи модального окна */
.emoji-modal .modal {
    max-width: 600px;
}

/* Анимация появления */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal {
    animation: modalSlideIn 0.3s ease;
}

/* Анимация для обновленных пользователей */
@keyframes highlightUpdatedUser {
    0% {
        background-color: rgba(59, 130, 246, 0.3);
    }
    50% {
        background-color: rgba(59, 130, 246, 0.6);
    }
    100% {
        background-color: transparent;
    }
}

.updated-user-row {
    animation: highlightUpdatedUser 1.5s ease-out;
}

/* Уберите значок "NEW" для обновленных пользователей */
.updated-user-row .new-user-badge {
    display: none;
}

.updated-user-row {
    /* Убираем анимацию, оставляем только легкое выделение */
    background-color: transparent !important;
    transition: background-color 0.3s ease;
}

.updated-user-row td {
    /* Легкое обновление без анимации */
    transition: all 0.3s ease;
}

.users-table-container {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.users-table-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.active-users-count {
    transition: all 0.3s ease;
}

.active-users-count.updating {
    animation: pulse 1s infinite;
}

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

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.video-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--card-bg);
}

.video-thumbnail {
    width: 100%;
    height: 150px;
    background: var(--card-bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.video-thumbnail video {
    max-width: 100%;
    max-height: 100%;
}

.video-info {
    padding: 0.75rem;
}

.video-name {
    font-weight: 500;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.video-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.video-actions {
    display: flex;
    gap: 0.5rem;
}

.delete-video-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.delete-video-btn:hover {
    background: #dc2626;
}

.upload-video-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 1rem;
}

.upload-video-btn:hover {
    background: #059669;
}

.video-upload-form {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
}

/* Стили для переключателя разделов */
.active-section {
    background: var(--accent);
    color: white;
    border-bottom: 3px solid var(--accent);
}

.inactive-section {
    background: var(--card-bg-secondary);
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
}

.inactive-section:hover {
    background: var(--card-bg);
    color: var(--text-primary);
}

.active-section {
    background: var(--accent);
    color: white;
    border-bottom: 3px solid var(--accent);
}

.inactive-section {
    background: var(--card-bg-secondary);
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
}

.inactive-section:hover {
    background: var(--card-bg);
    color: var(--text-primary);
}

.chart-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.chart-control-btn {
    padding: 0.5rem 1rem;
    border: 2px solid;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none !important; /* Важно: убираем зачеркивание */
}

.chart-control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.chart-control-btn .btn-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Стили для активных кнопок (залитые) */
.chart-control-btn.revenue-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.chart-control-btn.sales-btn.active {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.chart-control-btn.users-btn.active {
    background: #f59e0b;
    border-color: #f59e0b;
    color: white;
}

/* Стили для неактивных кнопок (контурные) */
.chart-control-btn.revenue-btn:not(.active) {
    background: transparent;
    border-color: #3b82f6;
    color: #3b82f6;
}

.chart-control-btn.sales-btn:not(.active) {
    background: transparent;
    border-color: #10b981;
    color: #10b981;
}

.chart-control-btn.users-btn:not(.active) {
    background: transparent;
    border-color: #f59e0b;
    color: #f59e0b;
}

/* Индикаторы для неактивных кнопок */
.chart-control-btn:not(.active) .btn-indicator {
    background: transparent;
    border: 2px solid currentColor;
}