:root {
            --bg-primary: #f5f5f5;
            --bg-secondary: #ffffff;
            --bg-gradient-start: #667eea;
            --bg-gradient-end: #764ba2;
            --text-primary: #333;
            --text-secondary: #555;
            --text-muted: #999;
            --border-color: #ddd;
            --border-light: #eee;
            --shadow: rgba(0,0,0,0.1);
            --shadow-medium: rgba(0,0,0,0.2);
            --shadow-strong: rgba(0,0,0,0.3);
            --input-bg: #ffffff;
            --btn-bg: #f0f0f0;
            --btn-bg-hover: #e0e0e0;
        }
        
        html.dark-theme-loading,
        body.dark-theme {
            --bg-primary: #1a1a1a;
            --bg-secondary: #2d2d2d;
            --bg-gradient-start: #4a5568;
            --bg-gradient-end: #2d3748;
            --text-primary: #e5e5e5;
            --text-secondary: #b8b8b8;
            --text-muted: #888;
            --border-color: #444;
            --border-light: #3a3a3a;
            --shadow: rgba(0,0,0,0.3);
            --shadow-medium: rgba(0,0,0,0.4);
            --shadow-strong: rgba(0,0,0,0.5);
            --input-bg: #383838;
            --btn-bg: #3a3a3a;
            --btn-bg-hover: #4a4a4a;
        }
        
        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif; background: var(--bg-primary); color: var(--text-primary); transition: background 0.3s, color 0.3s; }
        .theme-toggle { background: rgba(255,255,255,0.2); color: white; border: 2px solid rgba(255,255,255,0.5); padding: 0.6rem; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; transition: all 0.3s; display: flex; align-items: center; justify-content: center; }
        .theme-toggle:hover { background: rgba(255,255,255,0.3); border-color: rgba(255,255,255,0.8); transform: rotate(180deg); }
        .header { background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%); color: white; padding: 2rem; position: relative; box-shadow: 0 2px 8px var(--shadow); }
        .header h1 { font-size: 2rem; margin-bottom: 0.5rem; text-align: center; }
        .header p { opacity: 0.9; font-size: 1.1rem; text-align: center; }
        .header .auth-buttons { position: absolute; top: 1.5rem; right: 2rem; display: flex; gap: 0.75rem; align-items: center; }
        .container { max-width: 1400px; min-width: 800px; margin: 2rem auto; padding: 0 2rem; width: 100%; box-sizing: border-box; }
        .controls { background: var(--bg-secondary); padding: 1.5rem; border-radius: 10px; margin-bottom: 1.5rem; box-shadow: 0 2px 4px var(--shadow); width: 100%; box-sizing: border-box; }
        .search-box { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
        .search-box input { flex: 1; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 5px; font-size: 1rem; background: var(--input-bg); color: var(--text-primary); }
        .tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
        .tab { padding: 0.5rem 1rem; background: var(--btn-bg); border: none; border-radius: 5px; cursor: pointer; font-size: 0.9rem; transition: all 0.3s; color: var(--text-primary); }
        .tab.active { background: #667eea; color: white; }
        .tab:hover { background: var(--btn-bg-hover); }
        .tab.active:hover { background: #5568d3; }
        .btn { padding: 0.5rem 1rem; border: none; border-radius: 5px; cursor: pointer; font-size: 0.9rem; }
        .btn-primary { background: #667eea; color: white; }
        .btn-primary:hover { background: #5568d3; }
        .btn-secondary { background: var(--btn-bg); color: var(--text-primary); }
        .btn-secondary:hover { background: var(--btn-bg-hover); }
        .icon-btn { background: rgba(255,255,255,0.2); color: white; border: 2px solid rgba(255,255,255,0.5); padding: 0.6rem 0.8rem; border-radius: 8px; cursor: pointer; font-size: 1.2rem; transition: all 0.3s; display: flex; align-items: center; gap: 0.4rem; }
        .icon-btn:hover { background: rgba(255,255,255,0.3); border-color: rgba(255,255,255,0.8); transform: translateY(-2px); }
        .icon-btn span { font-size: 0.75rem; font-weight: 600; }
        table { width: 100%; background: var(--bg-secondary); border-radius: 10px; overflow: hidden; box-shadow: 0 2px 4px var(--shadow); table-layout: fixed; margin: 0; }
        th { background: #667eea; color: white; padding: 1rem; text-align: left; font-weight: 600; cursor: pointer; user-select: none; position: relative; }
        th:hover { background: #5568d3; }
        th.sortable::after { content: ' ⇅'; opacity: 0.5; font-size: 0.8rem; }
        th.sort-asc::after { content: ' ▲'; opacity: 1; }
        th.sort-desc::after { content: ' ▼'; opacity: 1; }
        th:nth-child(1) { width: 25%; } /* Item Name */
        th:nth-child(2) { width: 8%; }  /* Level */
        th:nth-child(3) { width: 10%; } /* Quality */
        th:nth-child(4) { width: 12%; } /* Class */
        th:nth-child(5) { width: 10%; } /* Price */
        th:nth-child(6) { width: 10%; } /* Sale Qty */
        th:nth-child(7) { width: 25%; } /* Seller / Contact */
        td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
        tr:hover { background: var(--btn-bg); }
        .table-container { min-height: 400px; width: 100%; display: block; overflow: hidden; }
        .table-container > * { width: 100%; }
        .no-items { width: 100%; text-align: center; padding: 3rem; margin: 0; color: var(--text-muted); background: var(--bg-secondary); border-radius: 10px; min-height: 400px; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 2px 4px var(--shadow); box-sizing: border-box; }
        .seller-link { display: inline-block; background: #667eea; color: white; padding: 0.25rem 0.5rem; border-radius: 3px; font-size: 0.8rem; text-decoration: none; transition: all 0.3s; }
        .seller-link:hover { background: #5568d3; transform: scale(1.05); }
        .discord-btn { background: #5865F2; color: white; padding: 0.35rem 0.65rem; border-radius: 4px; text-decoration: none; font-size: 0.75rem; display: inline-block; border: none; cursor: pointer; }
        .discord-btn:hover { background: #4752C4; }
        .discord-btn:disabled { background: #ccc; cursor: not-allowed; }
        
        /* Hide mobile-only details row on desktop */
        .mobile-details { display: none; }
        
        /* Vue cloak - hide until Vue is ready */
        [v-cloak] { display: none !important; }
        
        /* Modal Styles */
        .modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; }
        .modal-content { background: var(--bg-secondary); padding: 2rem; border-radius: 10px; box-shadow: 0 10px 40px var(--shadow-strong); width: 100%; max-width: 400px; position: relative; }
        .modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); }
        .modal-close:hover { color: var(--text-primary); }
        .modal-content h2 { margin-bottom: 1.5rem; color: var(--text-primary); text-align: center; }
        .form-group { margin-bottom: 1rem; }
        .form-group label { display: block; margin-bottom: 0.5rem; color: var(--text-secondary); font-weight: 500; }
        .form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: 5px; font-size: 1rem; background: var(--input-bg); color: var(--text-primary); }
        .form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #667eea; }
        .modal-btn { width: 100%; padding: 0.75rem; background: #667eea; color: white; border: none; border-radius: 5px; font-size: 1rem; cursor: pointer; font-weight: 600; }
        .modal-btn:hover { background: #5568d3; }
        .modal-btn:disabled { background: #ccc; cursor: not-allowed; }
        .modal-error { background: #fee; color: #c33; padding: 0.75rem; border-radius: 5px; margin-bottom: 1rem; border: 1px solid #fcc; }
        .modal-success { background: #efe; color: #3c3; padding: 0.75rem; border-radius: 5px; margin-bottom: 1rem; border: 1px solid #cfc; }
        .modal-switch { text-align: center; margin-top: 1rem; color: var(--text-secondary); font-size: 0.9rem; }
        .modal-switch a { color: #667eea; cursor: pointer; text-decoration: none; font-weight: 600; }
        .modal-switch a:hover { text-decoration: underline; }
        .password-requirements { background: #f8f9fa; border-left: 3px solid #667eea; padding: 0.75rem; margin-bottom: 1rem; font-size: 0.875rem; color: var(--text-secondary); border-radius: 3px; }
        body.dark-theme .password-requirements { background: #1a202c; }
        .password-requirements ul { margin: 0.5rem 0 0 1.25rem; }
        .password-requirements li { margin: 0.25rem 0; }
        .password-example { font-weight: 600; color: #667eea; margin-top: 0.5rem; }
        
        /* Hide Turnstile if disabled (empty sitekey) */
        .cf-turnstile[data-sitekey=""] { display: none !important; }
        
        /* Footer styles */
        .footer { background: #2d3748; color: #a0aec0; padding: 1rem; text-align: center; margin-top: auto; font-size: 0.7rem; }
        .footer p { margin: 0.25rem 0; opacity: 0.8; }
        .footer a { color: #667eea; text-decoration: none; opacity: 0.9; }
        .footer a:hover { text-decoration: underline; opacity: 1; }
        .esprices-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6) !important; }
        body { display: flex; flex-direction: column; min-height: 100vh; }
        #app { display: flex; flex-direction: column; min-height: 100vh; }
        .container { flex: 1; }
        
        /* Scroll to top button */
        .scroll-top { position: fixed; bottom: 2rem; right: 2rem; background: #667eea; color: white; width: 50px; height: 50px; border-radius: 50%; border: none; cursor: pointer; font-size: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.15); transition: all 0.3s; display: none; z-index: 999; opacity: 0.4; }
        .scroll-top.visible { display: block; }
        .scroll-top:hover { opacity: 1; transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.25); }
        
        @media (max-width: 768px) {
            body { overflow-x: hidden; }
            #app { overflow-x: hidden; max-width: 100vw; }
            .header { overflow-x: hidden; padding: 1rem; min-height: 60px; }
            .header h1 { display: none; } /* Hide title on mobile */
            .header p { display: none; } /* Hide subtitle on mobile */
            .header .auth-buttons { position: absolute; top: 1rem; right: 0.5rem; gap: 0.3rem; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100vw - 1rem); }
            .icon-btn { padding: 0.4rem 0.5rem; font-size: 0.9rem; white-space: nowrap; }
            .icon-btn span { display: none; }
            .theme-toggle { width: 35px; height: 35px; padding: 0.4rem; font-size: 1rem; flex-shrink: 0; }
            .container { padding: 0 0.5rem; max-width: 100%; overflow-x: hidden; }
            .controls { padding: 0.5rem; max-width: 100%; box-sizing: border-box; }
            .search-box { flex-direction: column; gap: 0.5rem; width: 100%; }
            .search-box input { width: 100%; box-sizing: border-box; }
            .search-box button { width: 100%; }
            .tabs { gap: 0.3rem; }
            .tab { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
            
            /* Mobile: Display each item as a card-like layout */
            table { display: block; width: 100%; font-size: 0.85rem; }
            thead { display: none; } /* Hide table headers on mobile */
            tbody { display: block; }
            tr { 
                display: grid;
                grid-template-columns: 1fr;
                grid-template-rows: auto auto auto;
                gap: 0.3rem;
                padding: 0.75rem;
                margin-bottom: 0.75rem;
                background: var(--bg-secondary);
                border: 1px solid var(--border-light);
                border-radius: 8px;
                box-shadow: 0 1px 3px var(--shadow);
            }
            tr:hover { background: var(--btn-bg); }
            
            /* Row 1: Item Name */
            td:nth-child(1) { /* Item Name */
                grid-column: 1;
                grid-row: 1;
                font-weight: bold;
                font-size: 0.95rem;
                padding: 0;
            }
            
            /* Row 2: Mobile details */
            .mobile-details {
                display: block !important;
                grid-column: 1;
                grid-row: 2;
                padding: 0;
                padding-top: 0.3rem;
                border: none !important;
                font-size: 0.8rem;
                color: var(--text-muted);
                line-height: 1.4;
            }
            
            /* Row 3: Seller and Contact on new line */
            td:nth-child(7) { /* Seller / Contact */
                grid-column: 1;
                grid-row: 3;
                padding: 0;
                padding-top: 0.3rem;
                white-space: normal;
            }
            
            /* Hide desktop detail cells */
            td:nth-child(2), /* Level */
            td:nth-child(3), /* Quality */
            td:nth-child(4), /* Class */
            td:nth-child(5), /* Price */
            td:nth-child(6) { /* Sale Qty */
                display: none;
            }
            
            .mobile-details span {
                white-space: nowrap;
            }
            
            /* Hide individual borders */
            td { border: none !important; }
            
            .seller-link { font-size: 0.75rem; padding: 0.2rem 0.4rem; }
            .discord-btn { font-size: 0.75rem; padding: 0.3rem 0.5rem; }
            
            /* Modal optimization for mobile */
            .modal-overlay { padding: 0.5rem; align-items: flex-start; overflow-y: auto; }
            .modal-content { 
                margin: 0.5rem; 
                padding: 1rem; 
                max-height: calc(100vh - 2rem); 
                overflow-y: auto;
                max-width: 100% !important;
            }
            .modal-content h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }
            .modal-content h3 { font-size: 0.85rem !important; margin-bottom: 0.5rem !important; }
            .form-group { margin-bottom: 0.75rem !important; }
            .form-group label { font-size: 0.75rem !important; margin-bottom: 0.25rem !important; }
            .form-group input, .form-group select, .form-group textarea { 
                padding: 0.5rem !important; 
                font-size: 0.85rem !important; 
            }
            .modal-btn { padding: 0.6rem !important; font-size: 0.9rem !important; }
            .password-requirements { 
                display: none !important;
            }
            
            /* Quick Add modal optimization */
            .modal-content[style*="max-width: 600px"] {
                max-width: 100% !important;
            }
            .modal-content textarea {
                min-height: 100px !important;
            }
            .modal-content > div > div[style*="grid-template-columns"] {
                display: flex !important;
                flex-direction: column !important;
                gap: 0.5rem !important;
            }
            
            .no-items { padding: 2rem 1rem; }
        }
        
        @media (max-width: 480px) {
            .header { padding: 1rem; }
            .header h1 { font-size: 1.2rem; }
            .header p { font-size: 0.8rem; }
            
            tr { 
                padding: 0.6rem;
                margin-bottom: 0.5rem;
                gap: 0.25rem 0.4rem;
            }
            
            td:nth-child(1) { /* Item Name */
                font-size: 0.85rem;
            }
            
            .mobile-details {
                font-size: 0.75rem;
                padding-top: 0.25rem;
            }
            
            .seller-link { font-size: 0.7rem; padding: 0.15rem 0.35rem; }
            .discord-btn { font-size: 0.7rem; padding: 0.25rem 0.4rem; }
            .scroll-top { bottom: 1rem; right: 1rem; width: 40px; height: 40px; font-size: 1.2rem; }
        }
