/**
 * JEXA Panel v4.0
 * Light Mode Default - Account Page Only
 */

/* ============================================
   VARIABLES - LIGHT MODE (DEFAULT)
============================================ */
:root {
    --jx-primary: #6366f1;
    --jx-primary-hover: #4f46e5;
    --jx-secondary: #8b5cf6;
    --jx-success: #10b981;
    --jx-warning: #f59e0b;
    --jx-danger: #ef4444;
    
    --jx-bg: #f1f5f9;
    --jx-bg-card: #ffffff;
    --jx-bg-hover: #f8fafc;
    --jx-bg-input: #ffffff;
    --jx-text: #0f172a;
    --jx-text-secondary: #475569;
    --jx-text-muted: #94a3b8;
    --jx-border: #e2e8f0;
    --jx-shadow: 0 1px 3px rgba(0,0,0,0.08);
    --jx-shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    
    --jx-sidebar-w: 260px;
    --jx-header-h: 60px;
    --jx-bottom-h: 68px;
    --jx-radius: 16px;
    --jx-radius-sm: 10px;
    --jx-radius-xs: 6px;
}

/* DARK MODE */
[data-theme="dark"] {
    --jx-bg: #0f172a;
    --jx-bg-card: #1e293b;
    --jx-bg-hover: #334155;
    --jx-bg-input: #1e293b;
    --jx-text: #f1f5f9;
    --jx-text-secondary: #cbd5e1;
    --jx-text-muted: #64748b;
    --jx-border: #334155;
    --jx-shadow: 0 1px 3px rgba(0,0,0,0.3);
    --jx-shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
}

/* ============================================
   BASE
============================================ */
.jexa-account {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif !important;
    background: var(--jx-bg) !important;
    color: var(--jx-text);
    line-height: 1.6;
}

.jexa-account #wpadminbar { display: none !important; }
.jexa-account { margin-top: 0 !important; }

.jexa-account *, .jexa-account *::before, .jexa-account *::after {
    box-sizing: border-box;
}

.jexa-account .woocommerce-MyAccount-navigation:not(.jx-sidebar) {
    display: none !important;
}

/* ============================================
   LAYOUT
============================================ */
.jexa-account .woocommerce {
    display: flex;
    min-height: 100vh;
    direction: rtl;
}

/* ============================================
   SIDEBAR
============================================ */
.jx-sidebar {
    width: var(--jx-sidebar-w);
    background: var(--jx-bg-card);
    border-left: 1px solid var(--jx-border);
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.jx-sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--jx-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.jx-logo {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    color: var(--jx-text);
    text-decoration: none;
}

/* Theme Toggle - Desktop */
.jx-theme-toggle {
    display: flex;
    gap: 4px;
    background: var(--jx-bg);
    border-radius: 10px;
    padding: 4px;
}

.jx-theme-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--jx-text-muted);
    font-family: inherit;
    transition: all 0.2s;
}

.jx-theme-option svg {
    width: 16px;
    height: 16px;
}

.jx-theme-option.active {
    background: var(--jx-bg-card);
    color: var(--jx-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.jx-theme-option:hover:not(.active) {
    color: var(--jx-text);
}

.jx-close-btn {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--jx-bg-hover);
    border-radius: var(--jx-radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--jx-text-muted);
}

.jx-close-btn svg { width: 20px; height: 20px; }

/* User Card */
.jx-user-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.08));
    border-bottom: 1px solid var(--jx-border);
}

.jx-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--jx-primary);
    flex-shrink: 0;
}

.jx-user-info { flex: 1; min-width: 0; }
.jx-user-info strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--jx-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.jx-user-info span {
    display: block;
    font-size: 12px;
    color: var(--jx-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Navigation */
.jx-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.jx-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: var(--jx-radius-sm);
    color: var(--jx-text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.jx-nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }

.jx-nav-item:hover {
    background: var(--jx-bg-hover);
    color: var(--jx-primary);
}

.jx-nav-item.active {
    background: linear-gradient(135deg, var(--jx-primary), var(--jx-secondary));
    color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

/* Sidebar Footer */
.jx-sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--jx-border);
}

.jx-shop-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--jx-bg-hover);
    color: var(--jx-text-secondary);
    text-decoration: none;
    border-radius: var(--jx-radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.jx-shop-link svg { width: 18px; height: 18px; }

.jx-shop-link:hover {
    background: var(--jx-primary);
    color: #fff;
}

/* ============================================
   MOBILE HEADER
============================================ */
.jx-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--jx-header-h);
    background: var(--jx-bg-card);
    border-bottom: 1px solid var(--jx-border);
    padding: 0 16px;
    align-items: center;
    gap: 12px;
    z-index: 900;
}

.jx-menu-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--jx-bg-hover);
    border-radius: var(--jx-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--jx-text);
    flex-shrink: 0;
    font-size: 22px;
}

.jx-page-title {
    flex: 1;
    font-size: 17px;
    font-weight: 600;
    color: var(--jx-text);
    margin: 0;
}

/* Theme Toggle Mobile */
.jx-theme-toggle-mobile {
    display: flex;
    gap: 4px;
    background: var(--jx-bg);
    border-radius: 8px;
    padding: 3px;
}

.jx-theme-option-mobile {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jx-theme-option-mobile.active {
    background: var(--jx-bg-card);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* ============================================
   BOTTOM NAVIGATION
============================================ */
.jx-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--jx-bottom-h);
    background: var(--jx-bg-card);
    border-top: 1px solid var(--jx-border);
    z-index: 900;
    justify-content: space-around;
    align-items: center;
    padding: 8px 4px env(safe-area-inset-bottom, 8px);
}

.jx-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    color: var(--jx-text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    border-radius: var(--jx-radius-sm);
    transition: all 0.2s;
    min-width: 60px;
}

.jx-bottom-item svg { width: 24px; height: 24px; }

.jx-bottom-item.active {
    color: var(--jx-primary);
    background: rgba(99,102,241,0.1);
}

/* ============================================
   OVERLAY
============================================ */
.jx-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s;
}

.jx-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ============================================
   MAIN CONTENT
============================================ */
.jx-main {
    flex: 1;
    margin-right: var(--jx-sidebar-w);
    min-height: 100vh;
}

.jx-content {
    padding: 32px;
    max-width: 1100px;
    margin: 0 auto;
}

/* ============================================
   BUTTONS
============================================ */
.jx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--jx-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    background: var(--jx-bg-hover);
    color: var(--jx-text);
}

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

.jx-btn-primary {
    background: linear-gradient(135deg, var(--jx-primary), var(--jx-secondary)) !important;
    color: #fff !important;
}

.jx-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99,102,241,0.4);
    transform: translateY(-2px);
}

.jx-btn-outline {
    background: transparent;
    border: 2px solid var(--jx-border);
}

.jx-btn-danger {
    background: var(--jx-danger);
    color: #fff;
}

.jx-btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ============================================
   FORMS
============================================ */
.jexa-account form:not(.jx-search-form) {
    background: var(--jx-bg-card);
    border-radius: var(--jx-radius);
    border: 1px solid var(--jx-border);
    padding: 28px;
}

.jexa-account label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--jx-text);
    margin-bottom: 8px;
}

.jexa-account input[type="text"],
.jexa-account input[type="email"],
.jexa-account input[type="password"],
.jexa-account input[type="tel"],
.jexa-account input[type="number"],
.jexa-account select,
.jexa-account textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 14px;
    font-family: inherit;
    background: var(--jx-bg-input);
    color: var(--jx-text);
    border: 2px solid var(--jx-border);
    border-radius: var(--jx-radius-sm);
    transition: all 0.2s;
}

.jexa-account input:focus,
.jexa-account select:focus,
.jexa-account textarea:focus {
    outline: none;
    border-color: var(--jx-primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.15);
}

.jexa-account button,
.jexa-account .button,
.jexa-account input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--jx-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--jx-bg-hover);
    color: var(--jx-text);
}

.jexa-account .button.alt,
.jexa-account button.alt {
    background: linear-gradient(135deg, var(--jx-primary), var(--jx-secondary)) !important;
    color: #fff !important;
}

/* ============================================
   TABLES
============================================ */
.jexa-account table {
    width: 100%;
    background: var(--jx-bg-card);
    border-radius: var(--jx-radius);
    border: 1px solid var(--jx-border);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.jexa-account table th,
.jexa-account table td {
    padding: 16px 20px;
    text-align: right;
    border-bottom: 1px solid var(--jx-border);
}

.jexa-account table th {
    background: var(--jx-bg-hover);
    font-weight: 600;
    color: var(--jx-text);
    font-size: 13px;
}

.jexa-account table td {
    color: var(--jx-text-secondary);
    font-size: 14px;
}

.jexa-account table tr:last-child td { border-bottom: none; }

/* Status */
.jx-status {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.jx-status-pending { background: rgba(99,102,241,0.15); color: var(--jx-primary); }
.jx-status-processing { background: rgba(245,158,11,0.15); color: var(--jx-warning); }
.jx-status-on-hold { background: rgba(100,116,139,0.15); color: var(--jx-text-muted); }
.jx-status-completed { background: rgba(16,185,129,0.15); color: var(--jx-success); }
.jx-status-cancelled, .jx-status-refunded, .jx-status-failed { 
    background: rgba(239,68,68,0.15); color: var(--jx-danger); 
}

/* ============================================
   CARDS
============================================ */
.jx-card {
    background: var(--jx-bg-card);
    border-radius: var(--jx-radius);
    border: 1px solid var(--jx-border);
    padding: 24px;
    margin-bottom: 20px;
}

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

.jx-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--jx-text);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.jx-card-title svg {
    width: 24px;
    height: 24px;
    color: var(--jx-primary);
}

/* ============================================
   STATS
============================================ */
.jx-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.jx-stat-card {
    background: var(--jx-bg-card);
    border-radius: var(--jx-radius);
    border: 1px solid var(--jx-border);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.jx-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--jx-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.jx-stat-icon svg { width: 28px; height: 28px; color: #fff; }

.jx-stat-icon.blue { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.jx-stat-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.jx-stat-icon.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.jx-stat-icon.pink { background: linear-gradient(135deg, #ec4899, #db2777); }

.jx-stat-info h3 {
    font-size: 24px;
    font-weight: 800;
    color: var(--jx-text);
    margin: 0 0 4px;
    line-height: 1;
}

.jx-stat-info p {
    font-size: 13px;
    color: var(--jx-text-muted);
    margin: 0;
}

/* ============================================
   ORDERS GRID
============================================ */
.jx-orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.jx-order-card {
    background: var(--jx-bg-card);
    border-radius: var(--jx-radius);
    border: 1px solid var(--jx-border);
    overflow: hidden;
    transition: all 0.2s;
}

.jx-order-card:hover {
    box-shadow: var(--jx-shadow-lg);
    transform: translateY(-4px);
}

.jx-order-header {
    padding: 16px 20px;
    background: var(--jx-bg-hover);
    border-bottom: 1px solid var(--jx-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jx-order-number {
    font-size: 16px;
    font-weight: 700;
    color: var(--jx-text);
}

.jx-order-date {
    font-size: 12px;
    color: var(--jx-text-muted);
    display: block;
}

.jx-order-items { padding: 16px 20px; }

.jx-order-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--jx-border);
}

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

.jx-order-item-img {
    width: 50px;
    height: 50px;
    border-radius: var(--jx-radius-xs);
    object-fit: cover;
    background: var(--jx-bg-hover);
}

.jx-order-item-info { flex: 1; min-width: 0; }

.jx-order-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--jx-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.jx-order-item-qty {
    font-size: 12px;
    color: var(--jx-text-muted);
}

.jx-order-footer {
    padding: 16px 20px;
    background: var(--jx-bg-hover);
    border-top: 1px solid var(--jx-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jx-order-total {
    font-size: 18px;
    font-weight: 700;
    color: var(--jx-primary);
}

.jx-order-actions { display: flex; gap: 8px; }

/* ============================================
   ADDRESSES
============================================ */
.jx-addresses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.jx-address-card {
    background: var(--jx-bg-card);
    border-radius: var(--jx-radius);
    border: 1px solid var(--jx-border);
    overflow: hidden;
}

.jx-address-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
    border-bottom: 1px solid var(--jx-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.jx-address-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--jx-primary), var(--jx-secondary));
    border-radius: var(--jx-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.jx-address-icon svg { width: 22px; height: 22px; color: #fff; }

.jx-address-title { flex: 1; }
.jx-address-title h4 { font-size: 15px; font-weight: 600; color: var(--jx-text); margin: 0; }
.jx-address-title span { font-size: 12px; color: var(--jx-text-muted); }

.jx-address-edit {
    width: 36px;
    height: 36px;
    background: var(--jx-bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--jx-text-muted);
    text-decoration: none;
    transition: all 0.2s;
}

.jx-address-edit svg { width: 16px; height: 16px; }

.jx-address-edit:hover {
    background: var(--jx-primary);
    color: #fff;
}

.jx-address-body {
    padding: 20px;
}

.jx-address-body p {
    font-size: 14px;
    color: var(--jx-text-secondary);
    margin: 0 0 8px;
    line-height: 1.7;
}

.jx-address-body .name {
    font-weight: 600;
    color: var(--jx-text);
    font-size: 15px;
}

.jx-address-empty {
    text-align: center;
    padding: 20px;
    color: var(--jx-text-muted);
}

/* ============================================
   DOWNLOADS
============================================ */
.jx-downloads-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.jx-download-card {
    background: var(--jx-bg-card);
    border-radius: var(--jx-radius);
    border: 1px solid var(--jx-border);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.jx-download-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--jx-primary), var(--jx-secondary));
    border-radius: var(--jx-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.jx-download-icon svg { width: 28px; height: 28px; color: #fff; }

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

.jx-download-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--jx-text);
    margin-bottom: 4px;
    display: block;
}

.jx-download-product {
    font-size: 13px;
    color: var(--jx-text-muted);
    display: block;
}

/* ============================================
   QUICK ACTIONS
============================================ */

/* ============================================
   EMPTY STATE
============================================ */
.jx-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--jx-bg-card);
    border-radius: var(--jx-radius);
    border: 1px solid var(--jx-border);
}

.jx-empty svg {
    width: 64px;
    height: 64px;
    color: var(--jx-text-muted);
    opacity: 0.5;
    margin-bottom: 20px;
}

.jx-empty h3 {
    font-size: 18px;
    color: var(--jx-text);
    margin: 0 0 8px;
}

.jx-empty p {
    font-size: 14px;
    color: var(--jx-text-muted);
    margin: 0 0 20px;
}

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

.jx-modal.show { display: flex; }

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

.jx-modal-container {
    position: relative;
    background: var(--jx-bg-card);
    border-radius: var(--jx-radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.jx-modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    background: var(--jx-bg-hover);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--jx-text-muted);
    z-index: 10;
}

.jx-modal-close svg { width: 20px; height: 20px; }

.jx-modal-close:hover {
    background: var(--jx-danger);
    color: #fff;
}

.jx-modal-content { padding: 28px; }

/* Order Detail Modal */
.jx-order-detail-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--jx-border);
    margin-bottom: 20px;
}

.jx-order-detail-header h3 {
    font-size: 20px;
    margin: 0 0 12px;
    color: var(--jx-text);
}

.jx-order-detail-header p {
    font-size: 13px;
    color: var(--jx-text-muted);
}

.jx-order-detail-items h4 {
    font-size: 14px;
    color: var(--jx-text-muted);
    font-weight: 500;
    margin: 0 0 16px;
}

.jx-order-detail-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--jx-border);
}

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

.jx-order-detail-item img {
    width: 56px;
    height: 56px;
    border-radius: var(--jx-radius-xs);
    object-fit: cover;
}

.jx-order-detail-item-info { flex: 1; }
.jx-order-detail-item-info strong { display: block; font-size: 14px; color: var(--jx-text); }
.jx-order-detail-item-info span { font-size: 12px; color: var(--jx-text-muted); }

.jx-order-detail-item-price { font-weight: 700; color: var(--jx-primary); }

.jx-order-detail-totals {
    background: var(--jx-bg-hover);
    border-radius: var(--jx-radius-sm);
    padding: 16px;
    margin: 20px 0;
}

.jx-order-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: var(--jx-text);
}

.jx-order-detail-row.total {
    border-top: 1px solid var(--jx-border);
    margin-top: 8px;
    padding-top: 12px;
    font-weight: 700;
    font-size: 16px;
}

.jx-order-detail-row.total span:last-child { color: var(--jx-primary); }

/* ============================================
   THANK YOU PAGE
============================================ */
.jx-thankyou {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--jx-bg);
}

.jx-ty-card {
    background: var(--jx-bg-card);
    border-radius: var(--jx-radius);
    border: 1px solid var(--jx-border);
    padding: 40px;
    text-align: center;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--jx-shadow-lg);
}

.jx-ty-icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.jx-ty-icon svg { width: 48px; height: 48px; }

.jx-thankyou.is-success .jx-ty-icon {
    background: rgba(16,185,129,0.15);
    color: var(--jx-success);
}

.jx-thankyou.is-failed .jx-ty-icon {
    background: rgba(239,68,68,0.15);
    color: var(--jx-danger);
}

.jx-ty-card h1 {
    font-size: 24px;
    color: var(--jx-text);
    margin: 0 0 8px;
}

.jx-ty-card > p {
    font-size: 15px;
    color: var(--jx-text-muted);
    margin: 0 0 24px;
}

.jx-ty-details {
    background: var(--jx-bg-hover);
    border-radius: var(--jx-radius-sm);
    padding: 16px;
    margin-bottom: 24px;
}

.jx-ty-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
}

.jx-ty-row span { color: var(--jx-text-muted); }
.jx-ty-row strong { color: var(--jx-text); }

.jx-ty-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================
   SUPPORT TICKETS FIX
============================================ */
.jexa-account .wpsp-container,
.jexa-account .wpsp-wrapper,
.jexa-account .support-tickets-wrapper,
.jexa-account .awsm-support-ticket {
    background: var(--jx-bg-card) !important;
    color: var(--jx-text) !important;
    border-radius: var(--jx-radius);
    padding: 20px;
}

.jexa-account .wpsp-container *,
.jexa-account .support-tickets-wrapper *,
.jexa-account .awsm-support-ticket * {
    color: inherit !important;
}

[data-theme="dark"] .jexa-account .wpsp-container,
[data-theme="dark"] .jexa-account .wpsp-wrapper {
    background: var(--jx-bg-card) !important;
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 991px) {
    .jexa-account .woocommerce { display: block; }
    
    .jx-sidebar {
        transform: translateX(100%);
        box-shadow: -10px 0 40px rgba(0,0,0,0.2);
    }
    
    .jx-sidebar.open { transform: translateX(0); }
    
    .jx-close-btn { display: flex; }
    .jx-theme-toggle { display: none; }
    
    .jx-main {
        margin-right: 0;
        padding-top: var(--jx-header-h);
        padding-bottom: calc(var(--jx-bottom-h) + 20px);
    }
    
    .jx-content { padding: 20px 16px; }
    
    .jx-mobile-header, .jx-bottom-nav { display: flex; }
    
    /* Dashboard responsive */
    .jx-dashboard-top {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .jx-welcome {
        min-width: auto;
    }
    
    .jx-dashboard-top .jx-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .jx-stats { grid-template-columns: 1fr 1fr; }
    .jx-orders-grid { grid-template-columns: 1fr; }
    .jx-addresses-grid { grid-template-columns: 1fr; }
    .jx-quick-actions { flex-wrap: wrap; }
    .jx-quick-action { min-width: calc(50% - 8px); flex: none; }
}

@media (max-width: 575px) {
    /* Dashboard mobile */
    .jx-dashboard-top .jx-stats {
        grid-template-columns: 1fr;
    }
    
    .jx-stats { grid-template-columns: 1fr; }
    .jx-stat-card { padding: 16px; }
    .jx-stat-icon { width: 48px; height: 48px; }
    .jx-stat-info h3 { font-size: 20px; }
    
    .jx-welcome { padding: 20px; }
    .jx-welcome-avatar { width: 55px; height: 55px; }
    .jx-welcome-text h2 { font-size: 18px; }
    
    .jx-quick-action { min-width: calc(50% - 8px); padding: 16px 12px; }
    .jx-quick-action-icon { width: 42px; height: 42px; }
    .jx-quick-action-icon svg { width: 20px; height: 20px; }
    .jx-quick-action span { font-size: 13px; }
    
    .jx-bottom-item { min-width: 52px; padding: 6px 8px; font-size: 10px; }
    .jx-bottom-item svg { width: 22px; height: 22px; }
    
    .jx-card { padding: 16px; }
}

/* ============================================
   ANIMATIONS
============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.jx-content > * { animation: fadeInUp 0.4s ease; }

/* Scrollbar */
.jexa-account ::-webkit-scrollbar { width: 6px; height: 6px; }
.jexa-account ::-webkit-scrollbar-track { background: var(--jx-bg); }
.jexa-account ::-webkit-scrollbar-thumb { background: var(--jx-border); border-radius: 3px; }

/* Print */
@media print {
    .jx-sidebar, .jx-mobile-header, .jx-bottom-nav, .jx-overlay, .jx-modal { display: none !important; }
    .jx-main { margin: 0 !important; padding: 0 !important; }
}

/* ============================================
   DASHBOARD SPECIFIC
============================================ */
/* Dashboard Top - Welcome + Stats in one row */
.jx-dashboard-top {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 24px;
}

/* Welcome Card */
.jx-welcome {
    background: linear-gradient(135deg, var(--jx-primary), var(--jx-secondary));
    border-radius: var(--jx-radius);
    padding: 24px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
    min-width: 280px;
}

.jx-welcome-avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    object-fit: cover;
    flex-shrink: 0;
}

.jx-welcome-text h2 {
    font-size: 20px;
    margin: 0 0 4px;
    font-weight: 700;
}

.jx-welcome-text p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}

/* Stats in dashboard top */
.jx-dashboard-top .jx-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 0;
}

/* Quick Actions - Horizontal */
.jx-quick-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.jx-quick-action {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    background: var(--jx-bg-card);
    border: 1px solid var(--jx-border);
    border-radius: var(--jx-radius);
    text-decoration: none;
    color: var(--jx-text);
    transition: all 0.3s;
}

.jx-quick-action:hover {
    border-color: var(--jx-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(99,102,241,0.15);
}

.jx-quick-action-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.1));
    border-radius: var(--jx-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.jx-quick-action-icon svg {
    width: 24px;
    height: 24px;
    color: var(--jx-primary);
}

.jx-quick-action span {
    font-size: 14px;
    font-weight: 600;
}

/* Recent Orders */
.jx-recent-orders {
    display: flex;
    flex-direction: column;
}

.jx-recent-order {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--jx-border);
    cursor: pointer;
    transition: all 0.2s;
}

.jx-recent-order:last-child { border-bottom: none; }

.jx-recent-order:hover {
    background: var(--jx-bg-hover);
    margin: 0 -24px;
    padding: 14px 24px;
    border-radius: var(--jx-radius-sm);
}

.jx-recent-order-images {
    display: flex;
}

.jx-recent-order-images img {
    width: 40px;
    height: 40px;
    border-radius: var(--jx-radius-xs);
    object-fit: cover;
    border: 2px solid var(--jx-bg-card);
    margin-left: -10px;
}

.jx-recent-order-images img:first-child { margin-left: 0; }

.jx-more {
    width: 40px;
    height: 40px;
    background: var(--jx-bg-hover);
    border-radius: var(--jx-radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--jx-text-muted);
    margin-left: -10px;
}

.jx-recent-order-info {
    flex: 1;
    min-width: 0;
}

.jx-recent-order-info strong {
    display: block;
    font-size: 14px;
    color: var(--jx-text);
}

.jx-recent-order-info span {
    font-size: 12px;
    color: var(--jx-text-muted);
}

.jx-recent-order-meta {
    text-align: left;
}

.jx-recent-order-meta strong {
    display: block;
    font-size: 14px;
    color: var(--jx-primary);
    margin-top: 4px;
}

.jx-arrow {
    width: 18px;
    height: 18px;
    color: var(--jx-text-muted);
    opacity: 0.5;
}

/* Empty Small */
.jx-empty-small {
    text-align: center;
    padding: 30px;
    color: var(--jx-text-muted);
}

.jx-empty-small p {
    margin: 0 0 12px;
}

/* Page Header */
.jx-page-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.jx-page-title-main {
    font-size: 20px;
    font-weight: 700;
    color: var(--jx-text);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.jx-page-title-main svg {
    width: 24px;
    height: 24px;
    color: var(--jx-primary);
}

.jx-badge {
    background: var(--jx-bg-hover);
    color: var(--jx-text-muted);
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 20px;
}

/* Order More */
.jx-order-more {
    text-align: center;
    padding: 8px;
    background: var(--jx-bg-hover);
    border-radius: var(--jx-radius-xs);
    font-size: 11px;
    color: var(--jx-text-muted);
    margin-top: 8px;
}

/* Profile Header */
.jx-profile-header {
    background: linear-gradient(135deg, var(--jx-primary), var(--jx-secondary));
    border-radius: var(--jx-radius);
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    color: #fff;
}

.jx-profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    object-fit: cover;
}

.jx-profile-info h3 {
    font-size: 20px;
    margin: 0 0 4px;
}

.jx-profile-info p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0 0 2px;
}

.jx-profile-info span {
    font-size: 11px;
    opacity: 0.7;
}

/* Account Form */
.jx-account-form {
    background: var(--jx-bg-card) !important;
    border-radius: var(--jx-radius) !important;
    border: 1px solid var(--jx-border) !important;
    padding: 0 !important;
    overflow: hidden;
}

.jx-form-section {
    padding: 24px;
    border-bottom: 1px solid var(--jx-border);
}

.jx-form-section:last-of-type { border-bottom: none; }

.jx-form-section h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--jx-text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
}

.jx-form-section h4 svg { color: var(--jx-primary); }

.jx-form-hint {
    font-size: 12px;
    color: var(--jx-text-muted);
    margin-bottom: 14px;
}

.jx-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.jx-form-group {
    margin-bottom: 14px;
}

.jx-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--jx-text);
    margin-bottom: 6px;
}

.jx-form-group small {
    display: block;
    font-size: 11px;
    color: var(--jx-text-muted);
    margin-top: 4px;
}

.jx-form-actions {
    padding: 18px 24px;
    background: var(--jx-bg-hover);
    display: flex;
    justify-content: flex-end;
}

/* Logout Section */
.jx-logout-section {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: var(--jx-radius);
    padding: 20px;
    margin-top: 24px;
}

.jx-logout-section h4 {
    font-size: 15px;
    color: var(--jx-danger);
    margin: 0 0 6px;
}

.jx-logout-section p {
    font-size: 12px;
    color: var(--jx-text-muted);
    margin: 0 0 14px;
}

/* Payment Methods */
.jx-payment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.jx-payment-card {
    background: var(--jx-bg-card);
    border-radius: var(--jx-radius);
    border: 1px solid var(--jx-border);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.jx-payment-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--jx-primary), var(--jx-secondary));
    border-radius: var(--jx-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.jx-payment-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.jx-payment-info {
    flex: 1;
}

.jx-payment-name {
    display: block;
    font-weight: 600;
    color: var(--jx-text);
}

.jx-payment-expires {
    font-size: 12px;
    color: var(--jx-text-muted);
}

.jx-payment-default {
    display: inline-block;
    background: rgba(16,185,129,0.15);
    color: var(--jx-success);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
}

.jx-payment-actions {
    display: flex;
    gap: 8px;
}

/* Address Phone */
.jx-address-body .phone {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--jx-border);
}

/* Spinner */
.jx-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--jx-border);
    border-top-color: var(--jx-primary);
    border-radius: 50%;
    margin: 0 auto 14px;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   RESPONSIVE EXTRA
============================================ */
@media (max-width: 575px) {
    .jx-welcome {
        flex-direction: column-reverse;
        text-align: center;
        padding: 20px;
    }
    
    .jx-welcome-avatar {
        width: 56px;
        height: 56px;
        margin-bottom: 12px;
    }
    
    .jx-welcome-text h2 {
        font-size: 18px;
    }
    
    .jx-recent-order {
        flex-wrap: wrap;
    }
    
    .jx-recent-order-meta {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px dashed var(--jx-border);
    }
    
    .jx-form-row {
        grid-template-columns: 1fr;
    }
    
    .jx-profile-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .jx-profile-avatar {
        width: 56px;
        height: 56px;
    }
}
