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

/* Стили для горизонтальной прокрутки графиков */
.chart-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 24px;
}

.chart-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.chart-scroll-container::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.chart-scroll-container::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 4px;
}

.chart-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

/* Лендинг до входа — полноэкран, scroll-snap, минимализм */
.landing-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #1a1a1a;
    overflow: hidden;
    margin: 0 !important;
    max-width: none !important;
}

.landing-scroll {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    outline: none;
}

.landing-scroll::-webkit-scrollbar {
    width: 6px;
}

.landing-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.landing-scroll::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.landing-section {
    min-height: 100vh;
    min-height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.landing-section-content {
    max-width: 480px;
    text-align: center;
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.landing-section.in-view .landing-section-content {
    opacity: 1;
    transform: translateY(0);
}

.landing-hero-title {
    font-size: clamp(32px, 8vw, 48px);
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.landing-hero-sub {
    font-size: clamp(16px, 3vw, 18px);
    color: #888;
    font-weight: 400;
    line-height: 1.5;
}

.landing-h2 {
    font-size: clamp(22px, 4vw, 28px);
    font-weight: 600;
    color: #f5f5f5;
    margin-bottom: 24px;
}

.landing-features-list {
    list-style: none;
    text-align: left;
}

.landing-features-list li {
    font-size: 15px;
    color: #a0a0a0;
    line-height: 1.7;
    padding: 10px 0;
    padding-left: 24px;
    position: relative;
}

.landing-features-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4a9eff;
}

.landing-text {
    font-size: 15px;
    color: #a0a0a0;
    line-height: 1.75;
}

.landing-cta-sub {
    font-size: 16px;
    color: #888;
    margin-bottom: 28px;
}

.landing-cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.landing-btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 200px;
}

.landing-btn-primary {
    background: #4a9eff;
    color: #fff;
}

.landing-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.35);
}

.landing-btn-secondary {
    background: transparent;
    color: #a0a0a0;
    border: 1px solid #3a3a3a;
}

.landing-btn-secondary:hover {
    border-color: #4a4a4a;
    color: #e0e0e0;
}

.landing-back-link {
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 0;
    margin-top: 8px;
}

.landing-back-link:hover {
    color: #888;
}

.landing-scroll-hint {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 101;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.landing-scroll-hint.visible {
    opacity: 1;
    animation: landing-scroll-hint-bounce 2s ease-in-out infinite;
}

@keyframes landing-scroll-hint-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    /* Верх: не меньше 170px, иначе 16px + safe-area (монобровь/Dynamic Island — все разделы/страницы) */
    padding: max(170px, calc(16px + env(safe-area-inset-top, 40px))) 16px calc(100px + env(safe-area-inset-bottom)) 16px;
    min-height: 100vh;
    line-height: 1.6;
    /* Предотвращаем закрытие приложения при скролле вверх */
    overscroll-behavior-y: contain;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    /* Убираем мигающую каретку, если фокус попал на body */
    caret-color: transparent;
}

/* На широком экране (>480px) — без большого отступа сверху, иначе интерфейс «падает» */
@media (min-width: 481px) {
    body {
        padding-top: calc(16px + env(safe-area-inset-top, 0px));
    }
}

/* Каретка только в полях ввода */
input, textarea, select {
    caret-color: currentColor;
}

/* Модальное окно */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: calc(20px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left));
}

.modal-content {
    background: #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    margin: 0 0 12px 0;
    color: #fff;
    font-size: 18px;
}

.modal-content p {
    color: #ccc;
    font-size: 14px;
    line-height: 1.5;
}

/* Модальное окно инструкций — компактный размер */
.instruction-modal-content {
    height: min(85vh, 520px) !important;
    min-height: 280px !important;
    max-height: min(85vh, 520px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.instruction-modal-content .instruction-modal-header {
    margin-bottom: 12px;
    flex-shrink: 0;
}

.instruction-modal-content .instruction-modal-footer {
    margin-top: 16px;
    flex-shrink: 0;
}

.instruction-modal-content .instruction-step-indicator {
    margin-top: 10px;
}

#instruction-steps-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    margin-bottom: 0;
    -webkit-overflow-scrolling: touch;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    /* Предотвращаем закрытие приложения при скролле вверх */
    overscroll-behavior-y: contain;
    overscroll-behavior-x: contain;
}

header {
    text-align: center;
    margin-bottom: 24px;
    /* Доп. отступ сверху под монобровь/Dynamic Island — едино для всех страниц */
    padding-top: calc(36px + env(safe-area-inset-top, 0px));
    padding-bottom: 12px;
    position: relative;
    z-index: 10;
    background: var(--bg-color, #1a1a1a);
}

/* Шапка только с кнопкой «Назад» (без заголовка) — выравнивание слева */
header:has(.back-button):not(:has(h1)) {
    text-align: left;
}

/* Управление серверами: такой же верхний отступ у шапки, как на остальных страницах */
#page-admin-server-management > header {
    padding-top: calc(36px + env(safe-area-inset-top, 0px));
    padding-bottom: 12px;
}

/* Шапка «Назад» + заголовок: кнопка слева, заголовок по центру экрана */
.header-with-back {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-with-back .back-button {
    flex-shrink: 0;
}
.header-with-back h1 {
    flex: 1;
    min-width: 0;
    text-align: center;
}
/* Невидимый блок справа той же ширины, что и «Назад», чтобы заголовок был ровно по центру */
.header-with-back::after {
    content: '';
    display: block;
    width: 80px;
    flex-shrink: 0;
}

h1 {
    font-size: 24px;
    font-weight: 600;
    color: #f5f5f5;
    letter-spacing: -0.5px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    position: relative;
    z-index: 10;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #2a2a2a;
    border-top-color: #6a6a6a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

.loading p {
    color: #8a8a8a;
    font-size: 15px;
}

.error, .empty {
    text-align: center;
    padding: 40px 16px;
    position: relative;
    z-index: 10;
}

.error p, .empty p {
    margin-bottom: 12px;
    color: #8a8a8a;
    font-size: 15px;
}

.error button {
    background: #3a3a3a;
    color: #f5f5f5;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    font-weight: 500;
    margin-top: 8px;
    transition: background 0.2s ease;
}

.error button:hover {
    background: #4a4a4a;
}

.hint {
    font-size: 14px;
    color: #8a8a8a;
    line-height: 1.5;
}

/* Карточка профиля над списком подписок */
.profile-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 20px 22px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #252525 0%, #1e1e1e 100%);
    border: 1px solid #333;
    border-radius: 14px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.15s ease;
    text-align: left;
    color: inherit;
    font: inherit;
}

.profile-card:hover {
    border-color: #444;
}

.profile-card:active {
    transform: scale(0.98);
}

/* Aurora: только проходящая волна (shimmer) */
.profile-card-aurora {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
    overflow: hidden;
}

.profile-card-aurora::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 0%,
        transparent 30%,
        rgba(255, 255, 255, 0.08) 45%,
        rgba(255, 255, 255, 0.18) 50%,
        rgba(255, 255, 255, 0.08) 55%,
        transparent 70%,
        transparent 100%
    );
    background-size: 220% 100%;
    animation: profile-aurora-shimmer 6s ease-in-out infinite;
    border-radius: inherit;
}

@keyframes profile-aurora-shimmer {
    0%, 100% { background-position: 130% 0; }
    50% { background-position: -30% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .profile-card-aurora::after {
        animation: none;
    }
}

.profile-card-icon,
.profile-card-text,
.profile-card-chevron {
    position: relative;
    z-index: 1;
}

.profile-card-icon {
    position: relative;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(74, 158, 255, 0.15);
    border-radius: 14px;
    color: #4a9eff;
}

.profile-card-avatar {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    display: none;
}

.profile-card-icon-svg {
    display: block;
}

.profile-card-icon.has-avatar .profile-card-icon-svg {
    display: none;
}

.profile-card-icon.has-avatar .profile-card-avatar {
    display: block;
}

.profile-card-icon .profile-card-icon-svg {
    width: 28px;
    height: 28px;
}

.profile-card-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #f0f0f0;
    letter-spacing: -0.3px;
}

.profile-card-subtitle {
    font-size: 14px;
    color: #8a8a8a;
    font-weight: 400;
}

.profile-card-chevron {
    flex-shrink: 0;
    font-size: 22px;
    color: #6a6a6a;
    font-weight: 300;
}

/* Страница подписок: два явных блока — Аккаунт и Ваши подписки */
.page-subscriptions-header {
    margin-bottom: 8px;
}

.page-subscriptions-block-label {
    font-size: 12px;
    font-weight: 500;
    color: #8a8a8a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.subscriptions-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #f0f0f0;
    margin: 24px 0 8px 0;
    letter-spacing: -0.3px;
}

.subscriptions-stats-inline {
    font-size: 13px;
    color: #8a8a8a;
    margin: 0 0 16px 0;
    font-weight: 400;
}

.subscriptions-stats-inline #total-count,
.subscriptions-stats-inline #active-count {
    color: #b0b0b0;
    font-weight: 600;
}

.stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: #222222;
    border-radius: 14px;
}

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

.stat-item.active .stat-value {
    color: #b0b0b0;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #8a8a8a;
    margin-bottom: 8px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 600;
    color: #e0e0e0;
    letter-spacing: -0.5px;
}

.subscription-card {
    background: #222222;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 14px 14px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
}

.subscription-card:active {
    transform: scale(0.98);
    background: #252525;
}

.subscription-card:hover {
    border-color: #3a3a3a;
    background: #252525;
}

.subscription-card.active {
    border-color: #4a4a4a;
    background: #252525;
}

.subscription-card.expired {
    opacity: 0.5;
}

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

.subscription-name {
    font-size: 16px;
    font-weight: 600;
    color: #f5f5f5;
    letter-spacing: -0.3px;
    flex: 1;
}

/* Общие цвета статусов: актив/онлайн и истек/офлайн — одинаковые для подписок и серверов */
.subscription-status,
.server-status.server-status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.subscription-status.active,
.server-status-badge.online {
    background: rgba(76, 175, 80, 0.4);
    color: #5ee85e;
    border: 1px solid rgba(76, 175, 80, 0.5);
}

.subscription-status.expired,
.server-status-badge.offline {
    background: rgba(255, 59, 48, 0.4);
    color: #ff5c5c;
    border: 1px solid rgba(255, 59, 48, 0.5);
}

.subscription-status.trial {
    background: rgba(255, 152, 0, 0.4);
    color: #ffb74d;
    border: 1px solid rgba(255, 152, 0, 0.5);
}

.subscription-status-blink,
.server-status-blink {
    animation: status-blink 2s ease-in-out infinite;
}

@keyframes status-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
    .subscription-status-blink,
    .server-status-blink {
        animation: none;
    }
}

/* --- События: карточки и бейджи --- */
.event-card {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #2a2a2a;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.event-card--live {
    border-color: rgba(76, 175, 80, 0.5);
    background: rgba(76, 175, 80, 0.08);
}

.event-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.event-badge--live {
    background: rgba(76, 175, 80, 0.4);
    color: #5ee85e;
    border: 1px solid rgba(76, 175, 80, 0.5);
}

.event-badge--live.event-badge--blink {
    animation: status-blink 2s ease-in-out infinite;
}

.event-badge--ended {
    background: rgba(120, 120, 120, 0.4);
    color: #aaa;
}

.event-badge--upcoming {
    background: rgba(100, 120, 180, 0.35);
    color: #8ba3e8;
    border: 1px solid rgba(100, 120, 180, 0.5);
}

.event-icon-svg {
    flex-shrink: 0;
    vertical-align: middle;
}

.event-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #b0b0b0;
    margin: 16px 0 10px 0;
    letter-spacing: -0.2px;
}

.event-section-title:first-child {
    margin-top: 0;
}

/* Деталь события: статус и Live-рейтинг */
.event-detail-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.event-detail-status--live {
    background: rgba(76, 175, 80, 0.4);
    color: #5ee85e;
    border: 1px solid rgba(76, 175, 80, 0.5);
}

.event-detail-status--upcoming {
    background: rgba(100, 120, 180, 0.35);
    color: #8ba3e8;
    border: 1px solid rgba(100, 120, 180, 0.5);
}

.event-detail-status--ended {
    background: rgba(120, 120, 120, 0.35);
    color: #aaa;
    border: 1px solid rgba(120, 120, 120, 0.5);
}

.live-ranking {
    margin-top: 16px;
}

.live-ranking-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1em;
    font-weight: 600;
    margin: 16px 0 8px 0;
    color: #e0e0e0;
}

.live-ranking-title .event-icon-svg {
    flex-shrink: 0;
}

.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-row {
    padding: 8px 0;
    border-bottom: 1px solid #333;
    font-size: 14px;
    color: #c0c0c0;
}

.leaderboard-row--top1 {
    color: #e8c547;
    font-weight: 600;
}

.leaderboard-row--top2 {
    color: #b8b8b8;
    font-weight: 600;
}

.leaderboard-row--top3 {
    color: #c9a86c;
    font-weight: 600;
}

.event-days {
    margin: 8px 0 0 0;
    font-size: 13px;
    font-weight: 500;
    color: #8ba3e8;
}

.event-card--live .event-days {
    color: #5ee85e;
}

.event-card-rewards {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: #c9a86c;
    font-weight: 500;
}

.event-rewards-block {
    margin: 16px 0 12px 0;
    padding: 12px 14px;
    background: rgba(201, 168, 108, 0.12);
    border: 1px solid rgba(201, 168, 108, 0.35);
    border-radius: 10px;
}

.event-rewards-title {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
}

.event-rewards-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.event-reward-item {
    padding: 6px 0;
    font-size: 14px;
    color: #c0c0c0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.event-reward-place {
    font-weight: 600;
    margin-right: 4px;
}

.event-reward-place--1 {
    color: #e8c547;
}

.event-reward-place--2 {
    color: #b8b8b8;
}

.event-reward-place--3 {
    color: #c9a86c;
}

@media (prefers-reduced-motion: reduce) {
    .event-badge--live.event-badge--blink {
        animation: none;
    }
}

.subscription-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 11px;
    color: #8a8a8a;
    margin-bottom: 6px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 13px;
    font-weight: 500;
    color: #d0d0d0;
}

.days-remaining {
    color: #b0b0b0;
    font-weight: 600;
    font-size: 16px;
}

.subscription-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #2a2a2a;
}

.action-button {
    width: 100%;
    padding: 12px;
    border: none;
    background: #3a3a3a;
    color: #f5f5f5;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.action-button:hover {
    background: #4a4a4a;
}

.action-button:active {
    background: #353535;
}

/* Стили для страницы покупки подписки */
.subscription-plans {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.plan-card {
    background: #2a2a2a;
    border-radius: 10px;
    padding: 14px;
    border: 1px solid #333;
    cursor: default;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    border-color: #3a3a3a;
}

.plan-card .btn-primary:hover {
    background: #4a9eff;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(74, 158, 255, 0.3);
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    min-height: 50px;
}

.plan-header h2 {
    margin: 0;
    font-size: 18px;
    color: #fff;
}

.plan-price {
    font-size: 20px;
    font-weight: bold;
    color: #4a9eff;
}

.plan-price-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.plan-badge {
    background: #4a9eff;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.plan-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.feature-item {
    color: #ccc;
    font-size: 14px;
}

.days-badge {
    margin-top: 12px;
    padding: 12px 14px;
    background: #1f1f1f;
    border-radius: 8px;
    text-align: center;
}

.days-badge .info-label {
    font-size: 10px;
    margin-bottom: 4px;
}

.days-badge .days-remaining {
    font-size: 17px;
    display: block;
    font-weight: 600;
    color: #b0b0b0;
}

/* Нижняя навигация */
.bottom-nav {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 460px; /* Идеальный размер для 4-5 кнопок */
    background: rgba(28, 28, 28, 0.6);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.nav-glass-indicator {
    position: absolute;
    top: 50%;
    left: 0;
    width: 56px; /* Фиксированная ширина для идеальной формы */
    height: 48px; /* Фиксированная высота */
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    transition: transform 0.4s cubic-bezier(0.3, 1.5, 0.5, 1), width 0.3s ease;
    pointer-events: none;
    z-index: 1;
    /* Эффект жидкого стекла */
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 0 10px rgba(255, 255, 255, 0.05),
        inset 0 0 1px 1px rgba(255, 255, 255, 0.1);
}

.nav-glass-indicator.pressing {
    transform: translateY(-50%) scale(1.15, 0.9); /* Сплющивание как капля */
    background: rgba(255, 255, 255, 0.15);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-glass-indicator:active {
    cursor: grabbing;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 10px 8px;
    background: none;
    border: none;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
    z-index: 2;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease;
}

.nav-item.active {
    color: rgba(255, 255, 255, 0.95);
}

.nav-item.active svg {
    transform: scale(1.1);
}

.nav-item:active svg {
    transform: scale(0.95);
}

.nav-item:hover:not(.active) {
    color: rgba(255, 255, 255, 0.8);
}

.nav-icon {
    display: none;
}

.nav-label {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

/* Детальная страница подписки */
.back-button {
    background: #2a2a2a;
    border: 1px solid #333;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-button:active {
    transform: scale(0.95);
    background: #333;
}

.detail-card {
    background: #222222;
    border: 1px solid #2a2a2a;
    border-radius: 14px;
    padding: 20px;
}

.detail-header {
    margin-bottom: 20px;
}

.detail-status {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-status.active {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.detail-status.expired {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.detail-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.detail-info-item {
    display: flex;
    flex-direction: column;
}

.detail-info-item.full-width {
    grid-column: 1 / -1;
}

.detail-info-label {
    font-size: 11px;
    color: #8a8a8a;
    margin-bottom: 6px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-info-value {
    font-size: 16px;
    font-weight: 500;
    color: #d0d0d0;
}

.detail-info-value.days-highlight {
    color: #b0b0b0;
    font-size: 24px;
    font-weight: 600;
}

.detail-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #2a2a2a;
}

/* Страница серверов */
.server-card {
    background: #222222;
    border: 1px solid #2a2a2a;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 12px;
    position: relative;
    z-index: 10;
}

.server-card.online {
    border-color: #3a4a3a;
}

.server-card.offline {
    border-color: #4a3a3a;
    opacity: 0.7;
}

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

.server-name {
    font-size: 18px;
    font-weight: 600;
    color: #f5f5f5;
    letter-spacing: -0.3px;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.status-icon {
    font-size: 12px;
}

.server-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #2a2a2a;
}

/* Страница "О нас" */
.about-content {
    padding: 0;
}

/* Страница «Аккаунт»: контент вровень с кнопкой «Назад», без лишних боковых отступов */
.about-content-account {
    padding-bottom: 24px;
}

.about-section {
    background: #222222;
    border: 1px solid #2a2a2a;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
}

.about-section h2 {
    font-size: 22px;
    font-weight: 600;
    color: #f5f5f5;
    margin-bottom: 12px;
    letter-spacing: -0.3px;
}

.about-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 12px;
}

.about-section p {
    color: #8a8a8a;
    font-size: 15px;
    line-height: 1.6;
}

.about-account-info {
    margin-bottom: 4px;
}

.about-account-info p {
    margin: 0 0 8px 0;
}

.about-account-info p:last-child {
    margin-bottom: 0;
}

.about-label {
    color: #8a8a8a;
    font-size: 14px;
    margin-right: 6px;
}

.about-link-caption {
    font-size: 13px;
    color: #8a8a8a;
    margin: 12px 0 4px 0;
}

.about-link-caption:first-of-type {
    margin-top: 0;
}

.instructions-content {
    padding: 0;
}

.instructions-menu h2 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 16px;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.instruction-platform-btn {
    background: #222222;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.instruction-platform-btn:hover {
    background: #2a2a2a;
    border-color: #4a9eff;
}

.instruction-platform-btn:active {
    transform: scale(0.98);
}

.instruction-detail {
    color: #fff;
    line-height: 1.6;
}

.instruction-detail h3 {
    color: #4a9eff;
    font-size: 17px;
    margin-bottom: 8px;
    margin-top: 14px;
}

.instruction-detail h3:first-child {
    margin-top: 0;
}

.instruction-detail p {
    color: #e0e0e0;
    margin-bottom: 10px;
}

.instruction-detail p:last-child {
    margin-bottom: 0;
}

.instruction-detail a {
    color: #4a9eff;
    text-decoration: none;
}

.instruction-detail a:hover {
    text-decoration: underline;
}

.instruction-detail ul {
    margin-left: 18px;
    margin-bottom: 10px;
}

.instruction-detail li {
    margin-bottom: 4px;
    color: #e0e0e0;
}

.link-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    color: #e0e0e0;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.link-button:hover {
    background: #2f2f2f;
    border-color: #4a4a4a;
}

.link-button span:first-child {
    font-size: 15px;
    font-weight: 500;
}

.link-arrow {
    color: #6a6a6a;
    font-size: 18px;
}

@media (max-width: 480px) {
    body {
        padding: 16px 12px calc(200px + env(safe-area-inset-bottom)) 12px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .subscription-info {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .stats {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }
    
    .subscription-card {
        padding: 12px;
    }
    
    .detail-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== АДМИН-ПАНЕЛЬ ==================== */

.admin-search-box {
    margin-bottom: 20px;
}

.admin-search-box input {
    width: 100%;
    padding: 12px 16px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.admin-search-box input:focus {
    border-color: #6a6a6a;
}

.admin-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px;
    background: #2a2a2a;
    border-radius: 8px;
}

.admin-user-card {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-user-card.active {
    border-color: #4a9eff;
    background: rgba(74, 158, 255, 0.1);
    box-shadow: 0 0 15px rgba(74, 158, 255, 0.2);
}

/* Новые адаптивные стили для карточек */
.card-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.card-main-info {
    flex: 1;
    min-width: 0; /* Важно для обрезки текста */
}

.card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.card-title {
    font-weight: 600;
    font-size: 16px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-badges {
    display: flex;
    gap: 4px;
}

.badge-default {
    background: #4a9eff;
    color: #fff;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-inactive {
    background: #ff4444;
    color: #fff;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.card-description {
    color: #999;
    font-size: 13px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-stats-row {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #ccc;
}

.card-actions-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Кнопки действий в карточке сервера — в одном стиле с «Изменить» у групп */
.server-action-btn {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.server-action-btn.btn-secondary {
    background: #2a2a2a;
    color: #a0a0a0;
    border-color: #3a3a3a;
}
.server-action-btn.btn-secondary:hover {
    background: #353535;
    color: #c0c0c0;
}
.server-action-btn.btn-danger {
    background: #3a2020;
    color: #e07a7a;
    border-color: #4a2828;
    width: auto;
    margin: 0;
}
.server-action-btn.btn-danger:hover {
    background: #4a2828;
    color: #f09090;
}
.server-action-btn:active {
    transform: scale(0.98);
}

/* Блок «Серверы» — продолжение выбранной карточки, без дублирования названия группы */
.group-detail-block {
    margin-top: 12px;
    padding-top: 16px;
    padding-left: 12px;
    border-left: 3px solid rgba(74, 158, 255, 0.5);
}

/* Заголовок блока «Серверы» и кнопка «+ Сервер» */
.group-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.group-detail-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    flex: 1;
    min-width: 0;
}
.group-detail-add-btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
}
.group-detail-add-btn:hover {
    background: #5a5a5a;
}

.small-btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
    min-width: auto !important;
}

@media (max-width: 480px) {
    .card-content-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .card-action-btn {
        margin-top: 12px;
        width: 100%;
    }
    
    .card-actions-row {
        margin-top: 12px;
        justify-content: flex-end;
    }
}

.admin-user-card:active {
    transform: scale(0.98);
    background: #2f2f2f;
}

.admin-user-card:hover {
    border-color: #4a4a4a;
}

.admin-user-id {
    font-size: 15px;
    font-weight: 600;
    color: #f5f5f5;
    margin-bottom: 6px;
}

.admin-user-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #a0a0a0;
}

.admin-user-subscriptions {
    margin-top: 6px;
    font-size: 12px;
    color: #6a6a6a;
}

.admin-user-detail-section {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

/* Стили для форм в модальных окнах */
.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    color: #a0a0a0;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    color: #fff;
    font-size: 16px; /* 16px предотвращает зум в iOS */
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none; /* Убирает стандартные стили в Safari */
    appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #4a9eff;
}

.form-group textarea {
    min-height: 100px;
    resize: none;
}

.form-group input[type="datetime-local"] {
    min-height: 48px;
}

/* Стили для чекбоксов */
.checkbox-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 12px !important;
    background: #1a1a1a;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid #333;
    cursor: pointer;
    margin-bottom: 16px;
}

.checkbox-group input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #4a9eff;
    margin: 0;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    font-size: 15px;
    color: #fff;
    flex: 1;
}

/* Чекбокс «Запомнить меня» на форме входа — свой вид */
.checkbox-group-login {
    background: #2a2a2a;
    border-color: #3a3a3a;
    padding: 14px 16px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.checkbox-group-login:hover {
    border-color: #4a4a4a;
    background: #2f2f2f;
}

.checkbox-group-login input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    margin: 0;
    border: 2px solid #4a4a4a;
    border-radius: 6px;
    background: #1a1a1a;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    position: relative;
}

.checkbox-group-login input[type="checkbox"]:hover {
    border-color: #5a5a5a;
}

.checkbox-group-login input[type="checkbox"]:checked {
    border-color: #4a9eff;
    background: #4a9eff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px 14px;
    background-position: center;
    background-repeat: no-repeat;
}

.checkbox-group-login label {
    font-size: 15px;
    color: #e0e0e0;
    user-select: none;
}

/* Анимации форм входа и регистрации */
@keyframes authFormEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#login-form.auth-form-enter,
#register-form.auth-form-enter {
    animation: authFormEnter 0.45s ease-out forwards;
}

@keyframes formShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-6px); }
    35% { transform: translateX(6px); }
    55% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

#login-form.form-shake,
#register-form.form-shake {
    animation: formShake 0.4s ease-in-out;
}

.auth-success-msg {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: #4a9eff;
    padding: 48px 20px;
    animation: authSuccessPop 0.55s ease-out forwards;
}

@keyframes authSuccessPop {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Поля на формах входа/регистрации — лёгкий подъём и свечение при фокусе */
#login-form .form-group input:focus,
#register-form .form-group input:focus {
    border-color: #4a9eff;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
    transform: translateY(-2px);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

#login-form .form-group input,
#register-form .form-group input {
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

/* Кнопка «Войти» / «Зарегистрироваться» — живая */
#login-form .form-actions button[type="submit"],
#register-form .form-actions button[type="submit"] {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#login-form .form-actions button[type="submit"]:hover,
#register-form .form-actions button[type="submit"]:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

#login-form .form-actions button[type="submit"]:active,
#register-form .form-actions button[type="submit"]:active {
    transform: scale(0.98);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.form-actions button {
    flex: 1;
    padding: 14px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
}

/* Адаптация модалок под мобильные */
@media (max-width: 480px) {
    .modal-content {
        padding: 20px;
        margin: 10px;
        max-height: 95vh;
        width: calc(100% - 20px);
    }
    
    .form-actions {
        flex-direction: column-reverse; /* Отмена внизу, Сохранить вверху */
    }
    
    .form-actions button {
        width: 100%;
    }
}

.admin-user-detail-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: #f5f5f5;
    margin-bottom: 8px;
}

.admin-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #3a3a3a;
}

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

.admin-detail-label {
    color: #a0a0a0;
    font-size: 12px;
}

.admin-detail-value {
    color: #e0e0e0;
    font-size: 12px;
    font-weight: 500;
}

.admin-subscription-card {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-subscription-card:active {
    transform: scale(0.98);
}

.admin-subscription-card:hover {
    border-color: #4a4a4a;
}

.admin-subscription-name {
    font-size: 14px;
    font-weight: 600;
    color: #f5f5f5;
    margin-bottom: 6px;
}

.admin-subscription-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
}

.admin-subscription-status.active {
    background: #2d5a2d;
    color: #7fcf7f;
}

.admin-subscription-status.expired {
    background: #5a2d2d;
    color: #cf7f7f;
}

.admin-subscription-status.canceled {
    background: #4a4a4a;
    color: #a0a0a0;
}

.admin-subscription-info {
    font-size: 14px;
    color: #a0a0a0;
    line-height: 1.8;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-group input[type="datetime-local"] {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 12px 16px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group input[type="datetime-local"]:focus {
    border-color: #6a6a6a;
    outline: none;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-primary,
.btn-secondary,
.btn-sync {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #4a4a4a;
    color: #f5f5f5;
}

.btn-primary:hover {
    background: #5a5a5a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
    background: #3a3a3a;
}

.btn-secondary {
    background: #2a2a2a;
    color: #a0a0a0;
    border: 1px solid #3a3a3a;
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-sync {
    background: #2d4a5a;
    color: #7fcfef;
    margin-top: 12px;
}

.btn-sync:active {
    transform: scale(0.98);
    background: #1d3a4a;
}

.sync-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #3a3a3a;
}

.sync-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #f5f5f5;
    margin-bottom: 8px;
}

.sync-section .hint {
    font-size: 14px;
    color: #a0a0a0;
    margin-bottom: 12px;
}

#sync-results {
    margin-top: 16px;
    padding: 12px;
    background: #2a2a2a;
    border-radius: 8px;
    font-size: 14px;
}

.sync-result-item {
    padding: 8px 0;
    border-bottom: 1px solid #3a3a3a;
}

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

.sync-result-success {
    color: #7fcf7f;
}

.sync-result-error {
    color: #cf7f7f;
}

.broadcast-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 16px;
}

.broadcast-mode {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.broadcast-mode .radio-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.broadcast-mode .radio-option input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.broadcast-mode .radio-option:hover {
    border-color: #4a4a4a;
    background: #333;
}

.chip-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 999px;
    color: #f5f5f5;
    font-size: 12px;
}

.chip button {
    border: none;
    background: transparent;
    color: #a0a0a0;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.chip button:hover {
    color: #f5f5f5;
}

.highlight-match {
    color: #ffd76a;
}

.broadcast-empty-state {
    font-size: 14px;
    color: #a0a0a0;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding: 16px 0;
}

.pagination button {
    padding: 8px 12px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:active {
    transform: scale(0.95);
}

.pagination button.active {
    background: #4a4a4a;
    border-color: #6a6a6a;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.delete-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #3a3a3a;
}

/* Стили для вкладок */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #3a3a3a;
}

.tab-button {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #a0a0a0;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.tab-button.active {
    color: #f5f5f5;
    border-bottom-color: #6a6a6a;
}

.tab-button:active {
    transform: scale(0.98);
}

.tab-content {
    display: none;
}

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

/* Стили для списка ключей */
.keys-list {
    margin-top: 16px;
}

.keys-header {
    margin-bottom: 16px;
}

.keys-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #f5f5f5;
}

.keys-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.key-item {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 16px;
    transition: border-color 0.2s;
}

.key-item:hover {
    border-color: #4a4a4a;
}

.key-server {
    font-size: 16px;
    font-weight: 600;
    color: #f5f5f5;
    margin-bottom: 8px;
}

.key-email {
    display: flex;
    align-items: center;
    gap: 8px;
}

.key-email-code {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    padding: 8px 12px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #e0e0e0;
    word-break: break-all;
    overflow-wrap: break-word;
}

.btn-copy-key {
    background: #3a3a3a;
    border: 1px solid #4a4a4a;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-copy-key:active {
    transform: scale(0.95);
    background: #2a2a2a;
}

.keys-summary {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #3a3a3a;
    font-size: 14px;
    color: #a0a0a0;
    text-align: center;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #a0a0a0;
}

.empty-state p {
    font-size: 16px;
}

.delete-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #f5f5f5;
    margin-bottom: 8px;
}

.delete-section .hint.warning {
    font-size: 14px;
    color: #cf7f7f;
    margin-bottom: 12px;
}

.btn-danger {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: #5a2d2d;
    color: #cf7f7f;
    margin-top: 12px;
}

.btn-danger:active {
    transform: scale(0.98);
    background: #4a1d1d;
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}

.stat-card-title {
    font-size: 12px;
    color: #a0a0a0;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-card-value {
    font-size: 24px;
    font-weight: 700;
    color: #f5f5f5;
    margin-bottom: 6px;
}

.stat-card-value.active {
    color: #7fcf7f;
}

.stat-card-value.expired {
    color: #cf7f7f;
}

.stat-card-value.revenue {
    color: #7fcfef;
}

.stat-card-subtitle {
    font-size: 12px;
    color: #6a6a6a;
}

/* Админ-панель: главный экран — минимализм, ровные строки */
.admin-panel-content {
    padding: calc(36px + env(safe-area-inset-top, 0px)) 0 16px 0;
}

.admin-page-content {
    padding: 16px 0;
}

.admin-panel-section {
    margin-bottom: 32px;
}

.admin-panel-section:last-child {
    margin-bottom: 0;
}

.admin-panel-section-title {
    font-size: 15px;
    font-weight: 500;
    color: #888;
    margin: 0 0 12px 0;
    padding-left: 12px;
    letter-spacing: 0.02em;
}

.admin-panel-section-analytics .admin-panel-section-title {
    border-left: 3px solid #5a9fd4;
}

.admin-panel-section-management .admin-panel-section-title {
    border-left: 3px solid #6a6a6a;
}

.admin-panel-rows {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    overflow: hidden;
}

.admin-panel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 52px;
    padding: 14px 20px;
    background: none;
    border: none;
    border-bottom: 1px solid #333;
    color: #e0e0e0;
    font-size: 16px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

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

.admin-panel-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.admin-panel-row:active {
    background: rgba(255, 255, 255, 0.05);
}

.admin-panel-row-label {
    flex: 1;
    min-width: 0;
}

.admin-panel-row-chevron {
    flex-shrink: 0;
    margin-left: 12px;
    font-size: 20px;
    color: #888;
    transition: transform 0.2s ease, color 0.2s ease;
}

.admin-panel-row:hover .admin-panel-row-chevron {
    transform: translateX(3px);
    color: #a0a0a0;
}

/* Скрываем кнопки полного экрана на мобильных устройствах */
@media (max-width: 768px) {
    .fullscreen-btn {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Улучшение отображения графиков на мобильных */
    .chart-scroll-container {
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .chart-scroll-container > div {
        min-width: 700px; /* Увеличиваем минимальную ширину для лучшей читаемости */
    }
}

/* Стили для легенды Chart.js - элементы друг под другом */
canvas + div {
    margin-top: 16px;
}

/* Улучшение отображения легенды */
.chartjs-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

/* Стили для полноэкранного режима графиков */
div[style*="position: relative"]:fullscreen {
    background: #1a1a1a;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

div[style*="position: relative"]:-webkit-full-screen {
    background: #1a1a1a;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

div[style*="position: relative"]:-moz-full-screen {
    background: #1a1a1a;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

div[style*="position: relative"]:-ms-fullscreen {
    background: #1a1a1a;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Стили для кнопки полноэкранного режима */
button[onclick*="toggleFullscreen"] {
    transition: background-color 0.2s;
}

button[onclick*="toggleFullscreen"]:hover {
    background: #2a2a2a !important;
}

button[onclick*="toggleFullscreen"]:active {
    background: #3a3a3a !important;
}

/* Стили для списка нагрузки серверов (карточки с progress bar) */
.servers-load-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.server-load-card {
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    padding: 14px 16px;
    transition: border-color 0.2s, background 0.2s;
}

.server-load-card:hover {
    border-color: #4a4a4a;
}

.server-load-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}

.server-load-card-name {
    font-weight: 600;
    font-size: 15px;
    color: #fff;
}

.server-load-card-percent {
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.server-load-card-percent.low {
    color: #4bc0c0;
}

.server-load-card-percent.medium {
    color: #ffca28;
}

.server-load-card-percent.high {
    color: #ff6384;
}

.server-load-progress-track {
    height: 8px;
    background: #252525;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.server-load-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.server-load-progress-fill.low {
    background: linear-gradient(90deg, #4bc0c0 0%, #5dd5d5 100%);
}

.server-load-progress-fill.medium {
    background: linear-gradient(90deg, #ffca28 0%, #ffdd57 100%);
}

.server-load-progress-fill.high {
    background: linear-gradient(90deg, #ff6384 0%, #ff7b94 100%);
}

.server-load-card-details {
    font-size: 12px;
    color: #6a6a6a;
}



.web-only {
    display: none !important;
}

body.web-mode .web-only {
    display: block !important;
}

body.web-mode .tg-only {
    display: none !important;
}
