/* ===========================================
   Account Page — Dark Minimal
   Based on manage.css patterns
   =========================================== */

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

body {
    background: #0a0a0a;
    color: #e5e5e5;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    opacity: 0;
    transition: opacity 0.35s ease;
}

body.loaded { opacity: 1; }

html[lang="ja"] body,
html[lang="zh"] body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans CJK SC', 'Noto Sans CJK JP',
        'Hiragino Sans', 'Microsoft YaHei', 'Yu Gothic', sans-serif;
}

/* === LAYOUT === */
.account-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.account-header.revealed {
    opacity: 1;
    transform: translateY(0);
}

.account-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.user-email {
    color: rgba(255,255,255,0.3);
    font-size: 0.85rem;
    margin-top: 2px;
    display: block;
}

.account-header-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Ghost nav button */
.btn-nav {
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-nav:hover {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
}

/* Admin button — amber accent */
.btn-admin {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(201,162,78,0.10);
    border: 1px solid rgba(201,162,78,0.35);
    color: rgba(226,179,90,0.85);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-admin:hover {
    background: rgba(201,162,78,0.16);
    border-color: rgba(201,162,78,0.55);
    color: #E2B35A;
}

.btn-admin-icon {
    font-style: normal;
    font-size: 0.75rem;
    opacity: 0.85;
}

/* === LOGIN === */
.login-container {
    max-width: 360px;
    margin: 120px auto;
}

.login-container h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    color: rgba(255,255,255,0.8);
}

.login-subtitle {
    text-align: center;
    color: rgba(255,255,255,0.35);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.login-register {
    text-align: center;
    color: rgba(255,255,255,0.35);
    font-size: 0.82rem;
    margin-top: 20px;
}

.login-register a {
    color: #a78bfa;
    text-decoration: none;
}

.login-register a:hover {
    text-decoration: underline;
}

/* === FORM === */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    border-color: rgba(255,255,255,0.2);
}

/* === PASSWORD TOGGLE === */
.password-wrap {
    position: relative;
}
.password-wrap .form-input {
    padding-right: 44px;
}
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.25);
    cursor: pointer;
    padding: 4px;
    font-size: 0;
    line-height: 1;
    transition: color 0.2s ease;
}
.password-toggle:hover {
    color: rgba(255,255,255,0.5);
}
.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.form-static {
    padding: 10px 0;
    color: rgba(255,255,255,0.5);
    font-size: 0.88rem;
}

.form-row {
    display: flex;
    gap: 24px;
    margin-bottom: 14px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* === BUTTONS === */
.btn-primary {
    width: 100%;
    padding: 12px 20px;
    background: #fff;
    color: #0a0a0a;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s ease;
    margin-top: 8px;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-save {
    width: auto;
    padding: 10px 32px;
}

.btn-logout {
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
}

/* === MESSAGES === */
.msg {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: none;
    text-align: center;
}

.msg.error {
    display: block;
    background: rgba(239,68,68,0.1);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.2);
}

.msg.success {
    display: block;
    background: rgba(16,185,129,0.1);
    color: #34d399;
    border: 1px solid rgba(16,185,129,0.2);
}

/* === TAB NAVIGATION === */
.tab-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease 0.08s, transform 0.35s ease 0.08s;
}

.tab-nav.revealed {
    opacity: 1;
    transform: translateY(0);
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    padding: 10px 16px;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    margin-bottom: -1px;
}

.tab-btn:hover { color: rgba(255,255,255,0.6); }
.tab-btn.active { color: #a78bfa; border-bottom-color: #a78bfa; }

.tab-panel { display: none; }

.tab-panel.active {
    display: block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease 0.16s, transform 0.35s ease 0.16s;
}

.tab-panel.active.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* === CURRENT PLAN CARD === */
.current-plan-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.current-plan-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.current-plan-status {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
    margin-top: 4px;
}

.current-plan-details {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
    text-align: right;
}

.plan-status-active {
    color: #34d399;
}

.plan-status-trial {
    color: #fbbf24;
}

.plan-status-expired {
    color: #f87171;
}

/* === BILLING TOGGLE === */
.billing-toggle {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 24px;
    width: fit-content;
}

.billing-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.billing-btn.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.save-badge {
    background: rgba(16,185,129,0.15);
    color: #34d399;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 4px;
}

/* === PLANS GRID === */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.plan-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 24px 20px;
    transition: all 0.3s ease;
    position: relative;
}

.plan-card:hover {
    border-color: rgba(255,255,255,0.12);
}

.plan-card.current {
    border-color: rgba(167,139,250,0.3);
    background: rgba(167,139,250,0.04);
}

.plan-card.featured {
    border-color: rgba(167,139,250,0.4);
}

.plan-card.featured::before {
    content: 'Популярный';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #a78bfa;
    color: #0a0a0a;
    padding: 2px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.plan-name {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.plan-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.plan-price .currency {
    font-size: 0.9rem;
    font-weight: 500;
}

.plan-price .period {
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(255,255,255,0.35);
}

.plan-price-yearly {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    margin-bottom: 16px;
    min-height: 18px;
}

.plan-features {
    list-style: none;
    margin-bottom: 20px;
}

.plan-features li {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.55);
    padding: 4px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.plan-features li::before {
    content: '\2713';
    color: #34d399;
    font-weight: 700;
    flex-shrink: 0;
}

.plan-features li.disabled {
    color: rgba(255,255,255,0.2);
}

.plan-features li.disabled::before {
    content: '\2717';
    color: rgba(255,255,255,0.15);
}

.btn-plan {
    width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-plan-upgrade {
    background: #fff;
    color: #0a0a0a;
}

.btn-plan-upgrade:hover { opacity: 0.9; }

.btn-plan-current {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.35);
    cursor: default;
}

.btn-plan-downgrade {
    background: none;
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.4);
}

.btn-plan-downgrade:hover {
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
}

/* === STORE FILTERS === */
.store-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
}

.filter-btn.active {
    background: rgba(167,139,250,0.1);
    border-color: rgba(167,139,250,0.3);
    color: #a78bfa;
}

/* === STORE GRID === */
.store-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.store-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.store-card:hover {
    border-color: rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
}

.store-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(167,139,250,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: #a78bfa;
    font-size: 1rem;
}

.store-card-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.store-card-desc {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.store-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.store-card-rating {
    font-size: 0.75rem;
    color: #fbbf24;
}

.store-card-rating i {
    margin-right: 2px;
}

.badge-plan {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-free {
    background: rgba(16,185,129,0.12);
    color: #34d399;
}

.badge-basic {
    background: rgba(99,102,241,0.12);
    color: #818cf8;
}

.badge-pro {
    background: rgba(167,139,250,0.12);
    color: #a78bfa;
}

.badge-enterprise {
    background: rgba(245,158,11,0.12);
    color: #fbbf24;
}

/* === PROFILE SECTION === */
.profile-section {
    margin-bottom: 32px;
}

.profile-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.profile-form {
    max-width: 480px;
}

/* === PAYMENTS TABLE === */
.payments-table {
    width: 100%;
    border-collapse: collapse;
}

.payments-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.35);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.payments-table td {
    padding: 12px 14px;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.75);
}

.payments-table tr:hover td {
    background: rgba(255,255,255,0.02);
}

.payment-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.payment-status.succeeded {
    background: rgba(16,185,129,0.12);
    color: #34d399;
}

.payment-status.pending, .payment-status.processing {
    background: rgba(245,158,11,0.12);
    color: #fbbf24;
}

.payment-status.canceled, .payment-status.failed, .payment-status.refunded {
    background: rgba(239,68,68,0.12);
    color: #f87171;
}

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.open { display: flex; }

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: #141414;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
}

.modal-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
}

.modal-item-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(167,139,250,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: #a78bfa;
    font-size: 1.4rem;
}

.modal-item-desc {
    color: rgba(255,255,255,0.5);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

.modal-item-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.modal-meta-item {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
}

.modal-item-plan {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-actions .btn-cancel {
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.modal-actions .btn-cancel:hover {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
}

/* === DOCS TAB === */
.docs-layout {
    display: flex;
    gap: 0;
    min-height: 500px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    overflow: hidden;
}

.docs-sidebar {
    width: 260px;
    min-width: 260px;
    background: rgba(255,255,255,0.02);
    border-right: 1px solid rgba(255,255,255,0.06);
    overflow-y: auto;
    max-height: 75vh;
}

.docs-sidebar-header {
    padding: 16px 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.docs-toc-group {
    padding: 8px 0;
}

.docs-toc-category {
    padding: 8px 20px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.docs-toc-link {
    display: block;
    padding: 8px 20px;
    font-size: 0.84rem;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
}

.docs-toc-link:hover {
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.03);
}

.docs-toc-link.active {
    color: #a78bfa;
    background: rgba(167,139,250,0.06);
    border-left-color: #a78bfa;
}

.docs-toc-empty,
.docs-toc-error {
    padding: 20px;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.3);
    text-align: center;
}

.docs-toc-error {
    color: #f87171;
}

.docs-reader {
    flex: 1;
    min-width: 0;
    padding: 32px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 75vh;
}

.docs-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: rgba(255,255,255,0.2);
}

.docs-empty-state i {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.docs-empty-state p {
    font-size: 0.92rem;
}

.docs-loading {
    padding: 40px;
    text-align: center;
    color: rgba(255,255,255,0.4);
    font-size: 0.88rem;
}

.docs-loading .spinner {
    border-color: rgba(255,255,255,0.1);
    border-top-color: rgba(255,255,255,0.5);
}

.docs-error {
    padding: 40px;
    text-align: center;
    color: #f87171;
    font-size: 0.88rem;
}

/* === DOCS ARTICLE (Markdown Rendering) === */
.docs-article {
    line-height: 1.7;
    color: rgba(255,255,255,0.8);
    overflow-wrap: break-word;
    word-break: break-word;
}

.docs-article h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.docs-article h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    margin: 32px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.docs-article h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin: 24px 0 8px;
}

.docs-article h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    margin: 20px 0 8px;
}

.docs-article p {
    margin: 0 0 12px;
    font-size: 0.92rem;
}

.docs-article a {
    color: #a78bfa;
    text-decoration: none;
}

.docs-article a:hover {
    text-decoration: underline;
}

.docs-article strong {
    color: #fff;
    font-weight: 600;
}

.docs-article code {
    background: rgba(255,255,255,0.08);
    color: #e879f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

.docs-article pre {
    margin: 12px 0 16px;
    border-radius: 10px;
    overflow-x: auto;
    max-width: 100%;
}

.docs-article pre code {
    display: block;
    padding: 16px 20px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    color: rgba(255,255,255,0.85);
    font-size: 0.82rem;
    line-height: 1.6;
    white-space: pre;
    overflow-x: auto;
}

.docs-article ul,
.docs-article ol {
    margin: 8px 0 16px;
    padding-left: 24px;
}

.docs-article li {
    margin: 4px 0;
    font-size: 0.92rem;
}

.docs-article blockquote {
    margin: 12px 0;
    padding: 12px 20px;
    border-left: 3px solid #a78bfa;
    background: rgba(167,139,250,0.05);
    border-radius: 0 8px 8px 0;
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
}

.docs-article .table-wrap {
    overflow-x: auto;
    margin: 12px 0 20px;
    -webkit-overflow-scrolling: touch;
}

.docs-article table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.docs-article table th {
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
}

.docs-article table td {
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.7);
}

.docs-article table tr:hover td {
    background: rgba(255,255,255,0.02);
}

.docs-article hr {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin: 24px 0;
}

.docs-article img {
    max-width: 100%;
    border-radius: 8px;
    margin: 8px 0;
}

.docs-article h1[id],
.docs-article h2[id],
.docs-article h3[id],
.docs-article h4[id] {
    scroll-margin-top: 16px;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255,255,255,0.25);
    font-size: 0.9rem;
}

/* === LOADING === */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(10,10,10,0.2);
    border-top-color: #0a0a0a;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

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

.hidden { display: none !important; }

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .account-wrap { padding: 20px 16px; }

    .store-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .account-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .modal-content {
        margin: 16px;
        padding: 24px;
    }

    .current-plan-card {
        flex-direction: column;
        gap: 12px;
    }

    .current-plan-details {
        text-align: left;
    }

    .docs-layout {
        flex-direction: column;
    }

    .docs-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .docs-toc-group {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 4px 12px 8px;
    }

    .docs-toc-category {
        width: 100%;
        padding: 8px 8px 2px;
    }

    .docs-toc-link {
        padding: 6px 12px;
        border-left: none;
        border-radius: 6px;
        font-size: 0.78rem;
        background: rgba(255,255,255,0.03);
        border: 1px solid rgba(255,255,255,0.06);
    }

    .docs-toc-link.active {
        border-left: none;
        border-color: rgba(167,139,250,0.3);
        background: rgba(167,139,250,0.08);
    }

    .docs-reader {
        max-height: none;
        padding: 20px 16px;
    }
}

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

    .store-grid {
        grid-template-columns: 1fr;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 0.78rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .payments-table .hide-mobile {
        display: none;
    }

    .docs-article pre code {
        font-size: 0.75rem;
        padding: 12px 14px;
    }

    .docs-article table {
        font-size: 0.78rem;
    }
}

/* ─── DEVICES TAB ─────────────────────────── */
.devices-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.device-stat-card {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.device-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #e5e5e5;
}

.device-stat-value.device-stat-online { color: #4ade80; }
.device-stat-value.device-stat-revoked { color: #f87171; }

.device-stat-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.device-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.device-card:hover {
    border-color: rgba(255,255,255,0.15);
}

.device-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.device-status-dot.online { background: #4ade80; box-shadow: 0 0 8px rgba(74,222,128,0.4); }
.device-status-dot.offline { background: #6b7280; }
.device-status-dot.revoked { background: #f87171; }

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

.device-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.device-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.device-role-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.device-role-badge.base-station {
    background: rgba(250,204,21,0.15);
    color: #fbbf24;
}

.device-role-badge.revoked-badge {
    background: rgba(248,113,113,0.15);
    color: #f87171;
}

.device-meta {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
}

.device-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-small {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
    background: transparent;
    color: #e5e5e5;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small:hover { background: rgba(255,255,255,0.08); }

.btn-danger-outline {
    border-color: rgba(248,113,113,0.4);
    color: #f87171;
}

.btn-danger-outline:hover { background: rgba(248,113,113,0.1); }

.btn-outline { border-color: rgba(74,222,128,0.4); color: #4ade80; }
.btn-outline:hover { background: rgba(74,222,128,0.1); }

.devices-emergency {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: center;
}

.btn-danger {
    background: rgba(220,38,38,0.15);
    color: #f87171;
    border: 1px solid rgba(220,38,38,0.3);
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: rgba(220,38,38,0.25);
    border-color: rgba(220,38,38,0.5);
}

.btn-danger i { margin-right: 6px; }

@media (max-width: 600px) {
    .devices-stats { flex-direction: column; gap: 8px; }
    .device-card { flex-wrap: wrap; }
    .device-actions { width: 100%; justify-content: flex-end; }
}
