:root {
    --bg: #0b0e11;
    --bg-soft: #10141a;
    --surface: #151a21;
    --card: #1b212a;
    --card-hover: #212a35;
    --border: #29323d;
    --border-soft: #222a33;
    --text: #e8eaed;
    --muted: #9aa3ad;
    --faint: #6b7681;
    --accent: #9db4c4;
    --accent-2: #64b5c9;
    --grad: linear-gradient(135deg, #dfe9f0 0%, #9db4c4 45%, #647b8a 100%);
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --radius: 16px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.app {
    min-height: 100vh;
    padding-bottom: 90px;
    max-width: 560px;
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

/* Loading */
.loading {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading p {
    color: var(--muted);
    font-size: 0.95rem;
}

/* Error */
.error {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    gap: 20px;
    text-align: center;
}

.error p {
    color: var(--danger);
    font-size: 1rem;
}

.error button {
    padding: 12px 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
}

/* Header */
.header {
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--border-soft);
    background: var(--bg-soft);
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--grad);
    color: #0b0e11;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    flex-shrink: 0;
}

.user-name {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.user-username {
    color: var(--muted);
    font-size: 0.85rem;
}

.tariff-badge {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--muted);
    white-space: nowrap;
}

.tariff-badge.pro {
    background: var(--grad);
    color: #0b0e11;
    border-color: transparent;
}

.tariff-badge.banned {
    background: var(--danger);
    color: white;
    border-color: transparent;
}

/* Status grid */
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px 16px;
}

.status-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 14px;
    text-align: center;
}

.status-icon {
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.status-label {
    font-size: 0.8rem;
    color: var(--faint);
    margin-bottom: 4px;
}

.status-value {
    font-size: 0.9rem;
    font-weight: 600;
}

.status-value.ok {
    color: var(--success);
}

.status-value.no {
    color: var(--danger);
}

/* Section */
.section {
    padding: 16px;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

/* Tariff card */
.tariff-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 20px;
}

.tariff-card.pro {
    background: linear-gradient(180deg, var(--card-hover), var(--card));
    border-color: var(--accent);
}

.tariff-card.banned {
    border-color: var(--danger);
}

.tariff-name {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.tariff-desc {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 14px;
}

.tariff-features {
    list-style: none;
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

.tariff-features li {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 0.9rem;
    color: var(--muted);
}

.tariff-features li::before {
    content: "✓";
    color: var(--accent-2);
    font-weight: 700;
}

.tariff-until {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 12px;
}

/* Settings */
.settings-list {
    display: grid;
    gap: 8px;
}

.setting-item {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.setting-item:active {
    border-color: var(--accent);
}

.setting-info {
    min-width: 0;
    flex: 1;
}

.setting-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.setting-value {
    font-size: 0.82rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.setting-arrow {
    color: var(--faint);
    font-size: 1.2rem;
}

.pro-lock {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    margin-top: 12px;
}

.lock-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.pro-lock p {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.btn-buy {
    padding: 12px 24px;
    background: var(--grad);
    color: #0b0e11;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s;
}

.btn-buy:active {
    transform: scale(0.97);
}

/* Blacklist */
.blacklist-list {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

.blacklist-item {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.blacklist-id {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--muted);
}

.btn-remove {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--danger);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
}

.add-blacklist {
    display: flex;
    gap: 8px;
}

.add-blacklist input {
    flex: 1;
    padding: 12px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
}

.add-blacklist input:focus {
    border-color: var(--accent);
}

.add-blacklist button {
    padding: 12px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

/* Payments */
.payments-list {
    display: grid;
    gap: 8px;
}

.payment-item {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.payment-stars {
    font-weight: 700;
    color: var(--accent);
}

.payment-date {
    font-size: 0.82rem;
    color: var(--faint);
}

.empty-state {
    color: var(--faint);
    font-size: 0.9rem;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Bottom bar */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px 20px;
    background: linear-gradient(180deg, transparent, var(--bg) 30%);
    max-width: 560px;
    margin: 0 auto;
    pointer-events: none;
}

.btn-main {
    width: 100%;
    padding: 16px;
    background: var(--grad);
    color: #0b0e11;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(157, 180, 196, 0.2);
    pointer-events: auto;
    transition: transform 0.15s;
}

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

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
}

.modal-content h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.modal-desc {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.modal-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    margin-bottom: 16px;
}

.modal-input:focus {
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-cancel {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-save {
    padding: 10px 20px;
    background: var(--grad);
    border: none;
    border-radius: 10px;
    color: #0b0e11;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 0.9rem;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: toastIn 0.3s ease;
    max-width: 90%;
    text-align: center;
}

.toast.success {
    border-color: var(--success);
    color: var(--success);
}

.toast.error {
    border-color: var(--danger);
    color: var(--danger);
}

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
