* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0A0C12;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #FFFFFF;
    padding-bottom: 70px;
    min-height: 100vh;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 16px 80px;
}

.page {
    display: none;
    animation: fadeInUp 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Карточки */
.card {
    background: rgba(30, 32, 40, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 77, 30, 0.25);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(135deg, #FF4D1E, #E63E0F);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    color: #FF4D1E;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Баланс */
.balance-section {
    text-align: center;
    margin-bottom: 20px;
    padding: 8px;
}

.balance-label {
    font-size: 12px;
    color: #B0B8C5;
    letter-spacing: 1px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.balance-amount {
    font-size: 44px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFFFFF, #FF4D1E);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 12px;
    line-height: 1.2;
}

/* Кнопки */
.btn-primary {
    background: linear-gradient(135deg, #FF4D1E, #E63E0F);
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: white;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: transparent;
    border: 1.5px solid #FF4D1E;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #FF4D1E;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.btn-secondary:active {
    background: rgba(255, 77, 30, 0.1);
}

/* Статусы */
.status-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 600;
}

.status-active {
    background: rgba(46, 204, 113, 0.15);
    color: #2ECC71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.status-trial {
    background: rgba(255, 159, 28, 0.15);
    color: #FF9F1C;
    border: 1px solid rgba(255, 159, 28, 0.3);
}

.status-expired {
    background: rgba(231, 76, 60, 0.15);
    color: #E74C3C;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* Подписки */
.subscription-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 77, 30, 0.15);
}

.subscription-item:last-child {
    border-bottom: none;
}

.sub-info h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.sub-device {
    font-size: 11px;
    color: #B0B8C5;
}

.sub-status {
    text-align: right;
}

.subscription-item-card {
    background: rgba(30, 32, 40, 0.6);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
}

.sub-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.sub-device-count {
    font-size: 11px;
    color: #B0B8C5;
    margin-bottom: 8px;
}

.sub-status {
    font-size: 12px;
    margin-bottom: 12px;
}

.status-warning {
    color: #FF9F1C;
}

.btn-upgrade {
    background: transparent;
    border: 1px solid #FF4D1E;
    color: #FF4D1E;
    padding: 8px 12px;
    border-radius: 10px;
    width: 100%;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

/* Реферальный блок */
.referral-block {
    background: linear-gradient(135deg, rgba(255, 77, 30, 0.08), rgba(90, 98, 110, 0.05));
    border: 1px solid rgba(255, 77, 30, 0.25);
}

.referral-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.referral-percent {
    font-size: 32px;
    font-weight: 800;
    color: #FF4D1E;
}

.referral-desc {
    font-size: 12px;
    color: #B0B8C5;
    margin: 8px 0;
    line-height: 1.4;
}

.link-box {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 10px;
    color: #B0B8C5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    word-break: break-all;
    border: 1px solid rgba(255, 77, 30, 0.3);
}

.btn-copy {
    background: rgba(255, 77, 30, 0.2);
    border: 1px solid #FF4D1E;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    color: #FF4D1E;
    cursor: pointer;
    white-space: nowrap;
}

/* История */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 77, 30, 0.15);
}

.history-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.history-icon {
    font-size: 24px;
    min-width: 32px;
}

.history-details {
    flex: 1;
}

.history-details h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.history-date {
    font-size: 10px;
    color: #6C757D;
}

.history-amount {
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}

.amount-positive {
    color: #2ECC71;
}

.amount-negative {
    color: #E74C3C;
}

/* План карточки */
.plan-card {
    background: rgba(30, 32, 40, 0.85);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 77, 30, 0.3);
}

.plan-header {
    text-align: center;
    margin-bottom: 12px;
}

.plan-name {
    font-size: 18px;
    font-weight: 800;
    color: #FF4D1E;
    margin-bottom: 4px;
}

.plan-price {
    font-size: 28px;
    font-weight: 800;
    color: white;
}

.plan-duration {
    font-size: 11px;
    color: #B0B8C5;
}

.plan-features {
    margin: 12px 0;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 77, 30, 0.2);
    border-bottom: 1px solid rgba(255, 77, 30, 0.2);
}

.plan-features div {
    padding: 4px 0;
    font-size: 12px;
    color: #B0B8C5;
}

.plan-features div:before {
    content: "✓ ";
    color: #2ECC71;
    font-weight: bold;
}

/* Тикеты */
.ticket-item {
    background: rgba(30, 32, 40, 0.6);
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 77, 30, 0.2);
}

.ticket-meta {
    font-size: 10px;
    color: #B0B8C5;
    margin: 6px 0;
}

.ticket-preview {
    font-size: 11px;
    color: #B0B8C5;
    margin-top: 4px;
}

/* Чат */
.chat-message {
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 12px;
    word-break: break-word;
}

.chat-message.from-user {
    background: rgba(46, 204, 113, 0.1);
    border-left: 3px solid #2ECC71;
}

.chat-message.from-admin {
    background: rgba(255, 77, 30, 0.1);
    border-left: 3px solid #FF4D1E;
}

.chat-message strong {
    font-size: 12px;
    display: inline-block;
}

.chat-message small {
    font-size: 9px;
    color: #B0B8C5;
    margin-left: 8px;
}

.chat-message div:last-child {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #1A1C24;
    border-radius: 20px;
    padding: 20px;
    max-width: 90%;
    width: 400px;
    border: 1px solid #FF4D1E;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 77, 30, 0.5);
    border-radius: 10px;
    color: white;
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

/* Навигация */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 12, 18, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 77, 30, 0.3);
    display: flex;
    padding: 6px 20px 12px;
    justify-content: space-between;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    z-index: 100;
}

.nav-item {
    text-align: center;
    flex: 1;
    cursor: pointer;
    padding: 6px 0;
    border-radius: 10px;
}

.nav-icon {
    font-size: 22px;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 10px;
    color: #B0B8C5;
    font-weight: 500;
}

.nav-item.active .nav-label {
    color: #FF4D1E;
}

/* Заголовок */
.app-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 0;
}

.axe-logo {
    font-size: 28px;
}

.axe-title {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFFFFF, #FF4D1E);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.axe-tagline {
    font-size: 11px;
    color: #6C757D;
    text-align: center;
    margin-top: -6px;
    margin-bottom: 16px;
}

/* Тосты */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 13px;
    z-index: 1000;
    white-space: nowrap;
    animation: toastFadeOut 2s forwards;
    pointer-events: none;
    border: 1px solid #FF4D1E;
}

@keyframes toastFadeOut {
    0% { opacity: 1; transform: translateX(-50%) scale(1); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) scale(0.95); visibility: hidden; }
}

.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: #6C757D;
}

.empty-state-icon {
    font-size: 40px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 13px;
}

.loading {
    text-align: center;
    padding: 30px;
    color: #B0B8C5;
    font-size: 13px;
}

/* Скроллбар */
::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-track {
    background: #0A0C12;
}

::-webkit-scrollbar-thumb {
    background: #FF4D1E;
    border-radius: 10px;
}