body { font-family: 'Inter', 'Sarabun', sans-serif; background-color: var(--bg-body); margin: 0; padding: 0; color: var(--text-primary); -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }

        .top-header { position: fixed; top: 0; left: 0; right: 0; height: var(--header-height); background: var(--bg-surface); border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; padding: 0 24px; z-index: 1000; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
        .header-brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; color: var(--text-primary); width: var(--sidebar-width); }
        .header-brand img { height: 44px; margin-left: 12px; object-fit: contain; }
        .header-actions { display: flex; align-items: center; gap: 16px; }
        
        .profile-btn { display: flex; align-items: center; gap: 10px; background: #f8fafc; padding: 6px 16px 6px 6px; border-radius: 30px; border: 1px solid var(--border-light); cursor: pointer; transition: 0.2s; }
        .profile-btn:hover { background: #edf7ff; border-color: #badef7; }
        .profile-btn img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
        .profile-info-text { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
        .profile-info-text .user-name { font-size: 14px; font-weight: 700; color: var(--text-primary); line-height: 1.2;}
        .profile-info-text .manage-text { font-size: 11px; font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 4px; margin-top: 2px;}

        .btn-outline { background: transparent; border: 1px solid var(--border-light); color: var(--text-secondary); padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 6px; font-family: inherit; }
        .btn-outline:hover { background: #fee2e2; color: var(--danger); border-color: #fca5a5; }
        .mobile-toggle { display: none; background: transparent; border: none; font-size: 28px; color: var(--text-primary); cursor: pointer; }

        .layout-wrapper { display: flex; flex: 1; margin-top: var(--header-height); min-height: calc(100vh - var(--header-height)); }

        .left-sidebar { width: var(--sidebar-width); background: var(--bg-surface); border-right: 1px solid var(--border-light); display: flex; flex-direction: column; padding: 24px 0; transition: left 0.3s ease; z-index: 900; position: fixed; bottom: 0; top: var(--header-height); overflow-y: auto;}
        .menu-title { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; margin: 0 24px 12px 24px; }
        .menu-list { list-style: none; padding: 0; margin: 0 0 24px 0; }
        .menu-item { display: flex; align-items: center; gap: 12px; padding: 12px 24px; color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 600; transition: 0.2s; position: relative; cursor: pointer; }
        .menu-item:hover, .menu-item.active { background: #edf7ff; color: var(--primary); }
        .menu-item.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); border-radius: 0 4px 4px 0; }
        .menu-item i { font-size: 20px; }

        .main-content { flex: 1; margin-left: var(--sidebar-width); padding: 40px; display: flex; flex-direction: column; align-items: center; background: var(--bg-body); }
        .content-container { width: 100%; max-width: 800px; background: var(--bg-surface); border-radius: 16px; border: 1px solid var(--border-light); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); padding: 32px; box-sizing: border-box; }
        
        .section-header { text-align: center; margin-bottom: 32px; }
        .section-header h2 { margin: 0 0 8px 0; color: var(--text-primary); font-size: 24px; display: flex; justify-content: center; align-items: center; gap: 10px; }
        .section-header p { margin: 0; color: var(--text-secondary); font-size: 14px; }

        .upload-zone { border: 2px dashed #cbd5e1; border-radius: 12px; padding: 40px 20px; text-align: center; background: var(--input-bg); transition: 0.2s; cursor: pointer; position: relative; margin-bottom: 24px;}
        .upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: #edf7ff; }
        .upload-zone i { font-size: 48px; color: #94a3b8; margin-bottom: 16px; transition: 0.2s;}
        .upload-zone:hover i, .upload-zone.dragover i { color: var(--primary); }
        .upload-zone h4 { margin: 0 0 8px 0; font-size: 16px; color: var(--text-primary); }
        .upload-zone p { margin: 0; font-size: 13px; color: var(--text-secondary); }
        #file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

        .file-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
        .file-item { display: flex; align-items: center; justify-content: space-between; background: var(--bg-surface); border: 1px solid var(--border-light); padding: 12px 16px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.02); transition: 0.2s; cursor: grab; }
        .file-item:active { cursor: grabbing; box-shadow: 0 4px 10px rgba(0,0,0,0.05); border-color: var(--primary); }
        .file-info { display: flex; align-items: center; gap: 12px; flex: 1; overflow: hidden; }
        .file-info i { color: var(--danger); font-size: 24px; }
        .file-name { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .file-size { font-size: 12px; color: var(--text-secondary); }
        .btn-remove { background: #fee2e2; color: var(--danger); border: none; width: 32px; height: 32px; border-radius: 6px; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: 0.2s; font-size: 16px;}
        .btn-remove:hover { background: #fca5a5; }

        .action-area { display: flex; gap: 16px; border-top: 1px solid var(--border-light); padding-top: 24px; }
        .btn-merge { flex: 2; background: var(--success); color: white; border: none; padding: 16px; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; transition: 0.2s; display: flex; justify-content: center; align-items: center; gap: 8px; font-family: inherit; box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);}
        .btn-merge:hover:not(:disabled) { background: #059669; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3); }
        .btn-merge:disabled { background: #94a3b8; cursor: not-allowed; box-shadow: none; transform: none; }
        .btn-clear { flex: 1; background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-light); padding: 16px; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; transition: 0.2s; font-family: inherit;}
        .btn-clear:hover { background: var(--input-bg); border-color: #cbd5e1; }

        .loading-screen-main { position: fixed; inset: 0; background: rgba(248, 250, 252, 0.9); backdrop-filter: blur(4px); display: none; justify-content: center; align-items: center; flex-direction: column; z-index: 9999; }
        .spinner-main { border: 4px solid var(--border-light); border-top: 4px solid var(--primary); border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; margin-bottom: 20px; }
        @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

        @media (max-width: 768px) {
            .left-sidebar { position: fixed; left: -100%; top: var(--header-height); bottom: 0; box-shadow: 4px 0 10px rgba(0,0,0,0.1); width: 260px; z-index: 1000; }
            .left-sidebar.show { left: 0; }
            .mobile-toggle { display: block; }
            
            .header-brand { width: auto; gap: 8px; font-size: 18px; }
            .header-brand span { display: none; }
            .header-actions { gap: 10px; }
            .profile-btn { padding: 4px; border-radius: 50%; }
            .profile-info-text { display: none; }
            .btn-outline .hide-mobile { display: none; }
            .btn-outline { padding: 8px; width: 36px; height: 36px; display: flex; justify-content: center; align-items: center; border-radius: 50%; }

            .main-content { margin-left: 0; padding: 16px; }
            .content-container { padding: 20px; border-radius: 12px; }
            .section-header h2 { font-size: 20px; flex-direction: column; gap: 4px;}
            .section-header p { font-size: 13px; line-height: 1.5; padding: 0 10px; }
            .upload-zone { padding: 24px 16px; }
            
            .action-area { flex-direction: column-reverse; gap: 12px; }
            .btn-merge, .btn-clear { width: 100%; padding: 14px; font-size: 14px; }
        }

